From bc7d1fa8035154fbe778b6605e8aacfcf7d87de3 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 24 Mar 2023 08:58:30 +0000 Subject: [PATCH 1/2] feat: add `RunAccessReport` method (with bindings for account and property resources) to the Admin API v1beta feat: add `AccessDimension`, `AccessMetric`, `AccessDateRange`, `AccessFilterExpression`, `AccessFilterExpressionList`, `AccessFilter`, `AccessStringFilter`, `AccessInListFilter`, `AccessNumericFilter`, `AccessBetweenFilter`, `NumericValue`, `AccessOrderBy`, `AccessDimensionHeader`, `AccessMetricHeader`, `AccessRow`, `AccessDimensionValue`, `AccessMetricValue`, `AccessQuota`, `AccessQuotaStatus` types to the Admin API v1beta PiperOrigin-RevId: 519058583 Source-Link: https://github.com/googleapis/googleapis/commit/71bd02eaf0e43eabd23b9f68339a4f4751c07e65 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5d4f0f6b45923d62c7eec656bacc3f0633e011f7 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFuYWx5dGljcy1hZG1pbi8uT3dsQm90LnlhbWwiLCJoIjoiNWQ0ZjBmNmI0NTkyM2Q2MmM3ZWVjNjU2YmFjYzNmMDYzM2UwMTFmNyJ9 --- .../v1alpha/.eslintignore | 7 + .../v1alpha/.eslintrc.json | 3 + .../google-analytics-admin/v1alpha/.gitignore | 14 + .../google-analytics-admin/v1alpha/.jsdoc.js | 55 + .../v1alpha/.mocharc.js | 33 + .../v1alpha/.prettierrc.js | 22 + .../google-analytics-admin/v1alpha/README.md | 1 + .../v1alpha/linkinator.config.json | 16 + .../v1alpha/package.json | 64 + .../admin/v1alpha/access_report.proto | 334 + .../admin/v1alpha/analytics_admin.proto | 3264 ++++ .../analytics/admin/v1alpha/audience.proto | 419 + .../admin/v1alpha/expanded_data_set.proto | 151 + .../analytics/admin/v1alpha/resources.proto | 1555 ++ ...ervice.acknowledge_user_data_collection.js | 72 + ...splay_video360_advertiser_link_proposal.js | 62 + ...nalytics_admin_service.archive_audience.js | 61 + ..._admin_service.archive_custom_dimension.js | 62 + ...ics_admin_service.archive_custom_metric.js | 62 + ...nalytics_admin_service.audit_user_links.js | 77 + ...in_service.batch_create_access_bindings.js | 71 + ...s_admin_service.batch_create_user_links.js | 76 + ...in_service.batch_delete_access_bindings.js | 71 + ...s_admin_service.batch_delete_user_links.js | 70 + ...admin_service.batch_get_access_bindings.js | 74 + ...tics_admin_service.batch_get_user_links.js | 71 + ...in_service.batch_update_access_bindings.js | 72 + ...s_admin_service.batch_update_user_links.js | 70 + ...splay_video360_advertiser_link_proposal.js | 62 + ...ics_admin_service.create_access_binding.js | 68 + ...analytics_admin_service.create_audience.js | 66 + ...admin_service.create_connected_site_tag.js | 68 + ...s_admin_service.create_conversion_event.js | 67 + ...s_admin_service.create_custom_dimension.js | 66 + ...tics_admin_service.create_custom_metric.js | 66 + ...lytics_admin_service.create_data_stream.js | 66 + ...create_display_video360_advertiser_link.js | 66 + ...splay_video360_advertiser_link_proposal.js | 66 + ..._admin_service.create_expanded_data_set.js | 66 + ...tics_admin_service.create_firebase_link.js | 67 + ...cs_admin_service.create_google_ads_link.js | 66 + ...vice.create_measurement_protocol_secret.js | 67 + ...analytics_admin_service.create_property.js | 62 + ...admin_service.create_search_ads360_link.js | 66 + ...nalytics_admin_service.create_user_link.js | 71 + ...ics_admin_service.delete_access_binding.js | 63 + .../analytics_admin_service.delete_account.js | 63 + ...admin_service.delete_connected_site_tag.js | 68 + ...s_admin_service.delete_conversion_event.js | 63 + ...lytics_admin_service.delete_data_stream.js | 62 + ...delete_display_video360_advertiser_link.js | 62 + ...splay_video360_advertiser_link_proposal.js | 62 + ..._admin_service.delete_expanded_data_set.js | 61 + ...tics_admin_service.delete_firebase_link.js | 62 + ...cs_admin_service.delete_google_ads_link.js | 61 + ...vice.delete_measurement_protocol_secret.js | 63 + ...analytics_admin_service.delete_property.js | 63 + ...admin_service.delete_search_ads360_link.js | 62 + ...nalytics_admin_service.delete_user_link.js | 61 + ...tch_automated_ga4_configuration_opt_out.js | 64 + ...lytics_admin_service.get_access_binding.js | 64 + .../analytics_admin_service.get_account.js | 63 + ..._admin_service.get_attribution_settings.js | 62 + .../analytics_admin_service.get_audience.js | 62 + ...lytics_admin_service.get_big_query_link.js | 63 + ...tics_admin_service.get_conversion_event.js | 63 + ...tics_admin_service.get_custom_dimension.js | 62 + ...alytics_admin_service.get_custom_metric.js | 62 + ...min_service.get_data_retention_settings.js | 64 + ...admin_service.get_data_sharing_settings.js | 63 + ...analytics_admin_service.get_data_stream.js | 62 + ...ce.get_display_video360_advertiser_link.js | 62 + ...splay_video360_advertiser_link_proposal.js | 62 + ...rvice.get_enhanced_measurement_settings.js | 64 + ...ics_admin_service.get_expanded_data_set.js | 62 + ...ytics_admin_service.get_global_site_tag.js | 64 + ...min_service.get_google_signals_settings.js | 62 + ...service.get_measurement_protocol_secret.js | 63 + .../analytics_admin_service.get_property.js | 63 + ...cs_admin_service.get_search_ads360_link.js | 62 + .../analytics_admin_service.get_user_link.js | 61 + ...tics_admin_service.list_access_bindings.js | 79 + ...cs_admin_service.list_account_summaries.js | 72 + .../analytics_admin_service.list_accounts.js | 78 + .../analytics_admin_service.list_audiences.js | 76 + ...tics_admin_service.list_big_query_links.js | 79 + ..._admin_service.list_connected_site_tags.js | 63 + ...cs_admin_service.list_conversion_events.js | 77 + ...cs_admin_service.list_custom_dimensions.js | 76 + ...ytics_admin_service.list_custom_metrics.js | 76 + ...alytics_admin_service.list_data_streams.js | 76 + ...play_video360_advertiser_link_proposals.js | 78 + ....list_display_video360_advertiser_links.js | 77 + ...s_admin_service.list_expanded_data_sets.js | 76 + ...ytics_admin_service.list_firebase_links.js | 78 + ...ics_admin_service.list_google_ads_links.js | 76 + ...rvice.list_measurement_protocol_secrets.js | 78 + ...analytics_admin_service.list_properties.js | 97 + ..._admin_service.list_search_ads360_links.js | 77 + ...analytics_admin_service.list_user_links.js | 77 + ..._admin_service.provision_account_ticket.js | 65 + ...alytics_admin_service.run_access_report.js | 139 + ...in_service.search_change_history_events.js | 107 + ...set_automated_ga4_configuration_opt_out.js | 68 + ...ics_admin_service.update_access_binding.js | 61 + .../analytics_admin_service.update_account.js | 70 + ...min_service.update_attribution_settings.js | 70 + ...analytics_admin_service.update_audience.js | 70 + ...s_admin_service.update_custom_dimension.js | 67 + ...tics_admin_service.update_custom_metric.js | 67 + ..._service.update_data_retention_settings.js | 70 + ...lytics_admin_service.update_data_stream.js | 67 + ...update_display_video360_advertiser_link.js | 67 + ...ce.update_enhanced_measurement_settings.js | 70 + ..._admin_service.update_expanded_data_set.js | 71 + ...cs_admin_service.update_google_ads_link.js | 68 + ..._service.update_google_signals_settings.js | 70 + ...vice.update_measurement_protocol_secret.js | 65 + ...analytics_admin_service.update_property.js | 71 + ...admin_service.update_search_ads360_link.js | 67 + ...nalytics_admin_service.update_user_link.js | 61 + ...tadata.google.analytics.admin.v1alpha.json | 4695 +++++ .../v1alpha/src/index.ts | 25 + .../v1alpha/analytics_admin_service_client.ts | 11750 ++++++++++++ ...analytics_admin_service_client_config.json | 574 + .../analytics_admin_service_proto_list.json | 7 + .../v1alpha/src/v1alpha/gapic_metadata.json | 1173 ++ .../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 | 15039 ++++++++++++++++ .../v1alpha/tsconfig.json | 19 + .../v1alpha/webpack.config.js | 64 + .../v1beta/.eslintignore | 7 + .../v1beta/.eslintrc.json | 3 + .../google-analytics-admin/v1beta/.gitignore | 14 + .../google-analytics-admin/v1beta/.jsdoc.js | 55 + .../google-analytics-admin/v1beta/.mocharc.js | 33 + .../v1beta/.prettierrc.js | 22 + .../google-analytics-admin/v1beta/README.md | 1 + .../v1beta/linkinator.config.json | 16 + .../v1beta/package.json | 64 + .../admin/v1beta/access_report.proto | 334 + .../admin/v1beta/analytics_admin.proto | 1517 ++ .../analytics/admin/v1beta/resources.proto | 922 + ...ervice.acknowledge_user_data_collection.js | 72 + ..._admin_service.archive_custom_dimension.js | 62 + ...ics_admin_service.archive_custom_metric.js | 62 + ...s_admin_service.create_conversion_event.js | 67 + ...s_admin_service.create_custom_dimension.js | 66 + ...tics_admin_service.create_custom_metric.js | 66 + ...lytics_admin_service.create_data_stream.js | 66 + ...tics_admin_service.create_firebase_link.js | 67 + ...cs_admin_service.create_google_ads_link.js | 66 + ...vice.create_measurement_protocol_secret.js | 67 + ...analytics_admin_service.create_property.js | 62 + .../analytics_admin_service.delete_account.js | 63 + ...s_admin_service.delete_conversion_event.js | 63 + ...lytics_admin_service.delete_data_stream.js | 62 + ...tics_admin_service.delete_firebase_link.js | 62 + ...cs_admin_service.delete_google_ads_link.js | 61 + ...vice.delete_measurement_protocol_secret.js | 63 + ...analytics_admin_service.delete_property.js | 63 + .../analytics_admin_service.get_account.js | 63 + ...tics_admin_service.get_conversion_event.js | 63 + ...tics_admin_service.get_custom_dimension.js | 62 + ...alytics_admin_service.get_custom_metric.js | 62 + ...min_service.get_data_retention_settings.js | 64 + ...admin_service.get_data_sharing_settings.js | 63 + ...analytics_admin_service.get_data_stream.js | 62 + ...service.get_measurement_protocol_secret.js | 63 + .../analytics_admin_service.get_property.js | 63 + ...cs_admin_service.list_account_summaries.js | 72 + .../analytics_admin_service.list_accounts.js | 78 + ...cs_admin_service.list_conversion_events.js | 77 + ...cs_admin_service.list_custom_dimensions.js | 76 + ...ytics_admin_service.list_custom_metrics.js | 76 + ...alytics_admin_service.list_data_streams.js | 76 + ...ytics_admin_service.list_firebase_links.js | 78 + ...ics_admin_service.list_google_ads_links.js | 76 + ...rvice.list_measurement_protocol_secrets.js | 78 + ...analytics_admin_service.list_properties.js | 97 + ..._admin_service.provision_account_ticket.js | 65 + ...alytics_admin_service.run_access_report.js | 139 + ...in_service.search_change_history_events.js | 107 + .../analytics_admin_service.update_account.js | 70 + ...s_admin_service.update_custom_dimension.js | 67 + ...tics_admin_service.update_custom_metric.js | 67 + ..._service.update_data_retention_settings.js | 70 + ...lytics_admin_service.update_data_stream.js | 67 + ...cs_admin_service.update_google_ads_link.js | 68 + ...vice.update_measurement_protocol_secret.js | 65 + ...analytics_admin_service.update_property.js | 71 + ...etadata.google.analytics.admin.v1beta.json | 2155 +++ .../v1beta/src/index.ts | 25 + .../v1beta/analytics_admin_service_client.ts | 5766 ++++++ ...analytics_admin_service_client_config.json | 279 + .../analytics_admin_service_proto_list.json | 5 + .../v1beta/src/v1beta/gapic_metadata.json | 547 + .../v1beta/src/v1beta/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1beta/system-test/install.ts | 49 + .../gapic_analytics_admin_service_v1beta.ts | 7071 ++++++++ .../v1beta/tsconfig.json | 19 + .../v1beta/webpack.config.js | 64 + 207 files changed, 69171 insertions(+) create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/.eslintignore create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/.eslintrc.json create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/.gitignore create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/.jsdoc.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/.mocharc.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/.prettierrc.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/README.md create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/linkinator.config.json create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/package.json create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/access_report.proto create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/analytics_admin.proto create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/audience.proto create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/expanded_data_set.proto create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_audience.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.audit_user_links.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_access_bindings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_user_links.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_access_bindings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_user_links.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_access_bindings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_user_links.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_access_bindings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_user_links.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_access_binding.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_audience.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_connected_site_tag.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_expanded_data_set.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_property.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_search_ads360_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_user_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_access_binding.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_account.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_connected_site_tag.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_expanded_data_set.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_property.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_search_ads360_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_user_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_access_binding.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_account.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_attribution_settings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_audience.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_big_query_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_enhanced_measurement_settings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_expanded_data_set.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_property.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_search_ads360_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_user_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_access_bindings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_accounts.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_audiences.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_big_query_links.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_connected_site_tags.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_expanded_data_sets.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_properties.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_search_ads360_links.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_user_links.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.run_access_report.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.set_automated_ga4_configuration_opt_out.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_access_binding.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_account.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_attribution_settings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_audience.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_enhanced_measurement_settings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_expanded_data_set.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_property.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_search_ads360_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_user_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/src/index.ts create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client.ts create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client_config.json create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_proto_list.json create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/gapic_metadata.json create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/index.ts create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/system-test/install.ts create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/test/gapic_analytics_admin_service_v1alpha.ts create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/tsconfig.json create mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/webpack.config.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/.eslintignore create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/.eslintrc.json create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/.gitignore create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/.jsdoc.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/.mocharc.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/.prettierrc.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/README.md create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/linkinator.config.json create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/package.json create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/access_report.proto create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/analytics_admin.proto create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/resources.proto create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_dimension.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_metric.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_dimension.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_metric.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_data_stream.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_firebase_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_google_ads_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_measurement_protocol_secret.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_property.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_account.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_conversion_event.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_data_stream.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_firebase_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_google_ads_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_measurement_protocol_secret.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_property.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_account.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_conversion_event.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_dimension.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_metric.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_retention_settings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_sharing_settings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_stream.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_measurement_protocol_secret.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_property.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_account_summaries.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_accounts.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_conversion_events.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_dimensions.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_metrics.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_data_streams.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_google_ads_links.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_properties.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.run_access_report.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_account.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_stream.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_measurement_protocol_secret.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_property.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/src/index.ts create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client.ts create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client_config.json create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_proto_list.json create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/gapic_metadata.json create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/index.ts create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/system-test/install.ts create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/test/gapic_analytics_admin_service_v1beta.ts create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/tsconfig.json create mode 100644 owl-bot-staging/google-analytics-admin/v1beta/webpack.config.js diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/.eslintignore b/owl-bot-staging/google-analytics-admin/v1alpha/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/.eslintrc.json b/owl-bot-staging/google-analytics-admin/v1alpha/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/.gitignore b/owl-bot-staging/google-analytics-admin/v1alpha/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/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/google-analytics-admin/v1alpha/.jsdoc.js b/owl-bot-staging/google-analytics-admin/v1alpha/.jsdoc.js new file mode 100644 index 00000000000..909f62e0847 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 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 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-analytics/admin', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/.mocharc.js b/owl-bot-staging/google-analytics-admin/v1alpha/.mocharc.js new file mode 100644 index 00000000000..1a38f257db7 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2023 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/google-analytics-admin/v1alpha/.prettierrc.js b/owl-bot-staging/google-analytics-admin/v1alpha/.prettierrc.js new file mode 100644 index 00000000000..55639e70f9e --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2023 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/google-analytics-admin/v1alpha/README.md b/owl-bot-staging/google-analytics-admin/v1alpha/README.md new file mode 100644 index 00000000000..5d45b74ed37 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/README.md @@ -0,0 +1 @@ +Admin: Nodejs Client diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/linkinator.config.json b/owl-bot-staging/google-analytics-admin/v1alpha/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/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/google-analytics-admin/v1alpha/package.json b/owl-bot-staging/google-analytics-admin/v1alpha/package.json new file mode 100644 index 00000000000..887c3c07385 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/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/ && minifyProtoJson", + "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.5.7" + }, + "devDependencies": { + "@types/mocha": "^10.0.1", + "@types/node": "^18.11.18", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.1.2", + "mocha": "^10.2.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.1", + "ts-loader": "^8.4.0", + "typescript": "^4.8.4", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/access_report.proto b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/access_report.proto new file mode 100644 index 00000000000..eb489c2523f --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/access_report.proto @@ -0,0 +1,334 @@ +// Copyright 2023 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; + +option go_package = "google.golang.org/genproto/googleapis/analytics/admin/v1alpha;admin"; +option java_multiple_files = true; +option java_outer_classname = "AccessReportProto"; +option java_package = "com.google.analytics.admin.v1alpha"; + +// Dimensions are attributes of your data. For example, the dimension +// `userEmail` indicates the email of the user that accessed reporting data. +// Dimension values in report responses are strings. +message AccessDimension { + // The API name of the dimension. See [Data Access + // Schema](https://developers.google.com/analytics/devguides/config/admin/v1/access-api-schema) + // for the list of dimensions supported in this API. + // + // Dimensions are referenced by name in `dimensionFilter` and `orderBys`. + string dimension_name = 1; +} + +// The quantitative measurements of a report. For example, the metric +// `accessCount` is the total number of data access records. +message AccessMetric { + // The API name of the metric. See [Data Access + // Schema](https://developers.google.com/analytics/devguides/config/admin/v1/access-api-schema) + // for the list of metrics supported in this API. + // + // Metrics are referenced by name in `metricFilter` & `orderBys`. + string metric_name = 1; +} + +// A contiguous range of days: startDate, startDate + 1, ..., endDate. +message AccessDateRange { + // The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot + // be after `endDate`. The format `NdaysAgo`, `yesterday`, or `today` is also + // accepted, and in that case, the date is inferred based on the current time + // in the request's time zone. + string start_date = 1; + + // The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot + // be before `startDate`. The format `NdaysAgo`, `yesterday`, or `today` is + // also accepted, and in that case, the date is inferred based on the current + // time in the request's time zone. + string end_date = 2; +} + +// Expresses dimension or metric filters. The fields in the same expression need +// to be either all dimensions or all metrics. +message AccessFilterExpression { + // Specify one type of filter expression for `FilterExpression`. + oneof one_expression { + // Each of the FilterExpressions in the and_group has an AND relationship. + AccessFilterExpressionList and_group = 1; + + // Each of the FilterExpressions in the or_group has an OR relationship. + AccessFilterExpressionList or_group = 2; + + // The FilterExpression is NOT of not_expression. + AccessFilterExpression not_expression = 3; + + // A primitive filter. In the same FilterExpression, all of the filter's + // field names need to be either all dimensions or all metrics. + AccessFilter access_filter = 4; + } +} + +// A list of filter expressions. +message AccessFilterExpressionList { + // A list of filter expressions. + repeated AccessFilterExpression expressions = 1; +} + +// An expression to filter dimension or metric values. +message AccessFilter { + // Specify one type of filter for `Filter`. + oneof one_filter { + // Strings related filter. + AccessStringFilter string_filter = 2; + + // A filter for in list values. + AccessInListFilter in_list_filter = 3; + + // A filter for numeric or date values. + AccessNumericFilter numeric_filter = 4; + + // A filter for two values. + AccessBetweenFilter between_filter = 5; + } + + // The dimension name or metric name. + string field_name = 1; +} + +// The filter for strings. +message AccessStringFilter { + // The match type of a string filter. + enum MatchType { + // Unspecified + MATCH_TYPE_UNSPECIFIED = 0; + + // Exact match of the string value. + EXACT = 1; + + // Begins with the string value. + BEGINS_WITH = 2; + + // Ends with the string value. + ENDS_WITH = 3; + + // Contains the string value. + CONTAINS = 4; + + // Full match for the regular expression with the string value. + FULL_REGEXP = 5; + + // Partial match for the regular expression with the string value. + PARTIAL_REGEXP = 6; + } + + // The match type for this filter. + MatchType match_type = 1; + + // The string value used for the matching. + string value = 2; + + // If true, the string value is case sensitive. + bool case_sensitive = 3; +} + +// The result needs to be in a list of string values. +message AccessInListFilter { + // The list of string values. Must be non-empty. + repeated string values = 1; + + // If true, the string value is case sensitive. + bool case_sensitive = 2; +} + +// Filters for numeric or date values. +message AccessNumericFilter { + // The operation applied to a numeric filter. + enum Operation { + // Unspecified. + OPERATION_UNSPECIFIED = 0; + + // Equal + EQUAL = 1; + + // Less than + LESS_THAN = 2; + + // Less than or equal + LESS_THAN_OR_EQUAL = 3; + + // Greater than + GREATER_THAN = 4; + + // Greater than or equal + GREATER_THAN_OR_EQUAL = 5; + } + + // The operation type for this filter. + Operation operation = 1; + + // A numeric value or a date value. + NumericValue value = 2; +} + +// To express that the result needs to be between two numbers (inclusive). +message AccessBetweenFilter { + // Begins with this number. + NumericValue from_value = 1; + + // Ends with this number. + NumericValue to_value = 2; +} + +// To represent a number. +message NumericValue { + // One of a numeric value + oneof one_value { + // Integer value + int64 int64_value = 1; + + // Double value + double double_value = 2; + } +} + +// Order bys define how rows will be sorted in the response. For example, +// ordering rows by descending access count is one ordering, and ordering rows +// by the country string is a different ordering. +message AccessOrderBy { + // Sorts by metric values. + message MetricOrderBy { + // A metric name in the request to order by. + string metric_name = 1; + } + + // Sorts by dimension values. + message DimensionOrderBy { + // Rule to order the string dimension values by. + enum OrderType { + // Unspecified. + ORDER_TYPE_UNSPECIFIED = 0; + + // Alphanumeric sort by Unicode code point. For example, "2" < "A" < "X" < + // "b" < "z". + ALPHANUMERIC = 1; + + // Case insensitive alphanumeric sort by lower case Unicode code point. + // For example, "2" < "A" < "b" < "X" < "z". + CASE_INSENSITIVE_ALPHANUMERIC = 2; + + // Dimension values are converted to numbers before sorting. For example + // in NUMERIC sort, "25" < "100", and in `ALPHANUMERIC` sort, "100" < + // "25". Non-numeric dimension values all have equal ordering value below + // all numeric values. + NUMERIC = 3; + } + + // A dimension name in the request to order by. + string dimension_name = 1; + + // Controls the rule for dimension value ordering. + OrderType order_type = 2; + } + + // Specify one type of order by for `OrderBy`. + oneof one_order_by { + // Sorts results by a metric's values. + MetricOrderBy metric = 1; + + // Sorts results by a dimension's values. + DimensionOrderBy dimension = 2; + } + + // If true, sorts by descending order. If false or unspecified, sorts in + // ascending order. + bool desc = 3; +} + +// Describes a dimension column in the report. Dimensions requested in a report +// produce column entries within rows and DimensionHeaders. However, dimensions +// used exclusively within filters or expressions do not produce columns in a +// report; correspondingly, those dimensions do not produce headers. +message AccessDimensionHeader { + // The dimension's name; for example 'userEmail'. + string dimension_name = 1; +} + +// Describes a metric column in the report. Visible metrics requested in a +// report produce column entries within rows and MetricHeaders. However, +// metrics used exclusively within filters or expressions do not produce columns +// in a report; correspondingly, those metrics do not produce headers. +message AccessMetricHeader { + // The metric's name; for example 'accessCount'. + string metric_name = 1; +} + +// Access report data for each row. +message AccessRow { + // List of dimension values. These values are in the same order as specified + // in the request. + repeated AccessDimensionValue dimension_values = 1; + + // List of metric values. These values are in the same order as specified + // in the request. + repeated AccessMetricValue metric_values = 2; +} + +// The value of a dimension. +message AccessDimensionValue { + // The dimension value. For example, this value may be 'France' for the + // 'country' dimension. + string value = 1; +} + +// The value of a metric. +message AccessMetricValue { + // The measurement value. For example, this value may be '13'. + string value = 1; +} + +// Current state of all quotas for this Analytics property. If any quota for a +// property is exhausted, all requests to that property will return Resource +// Exhausted errors. +message AccessQuota { + // Properties can use 250,000 tokens per day. Most requests consume fewer than + // 10 tokens. + AccessQuotaStatus tokens_per_day = 1; + + // Properties can use 50,000 tokens per hour. An API request consumes a single + // number of tokens, and that number is deducted from all of the hourly, + // daily, and per project hourly quotas. + AccessQuotaStatus tokens_per_hour = 2; + + // Properties can use up to 50 concurrent requests. + AccessQuotaStatus concurrent_requests = 3; + + // Properties and cloud project pairs can have up to 50 server errors per + // hour. + AccessQuotaStatus server_errors_per_project_per_hour = 4; + + // Properties can use up to 25% of their tokens per project per hour. This + // amounts to Analytics 360 Properties can use 12,500 tokens per project per + // hour. An API request consumes a single number of tokens, and that number is + // deducted from all of the hourly, daily, and per project hourly quotas. + AccessQuotaStatus tokens_per_project_per_hour = 5; +} + +// Current state for a particular quota group. +message AccessQuotaStatus { + // Quota consumed by this request. + int32 consumed = 1; + + // Quota remaining after this request. + int32 remaining = 2; +} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/analytics_admin.proto b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/analytics_admin.proto new file mode 100644 index 00000000000..cbcf3155ca0 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/analytics_admin.proto @@ -0,0 +1,3264 @@ +// Copyright 2023 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/access_report.proto"; +import "google/analytics/admin/v1alpha/audience.proto"; +import "google/analytics/admin/v1alpha/expanded_data_set.proto"; +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 a 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 through 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"; + } + + // Lookup for a single Audience. + // Audiences created before 2020 may not be supported. + // Default audiences will not show filter definitions. + rpc GetAudience(GetAudienceRequest) returns (Audience) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/audiences/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Audiences on a property. + // Audiences created before 2020 may not be supported. + // Default audiences will not show filter definitions. + rpc ListAudiences(ListAudiencesRequest) returns (ListAudiencesResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=properties/*}/audiences" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates an Audience. + rpc CreateAudience(CreateAudienceRequest) returns (Audience) { + option (google.api.http) = { + post: "/v1alpha/{parent=properties/*}/audiences" + body: "audience" + }; + option (google.api.method_signature) = "parent,audience"; + } + + // Updates an Audience on a property. + rpc UpdateAudience(UpdateAudienceRequest) returns (Audience) { + option (google.api.http) = { + patch: "/v1alpha/{audience.name=properties/*/audiences/*}" + body: "audience" + }; + option (google.api.method_signature) = "audience,update_mask"; + } + + // Archives an Audience on a property. + rpc ArchiveAudience(ArchiveAudienceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1alpha/{name=properties/*/audiences/*}:archive" + body: "*" + }; + } + + // Look up a single SearchAds360Link + rpc GetSearchAds360Link(GetSearchAds360LinkRequest) + returns (SearchAds360Link) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/searchAds360Links/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all SearchAds360Links on a property. + rpc ListSearchAds360Links(ListSearchAds360LinksRequest) + returns (ListSearchAds360LinksResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=properties/*}/searchAds360Links" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a SearchAds360Link. + rpc CreateSearchAds360Link(CreateSearchAds360LinkRequest) + returns (SearchAds360Link) { + option (google.api.http) = { + post: "/v1alpha/{parent=properties/*}/searchAds360Links" + body: "search_ads_360_link" + }; + option (google.api.method_signature) = "parent,search_ads_360_link"; + } + + // Deletes a SearchAds360Link on a property. + rpc DeleteSearchAds360Link(DeleteSearchAds360LinkRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=properties/*/searchAds360Links/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a SearchAds360Link on a property. + rpc UpdateSearchAds360Link(UpdateSearchAds360LinkRequest) + returns (SearchAds360Link) { + option (google.api.http) = { + patch: "/v1alpha/{search_ads_360_link.name=properties/*/searchAds360Links/*}" + body: "search_ads_360_link" + }; + option (google.api.method_signature) = "search_ads_360_link,update_mask"; + } + + // Lookup for a AttributionSettings singleton. + rpc GetAttributionSettings(GetAttributionSettingsRequest) + returns (AttributionSettings) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/attributionSettings}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates attribution settings on a property. + rpc UpdateAttributionSettings(UpdateAttributionSettingsRequest) + returns (AttributionSettings) { + option (google.api.http) = { + patch: "/v1alpha/{attribution_settings.name=properties/*/attributionSettings}" + body: "attribution_settings" + }; + option (google.api.method_signature) = "attribution_settings,update_mask"; + } + + // Returns a customized report of data access records. The report provides + // records of each time a user reads Google Analytics reporting data. Access + // records are retained for up to 2 years. + // + // Data Access Reports can be requested for a property. The property must be + // in Google Analytics 360. This method is only available to Administrators. + // + // These data access records include GA4 UI Reporting, GA4 UI Explorations, + // GA4 Data API, and other products like Firebase & Admob that can retrieve + // data from Google Analytics through a linkage. These records don't include + // property configuration changes like adding a stream or changing a + // property's time zone. For configuration change history, see + // [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). + rpc RunAccessReport(RunAccessReportRequest) + returns (RunAccessReportResponse) { + option (google.api.http) = { + post: "/v1alpha/{entity=properties/*}:runAccessReport" + body: "*" + additional_bindings { + post: "/v1alpha/{entity=accounts/*}:runAccessReport" + body: "*" + } + }; + } + + // Creates an access binding on an account or property. + rpc CreateAccessBinding(CreateAccessBindingRequest) returns (AccessBinding) { + option (google.api.http) = { + post: "/v1alpha/{parent=accounts/*}/accessBindings" + body: "access_binding" + additional_bindings { + post: "/v1alpha/{parent=properties/*}/accessBindings" + body: "access_binding" + } + }; + option (google.api.method_signature) = "parent,access_binding"; + } + + // Gets information about an access binding. + rpc GetAccessBinding(GetAccessBindingRequest) returns (AccessBinding) { + option (google.api.http) = { + get: "/v1alpha/{name=accounts/*/accessBindings/*}" + additional_bindings { + get: "/v1alpha/{name=properties/*/accessBindings/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Updates an access binding on an account or property. + rpc UpdateAccessBinding(UpdateAccessBindingRequest) returns (AccessBinding) { + option (google.api.http) = { + patch: "/v1alpha/{access_binding.name=accounts/*/accessBindings/*}" + body: "access_binding" + additional_bindings { + patch: "/v1alpha/{access_binding.name=properties/*/accessBindings/*}" + body: "access_binding" + } + }; + option (google.api.method_signature) = "access_binding"; + } + + // Deletes an access binding on an account or property. + rpc DeleteAccessBinding(DeleteAccessBindingRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=accounts/*/accessBindings/*}" + additional_bindings { + delete: "/v1alpha/{name=properties/*/accessBindings/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists all access bindings on an account or property. + rpc ListAccessBindings(ListAccessBindingsRequest) + returns (ListAccessBindingsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=accounts/*}/accessBindings" + additional_bindings { + get: "/v1alpha/{parent=properties/*}/accessBindings" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Creates information about multiple access bindings to an account or + // property. + // + // This method is transactional. If any AccessBinding cannot be created, none + // of the AccessBindings will be created. + rpc BatchCreateAccessBindings(BatchCreateAccessBindingsRequest) + returns (BatchCreateAccessBindingsResponse) { + option (google.api.http) = { + post: "/v1alpha/{parent=accounts/*}/accessBindings:batchCreate" + body: "*" + additional_bindings { + post: "/v1alpha/{parent=properties/*}/accessBindings:batchCreate" + body: "*" + } + }; + } + + // Gets information about multiple access bindings to an account or property. + rpc BatchGetAccessBindings(BatchGetAccessBindingsRequest) + returns (BatchGetAccessBindingsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=accounts/*}/accessBindings:batchGet" + additional_bindings { + get: "/v1alpha/{parent=properties/*}/accessBindings:batchGet" + } + }; + } + + // Updates information about multiple access bindings to an account or + // property. + rpc BatchUpdateAccessBindings(BatchUpdateAccessBindingsRequest) + returns (BatchUpdateAccessBindingsResponse) { + option (google.api.http) = { + post: "/v1alpha/{parent=accounts/*}/accessBindings:batchUpdate" + body: "*" + additional_bindings { + post: "/v1alpha/{parent=properties/*}/accessBindings:batchUpdate" + body: "*" + } + }; + } + + // Deletes information about multiple users' links to an account or property. + rpc BatchDeleteAccessBindings(BatchDeleteAccessBindingsRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1alpha/{parent=accounts/*}/accessBindings:batchDelete" + body: "*" + additional_bindings { + post: "/v1alpha/{parent=properties/*}/accessBindings:batchDelete" + body: "*" + } + }; + } + + // Lookup for a single ExpandedDataSet. + rpc GetExpandedDataSet(GetExpandedDataSetRequest) returns (ExpandedDataSet) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/expandedDataSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists ExpandedDataSets on a property. + rpc ListExpandedDataSets(ListExpandedDataSetsRequest) + returns (ListExpandedDataSetsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=properties/*}/expandedDataSets" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a ExpandedDataSet. + rpc CreateExpandedDataSet(CreateExpandedDataSetRequest) + returns (ExpandedDataSet) { + option (google.api.http) = { + post: "/v1alpha/{parent=properties/*}/expandedDataSets" + body: "expanded_data_set" + }; + option (google.api.method_signature) = "parent,expanded_data_set"; + } + + // Updates a ExpandedDataSet on a property. + rpc UpdateExpandedDataSet(UpdateExpandedDataSetRequest) + returns (ExpandedDataSet) { + option (google.api.http) = { + patch: "/v1alpha/{expanded_data_set.name=properties/*/expandedDataSets/*}" + body: "expanded_data_set" + }; + option (google.api.method_signature) = "expanded_data_set,update_mask"; + } + + // Deletes a ExpandedDataSet on a property. + rpc DeleteExpandedDataSet(DeleteExpandedDataSetRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=properties/*/expandedDataSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Sets the opt out status for the automated GA4 setup process for a UA + // property. + // Note: this has no effect on GA4 property. + rpc SetAutomatedGa4ConfigurationOptOut( + SetAutomatedGa4ConfigurationOptOutRequest) + returns (SetAutomatedGa4ConfigurationOptOutResponse) { + option (google.api.http) = { + post: "/v1alpha/properties:setAutomatedGa4ConfigurationOptOut" + body: "*" + }; + } + + // Fetches the opt out status for the automated GA4 setup process for a UA + // property. + // Note: this has no effect on GA4 property. + rpc FetchAutomatedGa4ConfigurationOptOut( + FetchAutomatedGa4ConfigurationOptOutRequest) + returns (FetchAutomatedGa4ConfigurationOptOutResponse) { + option (google.api.http) = { + post: "/v1alpha/properties:fetchAutomatedGa4ConfigurationOptOut" + body: "*" + }; + } + + // Lookup for a single BigQuery Link. + rpc GetBigQueryLink(GetBigQueryLinkRequest) returns (BigQueryLink) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/bigQueryLinks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists BigQuery Links on a property. + rpc ListBigQueryLinks(ListBigQueryLinksRequest) + returns (ListBigQueryLinksResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=properties/*}/bigQueryLinks" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the enhanced measurement settings for this data stream. + // Note that the stream must enable enhanced measurement for these settings to + // take effect. + rpc GetEnhancedMeasurementSettings(GetEnhancedMeasurementSettingsRequest) + returns (EnhancedMeasurementSettings) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/dataStreams/*/enhancedMeasurementSettings}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the enhanced measurement settings for this data stream. + // Note that the stream must enable enhanced measurement for these settings to + // take effect. + rpc UpdateEnhancedMeasurementSettings( + UpdateEnhancedMeasurementSettingsRequest) + returns (EnhancedMeasurementSettings) { + option (google.api.http) = { + patch: "/v1alpha/{enhanced_measurement_settings.name=properties/*/dataStreams/*/enhancedMeasurementSettings}" + body: "enhanced_measurement_settings" + }; + option (google.api.method_signature) = + "enhanced_measurement_settings,update_mask"; + } + + // Creates a connected site tag for a Universal Analytics property. You can + // create a maximum of 20 connected site tags per property. + // Note: This API cannot be used on GA4 properties. + rpc CreateConnectedSiteTag(CreateConnectedSiteTagRequest) + returns (CreateConnectedSiteTagResponse) { + option (google.api.http) = { + post: "/v1alpha/properties:createConnectedSiteTag" + body: "*" + }; + } + + // Deletes a connected site tag for a Universal Analytics property. + // Note: this has no effect on GA4 properties. + rpc DeleteConnectedSiteTag(DeleteConnectedSiteTagRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1alpha/properties:deleteConnectedSiteTag" + body: "*" + }; + } + + // Lists the connected site tags for a Universal Analytics property. A maximum + // of 20 connected site tags will be returned. Note: this has no effect on GA4 + // property. + rpc ListConnectedSiteTags(ListConnectedSiteTagsRequest) + returns (ListConnectedSiteTagsResponse) { + option (google.api.http) = { + post: "/v1alpha/properties:listConnectedSiteTags" + body: "*" + }; + } +} + +// The request for a Data Access Record Report. +message RunAccessReportRequest { + // The Data Access Report supports requesting at the property level or account + // level. If requested at the account level, Data Access Reports include all + // access for all properties under that account. + // + // To request at the property level, entity should be for example + // 'properties/123' if "123" is your GA4 property ID. To request at the + // account level, entity should be for example 'accounts/1234' if "1234" is + // your GA4 Account ID. + string entity = 1; + + // The dimensions requested and displayed in the response. Requests are + // allowed up to 9 dimensions. + repeated AccessDimension dimensions = 2; + + // The metrics requested and displayed in the response. Requests are allowed + // up to 10 metrics. + repeated AccessMetric metrics = 3; + + // Date ranges of access records to read. If multiple date ranges are + // requested, each response row will contain a zero based date range index. If + // two date ranges overlap, the access records for the overlapping days is + // included in the response rows for both date ranges. Requests are allowed up + // to 2 date ranges. + repeated AccessDateRange date_ranges = 4; + + // Dimension filters let you restrict report response to specific + // dimension values which match the filter. For example, filtering on access + // records of a single user. To learn more, see [Fundamentals of Dimension + // Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + // for examples. Metrics cannot be used in this filter. + AccessFilterExpression dimension_filter = 5; + + // Metric filters allow you to restrict report response to specific metric + // values which match the filter. Metric filters are applied after aggregating + // the report's rows, similar to SQL having-clause. Dimensions cannot be used + // in this filter. + AccessFilterExpression metric_filter = 6; + + // The row count of the start row. The first row is counted as row 0. If + // offset is unspecified, it is treated as 0. If offset is zero, then this + // method will return the first page of results with `limit` entries. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int64 offset = 7; + + // The number of rows to return. If unspecified, 10,000 rows are returned. The + // API returns a maximum of 100,000 rows per request, no matter how many you + // ask for. `limit` must be positive. + // + // The API may return fewer rows than the requested `limit`, if there aren't + // as many remaining rows as the `limit`. For instance, there are fewer than + // 300 possible values for the dimension `country`, so when reporting on only + // `country`, you can't get more than 300 rows, even if you set `limit` to a + // higher value. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int64 limit = 8; + + // This request's time zone if specified. If unspecified, the property's time + // zone is used. The request's time zone is used to interpret the start & end + // dates of the report. + // + // Formatted as strings from the IANA Time Zone database + // (https://www.iana.org/time-zones); for example "America/New_York" or + // "Asia/Tokyo". + string time_zone = 9; + + // Specifies how rows are ordered in the response. + repeated AccessOrderBy order_bys = 10; + + // Toggles whether to return the current state of this Analytics Property's + // quota. Quota is returned in [AccessQuota](#AccessQuota). For account-level + // requests, this field must be false. + bool return_entity_quota = 11; +} + +// The customized Data Access Record Report response. +message RunAccessReportResponse { + // The header for a column in the report that corresponds to a specific + // dimension. The number of DimensionHeaders and ordering of DimensionHeaders + // matches the dimensions present in rows. + repeated AccessDimensionHeader dimension_headers = 1; + + // The header for a column in the report that corresponds to a specific + // metric. The number of MetricHeaders and ordering of MetricHeaders matches + // the metrics present in rows. + repeated AccessMetricHeader metric_headers = 2; + + // Rows of dimension value combinations and metric values in the report. + repeated AccessRow rows = 3; + + // The total number of rows in the query result. `rowCount` is independent of + // the number of rows returned in the response, the `limit` request + // parameter, and the `offset` request parameter. For example if a query + // returns 175 rows and includes `limit` of 50 in the API request, the + // response will contain `rowCount` of 175 but only 50 rows. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int32 row_count = 4; + + // The quota state for this Analytics property including this request. This + // field doesn't work with account-level requests. + AccessQuota quota = 5; +} + +// 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 (for example, "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 Cloud 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 `ListFirebaseLinks` 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 GetSearchAds360Link RPC. +message GetSearchAds360LinkRequest { + // Required. The name of the SearchAds360Link to get. + // Example format: properties/1234/SearchAds360Link/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/SearchAds360Link" + } + ]; +} + +// Request message for ListSearchAds360Links RPC. +message ListSearchAds360LinksRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/SearchAds360Link" + } + ]; + + // 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 `ListSearchAds360Links` + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListSearchAds360Links` must match the call that provided the + // page token. + string page_token = 3; +} + +// Response message for ListSearchAds360Links RPC. +message ListSearchAds360LinksResponse { + // List of SearchAds360Links. + repeated SearchAds360Link search_ads_360_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 CreateSearchAds360Link RPC. +message CreateSearchAds360LinkRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/SearchAds360Link" + } + ]; + + // Required. The SearchAds360Link to create. + SearchAds360Link search_ads_360_link = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteSearchAds360Link RPC. +message DeleteSearchAds360LinkRequest { + // Required. The name of the SearchAds360Link to delete. + // Example format: properties/1234/SearchAds360Links/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/SearchAds360Link" + } + ]; +} + +// Request message for UpdateSearchAds360Link RPC. +message UpdateSearchAds360LinkRequest { + // The SearchAds360Link to update + SearchAds360Link search_ads_360_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 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" + } + ]; +} + +// Request message for GetAudience RPC. +message GetAudienceRequest { + // Required. The name of the Audience to get. + // Example format: properties/1234/audiences/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Audience" + } + ]; +} + +// Request message for ListAudiences RPC. +message ListAudiencesRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/Audience" + } + ]; + + // 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 `ListAudiences` call. Provide this + // to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListAudiences` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for ListAudiences RPC. +message ListAudiencesResponse { + // List of Audiences. + repeated Audience audiences = 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 CreateAudience RPC. +message CreateAudienceRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/Audience" + } + ]; + + // Required. The audience to create. + Audience audience = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateAudience RPC. +message UpdateAudienceRequest { + // Required. The audience to update. + // The audience's `name` field is used to identify the audience to be updated. + Audience audience = 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 ArchiveAudience RPC. +message ArchiveAudienceRequest { + // Required. Example format: properties/1234/audiences/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/Audience" + } + ]; +} + +// Request message for GetAttributionSettings RPC. +message GetAttributionSettingsRequest { + // Required. The name of the attribution settings to retrieve. + // Format: properties/{property}/attributionSettings + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/AttributionSettings" + } + ]; +} + +// Request message for UpdateAttributionSettings RPC +message UpdateAttributionSettingsRequest { + // Required. The attribution settings to update. + // The `name` field is used to identify the settings to be updated. + AttributionSettings attribution_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 GetAccessBinding RPC. +message GetAccessBindingRequest { + // Required. The name of the access binding to retrieve. + // Formats: + // - accounts/{account}/accessBindings/{accessBinding} + // - properties/{property}/accessBindings/{accessBinding} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/AccessBinding" + } + ]; +} + +// Request message for BatchGetAccessBindings RPC. +message BatchGetAccessBindingsRequest { + // Required. The account or property that owns the access bindings. The parent + // of all provided values for the 'names' field must match this field. + // Formats: + // - accounts/{account} + // - properties/{property} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/AccessBinding" + } + ]; + + // Required. The names of the access bindings to retrieve. + // A maximum of 1000 access bindings can be retrieved in a batch. + // Formats: + // - accounts/{account}/accessBindings/{accessBinding} + // - properties/{property}/accessBindings/{accessBinding} + repeated string names = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/AccessBinding" + } + ]; +} + +// Response message for BatchGetAccessBindings RPC. +message BatchGetAccessBindingsResponse { + // The requested access bindings. + repeated AccessBinding access_bindings = 1; +} + +// Request message for ListAccessBindings RPC. +message ListAccessBindingsRequest { + // Required. Formats: + // - accounts/{account} + // - properties/{property} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/AccessBinding" + } + ]; + + // The maximum number of access bindings to return. + // The service may return fewer than this value. + // If unspecified, at most 200 access bindings 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 `ListAccessBindings` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListAccessBindings` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for ListAccessBindings RPC. +message ListAccessBindingsResponse { + // List of AccessBindings. These will be ordered stably, but in an arbitrary + // order. + repeated AccessBinding access_bindings = 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 CreateAccessBinding RPC. +message CreateAccessBindingRequest { + // Required. Formats: + // - accounts/{account} + // - properties/{property} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/AccessBinding" + } + ]; + + // Required. The access binding to create. + AccessBinding access_binding = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for BatchCreateAccessBindings RPC. +message BatchCreateAccessBindingsRequest { + // Required. The account or property that owns the access bindings. The parent + // field in the CreateAccessBindingRequest messages must either be empty or + // match this field. Formats: + // - accounts/{account} + // - properties/{property} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/AccessBinding" + } + ]; + + // Required. The requests specifying the access bindings to create. + // A maximum of 1000 access bindings can be created in a batch. + repeated CreateAccessBindingRequest requests = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for BatchCreateAccessBindings RPC. +message BatchCreateAccessBindingsResponse { + // The access bindings created. + repeated AccessBinding access_bindings = 1; +} + +// Request message for UpdateAccessBinding RPC. +message UpdateAccessBindingRequest { + // Required. The access binding to update. + AccessBinding access_binding = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for BatchUpdateAccessBindings RPC. +message BatchUpdateAccessBindingsRequest { + // Required. The account or property that owns the access bindings. The parent + // of all provided AccessBinding in UpdateAccessBindingRequest messages must + // match this field. + // Formats: + // - accounts/{account} + // - properties/{property} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/AccessBinding" + } + ]; + + // Required. The requests specifying the access bindings to update. + // A maximum of 1000 access bindings can be updated in a batch. + repeated UpdateAccessBindingRequest requests = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for BatchUpdateAccessBindings RPC. +message BatchUpdateAccessBindingsResponse { + // The access bindings updated. + repeated AccessBinding access_bindings = 1; +} + +// Request message for DeleteAccessBinding RPC. +message DeleteAccessBindingRequest { + // Required. Formats: + // - accounts/{account}/accessBindings/{accessBinding} + // - properties/{property}/accessBindings/{accessBinding} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/AccessBinding" + } + ]; +} + +// Request message for BatchDeleteAccessBindings RPC. +message BatchDeleteAccessBindingsRequest { + // Required. The account or property that owns the access bindings. The parent + // of all provided values for the 'names' field in DeleteAccessBindingRequest + // messages must match this field. Formats: + // - accounts/{account} + // - properties/{property} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/AccessBinding" + } + ]; + + // Required. The requests specifying the access bindings to delete. + // A maximum of 1000 access bindings can be deleted in a batch. + repeated DeleteAccessBindingRequest requests = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for CreateExpandedDataSet RPC. +message CreateExpandedDataSetRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/ExpandedDataSet" + } + ]; + + // Required. The ExpandedDataSet to create. + ExpandedDataSet expanded_data_set = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateExpandedDataSet RPC. +message UpdateExpandedDataSetRequest { + // Required. The ExpandedDataSet to update. + // The resource's `name` field is used to identify the ExpandedDataSet to be + // updated. + ExpandedDataSet expanded_data_set = 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 DeleteExpandedDataSet RPC. +message DeleteExpandedDataSetRequest { + // Required. Example format: properties/1234/expandedDataSets/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/ExpandedDataSet" + } + ]; +} + +// Request message for GetExpandedDataSet RPC. +message GetExpandedDataSetRequest { + // Required. The name of the Audience to get. + // Example format: properties/1234/expandedDataSets/5678 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/ExpandedDataSet" + } + ]; +} + +// Request message for ListExpandedDataSets RPC. +message ListExpandedDataSetsRequest { + // Required. Example format: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/ExpandedDataSet" + } + ]; + + // 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 `ListExpandedDataSets` call. Provide + // this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListExpandedDataSet` + // must match the call that provided the page token. + string page_token = 3; +} + +// Response message for ListExpandedDataSets RPC. +message ListExpandedDataSetsResponse { + // List of ExpandedDataSet. These will be ordered stably, but in an arbitrary + // order. + repeated ExpandedDataSet expanded_data_sets = 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 for setting the opt out status for the automated GA4 setup process. +message SetAutomatedGa4ConfigurationOptOutRequest { + // Required. The UA property to set the opt out status. Note this request uses + // the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. + // Format: properties/{internalWebPropertyId} + // Example: properties/1234 + string property = 1 [(google.api.field_behavior) = REQUIRED]; + + // The status to set. + bool opt_out = 2; +} + +// Response message for setting the opt out status for the automated GA4 setup +// process. +message SetAutomatedGa4ConfigurationOptOutResponse {} + +// Request for fetching the opt out status for the automated GA4 setup process. +message FetchAutomatedGa4ConfigurationOptOutRequest { + // Required. The UA property to get the opt out status. Note this request uses + // the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. + // Format: properties/{internalWebPropertyId} + // Example: properties/1234 + string property = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for fetching the opt out status for the automated GA4 setup +// process. +message FetchAutomatedGa4ConfigurationOptOutResponse { + // The opt out status for the UA property. + bool opt_out = 1; +} + +// Request message for GetBigQueryLink RPC. +message GetBigQueryLinkRequest { + // Required. The name of the BigQuery link to lookup. + // Format: properties/{property_id}/bigQueryLinks/{bigquery_link_id} + // Example: properties/123/bigQueryLinks/456 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/BigQueryLink" + } + ]; +} + +// Request message for ListBigQueryLinks RPC. +message ListBigQueryLinksRequest { + // Required. The name of the property to list BigQuery links under. + // Format: properties/{property_id} + // Example: properties/1234 + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "analyticsadmin.googleapis.com/BigQueryLink" + } + ]; + + // 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 `ListBigQueryLinks` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListBigQueryLinks` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for ListBigQueryLinks RPC +message ListBigQueryLinksResponse { + // List of BigQueryLinks. + repeated BigQueryLink bigquery_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 GetEnhancedMeasurementSettings RPC. +message GetEnhancedMeasurementSettingsRequest { + // Required. The name of the settings to lookup. + // Format: + // properties/{property}/dataStreams/{data_stream}/enhancedMeasurementSettings + // Example: "properties/1000/dataStreams/2000/enhancedMeasurementSettings" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/EnhancedMeasurementSettings" + } + ]; +} + +// Request message for UpdateEnhancedMeasurementSettings RPC. +message UpdateEnhancedMeasurementSettingsRequest { + // Required. The settings to update. + // The `name` field is used to identify the settings to be updated. + EnhancedMeasurementSettings enhanced_measurement_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 CreateConnectedSiteTag RPC. +message CreateConnectedSiteTagRequest { + // The Universal Analytics property to create connected site tags for. + // This API does not support GA4 properties. + // Format: properties/{universalAnalyticsPropertyId} + // Example: properties/1234 + string property = 1; + + // Required. The tag to add to the Universal Analytics property + ConnectedSiteTag connected_site_tag = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for CreateConnectedSiteTag RPC. +message CreateConnectedSiteTagResponse {} + +// Request message for DeleteConnectedSiteTag RPC. +message DeleteConnectedSiteTagRequest { + // The Universal Analytics property to delete connected site tags for. + // This API does not support GA4 properties. + // Format: properties/{universalAnalyticsPropertyId} + // Example: properties/1234 + string property = 1; + + // Tag ID to forward events to. Also known as the Measurement ID, or the + // "G-ID" (For example: G-12345). + string tag_id = 2; +} + +// Request message for ListConnectedSiteTags RPC. +message ListConnectedSiteTagsRequest { + // The Universal Analytics property to fetch connected site tags for. + // This does not work on GA4 properties. A maximum of 20 connected site tags + // will be returned. + // Example Format: `properties/1234` + string property = 1; +} + +// Response message for ListConnectedSiteTags RPC. +message ListConnectedSiteTagsResponse { + // The site tags for the Universal Analytics property. A maximum of 20 + // connected site tags will be returned. + repeated ConnectedSiteTag connected_site_tags = 1; +} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/audience.proto b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/audience.proto new file mode 100644 index 00000000000..ccc78ebbf79 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/audience.proto @@ -0,0 +1,419 @@ +// Copyright 2023 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/duration.proto"; + +option go_package = "google.golang.org/genproto/googleapis/analytics/admin/v1alpha;admin"; +option java_multiple_files = true; +option java_outer_classname = "AudienceProto"; +option java_package = "com.google.analytics.admin.v1alpha"; + +// Specifies how to evaluate users for joining an Audience. +enum AudienceFilterScope { + // Scope is not specified. + AUDIENCE_FILTER_SCOPE_UNSPECIFIED = 0; + + // User joins the Audience if the filter condition is met within one + // event. + AUDIENCE_FILTER_SCOPE_WITHIN_SAME_EVENT = 1; + + // User joins the Audience if the filter condition is met within one + // session. + AUDIENCE_FILTER_SCOPE_WITHIN_SAME_SESSION = 2; + + // User joins the Audience if the filter condition is met by any event + // across any session. + AUDIENCE_FILTER_SCOPE_ACROSS_ALL_SESSIONS = 3; +} + +// A specific filter for a single dimension or metric. +message AudienceDimensionOrMetricFilter { + // A filter for a string-type dimension that matches a particular pattern. + message StringFilter { + // The match type for the string filter. + enum MatchType { + // Unspecified + MATCH_TYPE_UNSPECIFIED = 0; + + // Exact match of the string value. + EXACT = 1; + + // Begins with the string value. + BEGINS_WITH = 2; + + // Ends with the string value. + ENDS_WITH = 3; + + // Contains the string value. + CONTAINS = 4; + + // Full regular expression matches with the string value. + FULL_REGEXP = 5; + } + + // Required. The match type for the string filter. + MatchType match_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The string value to be matched against. + string value = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If true, the match is case-sensitive. If false, the match is + // case-insensitive. + bool case_sensitive = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // A filter for a string dimension that matches a particular list of options. + message InListFilter { + // Required. The list of possible string values to match against. Must be + // non-empty. + repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If true, the match is case-sensitive. If false, the match is + // case-insensitive. + bool case_sensitive = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // To represent a number. + message NumericValue { + // One of a numeric value. + oneof one_value { + // Integer value. + int64 int64_value = 1; + + // Double value. + double double_value = 2; + } + } + + // A filter for numeric or date values on a dimension or metric. + message NumericFilter { + // The operation applied to a numeric filter. + enum Operation { + // Unspecified. + OPERATION_UNSPECIFIED = 0; + + // Equal. + EQUAL = 1; + + // Less than. + LESS_THAN = 2; + + // Greater than. + GREATER_THAN = 4; + } + + // Required. The operation applied to a numeric filter. + Operation operation = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The numeric or date value to match against. + NumericValue value = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // A filter for numeric or date values between certain values on a dimension + // or metric. + message BetweenFilter { + // Required. Begins with this number, inclusive. + NumericValue from_value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Ends with this number, inclusive. + NumericValue to_value = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // One of the above filters. + oneof one_filter { + // A filter for a string-type dimension that matches a particular pattern. + StringFilter string_filter = 2; + + // A filter for a string dimension that matches a particular list of + // options. + InListFilter in_list_filter = 3; + + // A filter for numeric or date values on a dimension or metric. + NumericFilter numeric_filter = 4; + + // A filter for numeric or date values between certain values on a dimension + // or metric. + BetweenFilter between_filter = 5; + } + + // Required. Immutable. The dimension name or metric name to filter. + string field_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Indicates whether this filter needs dynamic evaluation or not. If + // set to true, users join the Audience if they ever met the condition (static + // evaluation). If unset or set to false, user evaluation for an Audience is + // dynamic; users are added to an Audience when they meet the conditions and + // then removed when they no longer meet them. + // + // This can only be set when Audience scope is ACROSS_ALL_SESSIONS. + bool at_any_point_in_time = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, specifies the time window for which to evaluate data in + // number of days. If not set, then audience data is evaluated against + // lifetime data (i.e., infinite time window). + // + // For example, if set to 1 day, only the current day's data is evaluated. The + // reference point is the current day when at_any_point_in_time is unset or + // false. + // + // It can only be set when Audience scope is ACROSS_ALL_SESSIONS and cannot be + // greater than 60 days. + int32 in_any_n_day_period = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// A filter that matches events of a single event name. If an event parameter +// is specified, only the subset of events that match both the single event name +// and the parameter filter expressions match this event filter. +message AudienceEventFilter { + // Required. Immutable. The name of the event to match against. + string event_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. If specified, this filter matches events that match both the + // single event name and the parameter filter expressions. AudienceEventFilter + // inside the parameter filter expression cannot be set (i.e., nested + // event filters are not supported). This should be a single and_group of + // dimension_or_metric_filter or not_expression; ANDs of ORs are not + // supported. Also, if it includes a filter for "eventCount", only that one + // will be considered; all the other filters will be ignored. + AudienceFilterExpression event_parameter_filter_expression = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A logical expression of Audience dimension, metric, or event filters. +message AudienceFilterExpression { + // The expression applied to a filter. + oneof expr { + // A list of expressions to be AND’ed together. It can only contain + // AudienceFilterExpressions with or_group. This must be set for the top + // level AudienceFilterExpression. + AudienceFilterExpressionList and_group = 1; + + // A list of expressions to OR’ed together. It cannot contain + // AudienceFilterExpressions with and_group or or_group. + AudienceFilterExpressionList or_group = 2; + + // A filter expression to be NOT'ed (i.e., inverted, complemented). It + // can only include a dimension_or_metric_filter. This cannot be set on the + // top level AudienceFilterExpression. + AudienceFilterExpression not_expression = 3; + + // A filter on a single dimension or metric. This cannot be set on the top + // level AudienceFilterExpression. + AudienceDimensionOrMetricFilter dimension_or_metric_filter = 4; + + // Creates a filter that matches a specific event. This cannot be set on the + // top level AudienceFilterExpression. + AudienceEventFilter event_filter = 5; + } +} + +// A list of Audience filter expressions. +message AudienceFilterExpressionList { + // A list of Audience filter expressions. + repeated AudienceFilterExpression filter_expressions = 1; +} + +// Defines a simple filter that a user must satisfy to be a member of the +// Audience. +message AudienceSimpleFilter { + // Required. Immutable. Specifies the scope for this filter. + AudienceFilterScope scope = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. A logical expression of Audience dimension, metric, or + // event filters. + AudienceFilterExpression filter_expression = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; +} + +// Defines filters that must occur in a specific order for the user to be a +// member of the Audience. +message AudienceSequenceFilter { + // A condition that must occur in the specified step order for this user + // to match the sequence. + message AudienceSequenceStep { + // Required. Immutable. Specifies the scope for this step. + AudienceFilterScope scope = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. If true, the event satisfying this step must be the very next + // event after the event satisfying the last step. If unset or false, this + // step indirectly follows the prior step; for example, there may be + // events between the prior step and this step. It is ignored for the + // first step. + bool immediately_follows = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When set, this step must be satisfied within the + // constraint_duration of the previous step (i.e., t[i] - t[i-1] <= + // constraint_duration). If not set, there is no duration requirement (the + // duration is effectively unlimited). It is ignored for the first step. + google.protobuf.Duration constraint_duration = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. A logical expression of Audience dimension, metric, + // or event filters in each step. + AudienceFilterExpression filter_expression = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Required. Immutable. Specifies the scope for this filter. + AudienceFilterScope scope = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Defines the time period in which the whole sequence must occur. + google.protobuf.Duration sequence_maximum_duration = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. An ordered sequence of steps. A user must complete each step in + // order to join the sequence filter. + repeated AudienceSequenceStep sequence_steps = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// A clause for defining either a simple or sequence filter. A filter can be +// inclusive (i.e., users satisfying the filter clause are included in the +// Audience) or exclusive (i.e., users satisfying the filter clause are +// excluded from the Audience). +message AudienceFilterClause { + // Specifies whether this is an include or exclude filter clause. + enum AudienceClauseType { + // Unspecified clause type. + AUDIENCE_CLAUSE_TYPE_UNSPECIFIED = 0; + + // Users will be included in the Audience if the filter clause is met. + INCLUDE = 1; + + // Users will be excluded from the Audience if the filter clause is met. + EXCLUDE = 2; + } + + oneof filter { + // A simple filter that a user must satisfy to be a member of the Audience. + AudienceSimpleFilter simple_filter = 2; + + // Filters that must occur in a specific order for the user to be a member + // of the Audience. + AudienceSequenceFilter sequence_filter = 3; + } + + // Required. Specifies whether this is an include or exclude filter clause. + AudienceClauseType clause_type = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Specifies an event to log when a user joins the Audience. +message AudienceEventTrigger { + // Determines when to log the event. + enum LogCondition { + // Log condition is not specified. + LOG_CONDITION_UNSPECIFIED = 0; + + // The event should be logged only when a user is joined. + AUDIENCE_JOINED = 1; + + // The event should be logged whenever the Audience condition is met, even + // if the user is already a member of the Audience. + AUDIENCE_MEMBERSHIP_RENEWED = 2; + } + + // Required. The event name that will be logged. + string event_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. When to log the event. + LogCondition log_condition = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A resource message representing a GA4 Audience. +message Audience { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/Audience" + pattern: "properties/{property}/audiences/{audience}" + }; + + // Specifies how long an exclusion lasts for users that meet the exclusion + // filter. + enum AudienceExclusionDurationMode { + // Not specified. + AUDIENCE_EXCLUSION_DURATION_MODE_UNSPECIFIED = 0; + + // Exclude users from the Audience during periods when they meet the + // filter clause. + EXCLUDE_TEMPORARILY = 1; + + // Exclude users from the Audience if they've ever met the filter clause. + EXCLUDE_PERMANENTLY = 2; + } + + // Output only. The resource name for this Audience resource. + // Format: properties/{propertyId}/audiences/{audienceId} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the Audience. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The description of the Audience. + string description = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Immutable. The duration a user should stay in an Audience. It + // cannot be set to more than 540 days. + int32 membership_duration_days = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. It is automatically set by GA to false if this is an NPA + // Audience and is excluded from ads personalization. + bool ads_personalization_enabled = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Specifies an event to log when a user joins the Audience. If not + // set, no event is logged when a user joins the Audience. + AudienceEventTrigger event_trigger = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Immutable. Specifies how long an exclusion lasts for users that meet the + // exclusion filter. It is applied to all EXCLUDE filter clauses and is + // ignored when there is no EXCLUDE filter clause in the Audience. + AudienceExclusionDurationMode exclusion_duration_mode = 7 + [(google.api.field_behavior) = IMMUTABLE]; + + // Required. Immutable. Unordered list. Filter clauses that define the + // Audience. All clauses will be AND’ed together. + repeated AudienceFilterClause filter_clauses = 8 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = UNORDERED_LIST + ]; +} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/expanded_data_set.proto b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/expanded_data_set.proto new file mode 100644 index 00000000000..5a6e606139b --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/expanded_data_set.proto @@ -0,0 +1,151 @@ +// Copyright 2023 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"; + +option go_package = "google.golang.org/genproto/googleapis/analytics/admin/v1alpha;admin"; +option java_multiple_files = true; +option java_outer_classname = "ExpandedDataSetProto"; +option java_package = "com.google.analytics.admin.v1alpha"; + +// A specific filter for a single dimension +message ExpandedDataSetFilter { + // A filter for a string-type dimension that matches a particular pattern. + message StringFilter { + // The match type for the string filter. + enum MatchType { + // Unspecified + MATCH_TYPE_UNSPECIFIED = 0; + + // Exact match of the string value. + EXACT = 1; + + // Contains the string value. + CONTAINS = 2; + } + + // Required. The match type for the string filter. + MatchType match_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The string value to be matched against. + string value = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If true, the match is case-sensitive. If false, the match is + // case-insensitive. + // Must be true when match_type is EXACT. + // Must be false when match_type is CONTAINS. + bool case_sensitive = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // A filter for a string dimension that matches a particular list of options. + message InListFilter { + // Required. The list of possible string values to match against. Must be + // non-empty. + repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If true, the match is case-sensitive. If false, the match is + // case-insensitive. + // Must be true. + bool case_sensitive = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // One of the above filters. + oneof one_filter { + // A filter for a string-type dimension that matches a particular pattern. + StringFilter string_filter = 2; + + // A filter for a string dimension that matches a particular list of + // options. + InListFilter in_list_filter = 3; + } + + // Required. The dimension name to filter. + string field_name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A logical expression of EnhancedDataSet dimension filters. +message ExpandedDataSetFilterExpression { + // The expression applied to a filter. + oneof expr { + // A list of expressions to be AND’ed together. It must contain a + // ExpandedDataSetFilterExpression with either not_expression or + // dimension_filter. This must be set for the top level + // ExpandedDataSetFilterExpression. + ExpandedDataSetFilterExpressionList and_group = 1; + + // A filter expression to be NOT'ed (i.e., inverted, complemented). It + // must include a dimension_filter. This cannot be set on the + // top level ExpandedDataSetFilterExpression. + ExpandedDataSetFilterExpression not_expression = 2; + + // A filter on a single dimension. This cannot be set on the top + // level ExpandedDataSetFilterExpression. + ExpandedDataSetFilter filter = 3; + } +} + +// A list of ExpandedDataSet filter expressions. +message ExpandedDataSetFilterExpressionList { + // A list of ExpandedDataSet filter expressions. + repeated ExpandedDataSetFilterExpression filter_expressions = 1; +} + +// A resource message representing a GA4 ExpandedDataSet. +message ExpandedDataSet { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/ExpandedDataSet" + pattern: "properties/{property}/expandedDataSets/{expanded_data_set}" + }; + + // Output only. The resource name for this ExpandedDataSet resource. + // Format: properties/{property_id}/expandedDataSets/{expanded_data_set} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the ExpandedDataSet. + // Max 200 chars. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the ExpandedDataSet. + // Max 50 chars. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Immutable. The list of dimensions included in the ExpandedDataSet. + // See the [API + // Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) + // for the list of dimension names. + repeated string dimension_names = 4 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The list of metrics included in the ExpandedDataSet. + // See the [API + // Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) + // for the list of dimension names. + repeated string metric_names = 5 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. A logical expression of ExpandedDataSet filters applied to + // dimension included in the ExpandedDataSet. This filter is used to reduce + // the number of rows and thus the change of encountering `other row`. + ExpandedDataSetFilterExpression dimension_filter_expression = 6 + [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Time when expanded data set began (or will begin) collecing + // data. + google.protobuf.Timestamp data_collection_start_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto new file mode 100644 index 00000000000..b2f82cee4fc --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto @@ -0,0 +1,1555 @@ +// Copyright 2023 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/expanded_data_set.proto"; +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; + + // SearchAds360Link resource + SEARCH_ADS_360_LINK = 16; + + // DataStream resource + DATA_STREAM = 18; + + // AttributionSettings resource + ATTRIBUTION_SETTINGS = 20; + + // ExpandedDataSet resource + EXPANDED_DATA_SET = 21; + + // ChannelGroup resource + CHANNEL_GROUP = 22; + + // EnhancedMeasurementSettings resource + ENHANCED_MEASUREMENT_SETTINGS = 24; +} + +// Status of the Google Signals settings. +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. +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; +} + +// Types of Property resources. +enum PropertyType { + // Unknown or unspecified property type + PROPERTY_TYPE_UNSPECIFIED = 0; + + // Ordinary GA4 property + PROPERTY_TYPE_ORDINARY = 1; + + // GA4 subproperty + PROPERTY_TYPE_SUBPROPERTY = 2; + + // GA4 rollup property + PROPERTY_TYPE_ROLLUP = 3; +} + +// 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]; + + // Immutable. The property type for this Property resource. When creating a + // property, if the type is "PROPERTY_TYPE_UNSPECIFIED", then + // "ORDINARY_PROPERTY" will be implied. "SUBPROPERTY" and "ROLLUP_PROPERTY" + // types cannot yet be created with the Google Analytics Admin API. + PropertyType property_type = 14 [(google.api.field_behavior) = IMMUTABLE]; + + // 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}, properties/{property} + // Example: "accounts/100", "properties/101" + 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; + + // The property's property type. + PropertyType property_type = 3; + + // Resource name of this property's logical parent. + // + // Note: The Property-Moving UI can be used to change the parent. + // Format: accounts/{account}, properties/{property} + // Example: "accounts/100", "properties/200" + string parent = 4; +} + +// 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}/dataStreams/{dataStream}/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 SearchAds360Link resource in change history. + SearchAds360Link search_ads_360_link = 16; + + // A snapshot of a DataStream resource in change history. + DataStream data_stream = 18; + + // A snapshot of AttributionSettings resource in change history. + AttributionSettings attribution_settings = 20; + + // A snapshot of an ExpandedDataSet resource in change history. + ExpandedDataSet expanded_data_set = 21; + + // A snapshot of a BigQuery link resource in change history. + BigQueryLink bigquery_link = 23; + + // A snapshot of EnhancedMeasurementSettings resource in change history. + EnhancedMeasurementSettings enhanced_measurement_settings = 24; + } + } + + // 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]; +} + +// A link between a GA4 property and a Search Ads 360 entity. +message SearchAds360Link { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/SearchAds360Link" + pattern: "properties/{property}/searchAds360Links/{search_ads_360_link}" + }; + + // Output only. The resource name for this SearchAds360Link resource. + // Format: properties/{propertyId}/searchAds360Links/{linkId} + // + // Note: linkId is not the Search Ads 360 advertiser ID + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. This field represents the Advertiser ID of the Search Ads 360 + // Advertiser. that has been linked. + string advertiser_id = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Enables the import of campaign data from Search Ads 360 into the + // GA4 property. After link creation, this can only be updated from the Search + // Ads 360 product. + // If this field is not set on create, it will be defaulted to true. + google.protobuf.BoolValue campaign_data_sharing_enabled = 3 + [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Enables the import of cost data from Search Ads 360 to 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 Search Ads 360 product. + // If this field is not set on create, it will be defaulted to true. + google.protobuf.BoolValue cost_data_sharing_enabled = 4 + [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The display name of the Search Ads 360 Advertiser. + // Allows users to easily identify the linked resource. + string advertiser_display_name = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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; + + // Enables export of site stats with this integration. + // If this field is not set on create, it will be defaulted to true. + google.protobuf.BoolValue site_stats_sharing_enabled = 7; +} + +// 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 with + // 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; +} + +// The attribution settings used for a given property. This is a singleton +// resource. +message AttributionSettings { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/AttributionSettings" + pattern: "properties/{property}/attributionSettings" + }; + + // How far back in time events should be considered for inclusion in a + // converting path which leads to the first install of an app or the first + // visit to a site. + enum AcquisitionConversionEventLookbackWindow { + // Lookback window size unspecified. + ACQUISITION_CONVERSION_EVENT_LOOKBACK_WINDOW_UNSPECIFIED = 0; + + // 7-day lookback window. + ACQUISITION_CONVERSION_EVENT_LOOKBACK_WINDOW_7_DAYS = 1; + + // 30-day lookback window. + ACQUISITION_CONVERSION_EVENT_LOOKBACK_WINDOW_30_DAYS = 2; + } + + // How far back in time events should be considered for inclusion in a + // converting path for all conversions other than first app install/first site + // visit. + enum OtherConversionEventLookbackWindow { + // Lookback window size unspecified. + OTHER_CONVERSION_EVENT_LOOKBACK_WINDOW_UNSPECIFIED = 0; + + // 30-day lookback window. + OTHER_CONVERSION_EVENT_LOOKBACK_WINDOW_30_DAYS = 1; + + // 60-day lookback window. + OTHER_CONVERSION_EVENT_LOOKBACK_WINDOW_60_DAYS = 2; + + // 90-day lookback window. + OTHER_CONVERSION_EVENT_LOOKBACK_WINDOW_90_DAYS = 3; + } + + // The reporting attribution model used to calculate conversion credit in this + // property's reports. + enum ReportingAttributionModel { + // Reporting attribution model unspecified. + REPORTING_ATTRIBUTION_MODEL_UNSPECIFIED = 0; + + // Data-driven attribution distributes credit for the conversion based on + // data for each conversion event. Each Data-driven model is specific to + // each advertiser and each conversion event. + CROSS_CHANNEL_DATA_DRIVEN = 1; + + // Ignores direct traffic and attributes 100% of the conversion value to the + // last channel that the customer clicked through (or engaged view through + // for YouTube) before converting. + CROSS_CHANNEL_LAST_CLICK = 2; + + // Gives all credit for the conversion to the first channel that a customer + // clicked (or engaged view through for YouTube) before converting. + CROSS_CHANNEL_FIRST_CLICK = 3; + + // Distributes the credit for the conversion equally across all the channels + // a customer clicked (or engaged view through for YouTube) before + // converting. + CROSS_CHANNEL_LINEAR = 4; + + // Attributes 40% credit to the first and last interaction, and the + // remaining 20% credit is distributed evenly to the middle interactions. + CROSS_CHANNEL_POSITION_BASED = 5; + + // Gives more credit to the touchpoints that happened closer in time to + // the conversion. + CROSS_CHANNEL_TIME_DECAY = 6; + + // Attributes 100% of the conversion value to the last Google Ads channel + // that the customer clicked through before converting. + ADS_PREFERRED_LAST_CLICK = 7; + } + + // Output only. Resource name of this attribution settings resource. + // Format: properties/{property_id}/attributionSettings + // Example: "properties/1000/attributionSettings" + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The lookback window configuration for acquisition conversion + // events. The default window size is 30 days. + AcquisitionConversionEventLookbackWindow + acquisition_conversion_event_lookback_window = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The lookback window for all other, non-acquisition conversion + // events. The default window size is 90 days. + OtherConversionEventLookbackWindow other_conversion_event_lookback_window = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The reporting attribution model used to calculate conversion + // credit in this property's reports. + // + // Changing the attribution model will apply to both historical and future + // data. These changes will be reflected in reports with conversion and + // revenue data. User and session data will be unaffected. + ReportingAttributionModel reporting_attribution_model = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// A binding of a user to a set of roles. +message AccessBinding { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/AccessBinding" + pattern: "accounts/{account}/accessBindings/{access_binding}" + pattern: "properties/{property}/accessBindings/{access_binding}" + }; + + // The target for which to set roles for. + oneof access_target { + // If set, the email address of the user to set roles for. + // Format: "someuser@gmail.com" + string user = 2; + } + + // Output only. Resource name of this binding. + // + // Format: accounts/{account}/accessBindings/{access_binding} or + // properties/{property}/accessBindings/{access_binding} + // + // Example: + // "accounts/100/accessBindings/200" + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A list of roles for to grant to the parent resource. + // + // Valid values: + // predefinedRoles/viewer + // predefinedRoles/analyst + // predefinedRoles/editor + // predefinedRoles/admin + // predefinedRoles/no-cost-data + // predefinedRoles/no-revenue-data + // + // For users, if an empty list of roles is set, this AccessBinding will be + // deleted. + repeated string roles = 3; +} + +// A link between a GA4 Property and BigQuery project. +message BigQueryLink { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/BigQueryLink" + pattern: "properties/{property}/bigQueryLinks/{bigquery_link}" + }; + + // Output only. Resource name of this BigQuery link. + // Format: 'properties/{property_id}/bigQueryLinks/{bigquery_link_id}' + // Format: 'properties/1234/bigQueryLinks/abc567' + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The linked Google Cloud project. When creating a BigQueryLink, + // you may provide this resource name using either a project number or project + // ID. Once this resource has been created, the returned project will always + // have a project that contains a project number. + // Format: 'projects/{project number}' + // Example: 'projects/1234' + string project = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Time when the link was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // If set true, enables daily data export to the linked Google Cloud project. + bool daily_export_enabled = 4; + + // If set true, enables streaming export to the linked Google Cloud project. + bool streaming_export_enabled = 5; + + // If set true, enables intraday export to the linked Google Cloud project. + bool intraday_export_enabled = 9; + + // If set true, exported data will include advertising identifiers for mobile + // app streams. + bool include_advertising_id = 6; + + // The list of streams under the parent property for which data will be + // exported. + // Format: properties/{property_id}/dataStreams/{stream_id} + // Example: ['properties/1000/dataStreams/2000'] + repeated string export_streams = 7; + + // The list of event names that will be excluded from exports. + repeated string excluded_events = 8; +} + +// Singleton resource under a WebDataStream, configuring measurement of +// additional site interactions and content. +message EnhancedMeasurementSettings { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/EnhancedMeasurementSettings" + pattern: "properties/{property}/dataStreams/{data_stream}/enhancedMeasurementSettings" + }; + + // Output only. Resource name of the Enhanced Measurement Settings. + // Format: + // properties/{property_id}/dataStreams/{data_stream}/enhancedMeasurementSettings + // Example: "properties/1000/dataStreams/2000/enhancedMeasurementSettings" + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Indicates whether Enhanced Measurement Settings will be used to + // automatically measure interactions and content on this web stream. + // + // Changing this value does not affect the settings themselves, but determines + // whether they are respected. + bool stream_enabled = 2; + + // If enabled, capture scroll events each time a visitor gets to the bottom of + // a page. + bool scrolls_enabled = 3; + + // If enabled, capture an outbound click event each time a visitor clicks a + // link that leads them away from your domain. + bool outbound_clicks_enabled = 4; + + // If enabled, capture a view search results event each time a visitor + // performs a search on your site (based on a query parameter). + bool site_search_enabled = 5; + + // If enabled, capture video play, progress, and complete events as visitors + // view embedded videos on your site. + bool video_engagement_enabled = 6; + + // If enabled, capture a file download event each time a link is clicked with + // a common document, compressed file, application, video, or audio extension. + bool file_downloads_enabled = 7; + + // If enabled, capture a page view event each time the website changes the + // browser history state. + bool page_changes_enabled = 8; + + // If enabled, capture a form interaction event each time a visitor interacts + // with a form on your website. + // False by default. + bool form_interactions_enabled = 9; + + // Required. URL query parameters to interpret as site search parameters. + // Max length is 1024 characters. Must not be empty. + string search_query_parameter = 10 [(google.api.field_behavior) = REQUIRED]; + + // Additional URL query parameters. + // Max length is 1024 characters. + string uri_query_parameter = 11; +} + +// Configuration for a specific Connected Site Tag. +message ConnectedSiteTag { + // Required. User-provided display name for the connected site tag. Must be + // less than 256 characters. + string display_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. "Tag ID to forward events to. Also known as the Measurement ID, + // or the "G-ID" (For example: G-12345). + string tag_id = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js new file mode 100644 index 00000000000..98083278d13 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js @@ -0,0 +1,72 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js new file mode 100644 index 00000000000..de70e74c894 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_audience.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_audience.js new file mode 100644 index 00000000000..cdcf17da58b --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_audience.js @@ -0,0 +1,61 @@ +// Copyright 2023 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_ArchiveAudience_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234/audiences/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callArchiveAudience() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.archiveAudience(request); + console.log(response); + } + + callArchiveAudience(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveAudience_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js new file mode 100644 index 00000000000..f87956f6a66 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js new file mode 100644 index 00000000000..b8e70cfca04 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.audit_user_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.audit_user_links.js new file mode 100644 index 00000000000..d52beedb093 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.audit_user_links.js @@ -0,0 +1,77 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_access_bindings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_access_bindings.js new file mode 100644 index 00000000000..b6cc750168a --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_access_bindings.js @@ -0,0 +1,71 @@ +// Copyright 2023 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_BatchCreateAccessBindings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account or property that owns the access bindings. The parent + * field in the CreateAccessBindingRequest messages must either be empty or + * match this field. Formats: + * - accounts/{account} + * - properties/{property} + */ + // const parent = 'abc123' + /** + * Required. The requests specifying the access bindings to create. + * A maximum of 1000 access bindings 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 callBatchCreateAccessBindings() { + // Construct request + const request = { + parent, + requests, + }; + + // Run request + const response = await adminClient.batchCreateAccessBindings(request); + console.log(response); + } + + callBatchCreateAccessBindings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateAccessBindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_user_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_user_links.js new file mode 100644 index 00000000000..060696acf81 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_user_links.js @@ -0,0 +1,76 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_access_bindings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_access_bindings.js new file mode 100644 index 00000000000..9a52a27a279 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_access_bindings.js @@ -0,0 +1,71 @@ +// Copyright 2023 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_BatchDeleteAccessBindings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account or property that owns the access bindings. The parent + * of all provided values for the 'names' field in DeleteAccessBindingRequest + * messages must match this field. Formats: + * - accounts/{account} + * - properties/{property} + */ + // const parent = 'abc123' + /** + * Required. The requests specifying the access bindings to delete. + * A maximum of 1000 access bindings can be deleted 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 callBatchDeleteAccessBindings() { + // Construct request + const request = { + parent, + requests, + }; + + // Run request + const response = await adminClient.batchDeleteAccessBindings(request); + console.log(response); + } + + callBatchDeleteAccessBindings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteAccessBindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_user_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_user_links.js new file mode 100644 index 00000000000..07e4b169229 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_user_links.js @@ -0,0 +1,70 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_access_bindings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_access_bindings.js new file mode 100644 index 00000000000..d161e86210b --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_access_bindings.js @@ -0,0 +1,74 @@ +// Copyright 2023 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_BatchGetAccessBindings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account or property that owns the access bindings. The parent + * of all provided values for the 'names' field must match this field. + * Formats: + * - accounts/{account} + * - properties/{property} + */ + // const parent = 'abc123' + /** + * Required. The names of the access bindings to retrieve. + * A maximum of 1000 access bindings can be retrieved in a batch. + * Formats: + * - accounts/{account}/accessBindings/{accessBinding} + * - properties/{property}/accessBindings/{accessBinding} + */ + // const names = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callBatchGetAccessBindings() { + // Construct request + const request = { + parent, + names, + }; + + // Run request + const response = await adminClient.batchGetAccessBindings(request); + console.log(response); + } + + callBatchGetAccessBindings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetAccessBindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_user_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_user_links.js new file mode 100644 index 00000000000..dd2b0c2ff53 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_user_links.js @@ -0,0 +1,71 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_access_bindings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_access_bindings.js new file mode 100644 index 00000000000..284b77a899a --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_access_bindings.js @@ -0,0 +1,72 @@ +// Copyright 2023 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_BatchUpdateAccessBindings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account or property that owns the access bindings. The parent + * of all provided AccessBinding in UpdateAccessBindingRequest messages must + * match this field. + * Formats: + * - accounts/{account} + * - properties/{property} + */ + // const parent = 'abc123' + /** + * Required. The requests specifying the access bindings to update. + * A maximum of 1000 access bindings 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 callBatchUpdateAccessBindings() { + // Construct request + const request = { + parent, + requests, + }; + + // Run request + const response = await adminClient.batchUpdateAccessBindings(request); + console.log(response); + } + + callBatchUpdateAccessBindings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateAccessBindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_user_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_user_links.js new file mode 100644 index 00000000000..5f67f5778e7 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_user_links.js @@ -0,0 +1,70 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js new file mode 100644 index 00000000000..dbb143850c9 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_access_binding.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_access_binding.js new file mode 100644 index 00000000000..bd6831adac8 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_access_binding.js @@ -0,0 +1,68 @@ +// Copyright 2023 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, accessBinding) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAccessBinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Formats: + * - accounts/{account} + * - properties/{property} + */ + // const parent = 'abc123' + /** + * Required. The access binding to create. + */ + // const accessBinding = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateAccessBinding() { + // Construct request + const request = { + parent, + accessBinding, + }; + + // Run request + const response = await adminClient.createAccessBinding(request); + console.log(response); + } + + callCreateAccessBinding(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAccessBinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_audience.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_audience.js new file mode 100644 index 00000000000..daeacc2aab2 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_audience.js @@ -0,0 +1,66 @@ +// Copyright 2023 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, audience) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAudience_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * Required. The audience to create. + */ + // const audience = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateAudience() { + // Construct request + const request = { + parent, + audience, + }; + + // Run request + const response = await adminClient.createAudience(request); + console.log(response); + } + + callCreateAudience(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAudience_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_connected_site_tag.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_connected_site_tag.js new file mode 100644 index 00000000000..ec3d16a77e1 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_connected_site_tag.js @@ -0,0 +1,68 @@ +// Copyright 2023 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(connectedSiteTag) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConnectedSiteTag_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The Universal Analytics property to create connected site tags for. + * This API does not support GA4 properties. + * Format: properties/{universalAnalyticsPropertyId} + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * Required. The tag to add to the Universal Analytics property + */ + // const connectedSiteTag = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateConnectedSiteTag() { + // Construct request + const request = { + connectedSiteTag, + }; + + // Run request + const response = await adminClient.createConnectedSiteTag(request); + console.log(response); + } + + callCreateConnectedSiteTag(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConnectedSiteTag_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js new file mode 100644 index 00000000000..f91a5a90008 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js @@ -0,0 +1,67 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js new file mode 100644 index 00000000000..7c8f9b12d3a --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js @@ -0,0 +1,66 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js new file mode 100644 index 00000000000..a4d290d5085 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js @@ -0,0 +1,66 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js new file mode 100644 index 00000000000..6f35f883eeb --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js @@ -0,0 +1,66 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js new file mode 100644 index 00000000000..569aa1af1c5 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js @@ -0,0 +1,66 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js new file mode 100644 index 00000000000..8f825694bda --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js @@ -0,0 +1,66 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_expanded_data_set.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_expanded_data_set.js new file mode 100644 index 00000000000..998c7143212 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_expanded_data_set.js @@ -0,0 +1,66 @@ +// Copyright 2023 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, expandedDataSet) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateExpandedDataSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * Required. The ExpandedDataSet to create. + */ + // const expandedDataSet = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateExpandedDataSet() { + // Construct request + const request = { + parent, + expandedDataSet, + }; + + // Run request + const response = await adminClient.createExpandedDataSet(request); + console.log(response); + } + + callCreateExpandedDataSet(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateExpandedDataSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js new file mode 100644 index 00000000000..6e3d476986e --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js @@ -0,0 +1,67 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js new file mode 100644 index 00000000000..4d03720a8a0 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js @@ -0,0 +1,66 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js new file mode 100644 index 00000000000..f3c4fa76475 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js @@ -0,0 +1,67 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_property.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_property.js new file mode 100644 index 00000000000..8d9ad7c4175 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_property.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_search_ads360_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_search_ads360_link.js new file mode 100644 index 00000000000..59a71dff161 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_search_ads360_link.js @@ -0,0 +1,66 @@ +// Copyright 2023 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, searchAds_360Link) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateSearchAds360Link_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234 + */ + // const parent = 'abc123' + /** + * Required. The SearchAds360Link to create. + */ + // const searchAds_360Link = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callCreateSearchAds360Link() { + // Construct request + const request = { + parent, + searchAds_360Link, + }; + + // Run request + const response = await adminClient.createSearchAds360Link(request); + console.log(response); + } + + callCreateSearchAds360Link(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateSearchAds360Link_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_user_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_user_link.js new file mode 100644 index 00000000000..1aa08159cc2 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_user_link.js @@ -0,0 +1,71 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_access_binding.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_access_binding.js new file mode 100644 index 00000000000..52a55931963 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_access_binding.js @@ -0,0 +1,63 @@ +// Copyright 2023 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_DeleteAccessBinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Formats: + * - accounts/{account}/accessBindings/{accessBinding} + * - properties/{property}/accessBindings/{accessBinding} + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callDeleteAccessBinding() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteAccessBinding(request); + console.log(response); + } + + callDeleteAccessBinding(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccessBinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_account.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_account.js new file mode 100644 index 00000000000..867e1628b3b --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_account.js @@ -0,0 +1,63 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_connected_site_tag.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_connected_site_tag.js new file mode 100644 index 00000000000..cd6c4d71e8f --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_connected_site_tag.js @@ -0,0 +1,68 @@ +// Copyright 2023 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_DeleteConnectedSiteTag_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The Universal Analytics property to delete connected site tags for. + * This API does not support GA4 properties. + * Format: properties/{universalAnalyticsPropertyId} + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * Tag ID to forward events to. Also known as the Measurement ID, or the + * "G-ID" (For example: G-12345). + */ + // const tagId = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callDeleteConnectedSiteTag() { + // Construct request + const request = { + }; + + // Run request + const response = await adminClient.deleteConnectedSiteTag(request); + console.log(response); + } + + callDeleteConnectedSiteTag(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConnectedSiteTag_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js new file mode 100644 index 00000000000..1820c4aea41 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js @@ -0,0 +1,63 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js new file mode 100644 index 00000000000..aeb8b3748f0 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js new file mode 100644 index 00000000000..d778ebd08f5 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js new file mode 100644 index 00000000000..362b62b42c5 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_expanded_data_set.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_expanded_data_set.js new file mode 100644 index 00000000000..b72569808b2 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_expanded_data_set.js @@ -0,0 +1,61 @@ +// Copyright 2023 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_DeleteExpandedDataSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example format: properties/1234/expandedDataSets/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callDeleteExpandedDataSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteExpandedDataSet(request); + console.log(response); + } + + callDeleteExpandedDataSet(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteExpandedDataSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js new file mode 100644 index 00000000000..19d8ee7af4c --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js new file mode 100644 index 00000000000..104d055896c --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js @@ -0,0 +1,61 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js new file mode 100644 index 00000000000..f336a0dfdc2 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js @@ -0,0 +1,63 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_property.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_property.js new file mode 100644 index 00000000000..3d90302d7c2 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_property.js @@ -0,0 +1,63 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_search_ads360_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_search_ads360_link.js new file mode 100644 index 00000000000..35605a18326 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_search_ads360_link.js @@ -0,0 +1,62 @@ +// Copyright 2023 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_DeleteSearchAds360Link_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the SearchAds360Link to delete. + * Example format: properties/1234/SearchAds360Links/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callDeleteSearchAds360Link() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.deleteSearchAds360Link(request); + console.log(response); + } + + callDeleteSearchAds360Link(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteSearchAds360Link_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_user_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_user_link.js new file mode 100644 index 00000000000..6c875323a34 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_user_link.js @@ -0,0 +1,61 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js new file mode 100644 index 00000000000..60a7bff718c --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js @@ -0,0 +1,64 @@ +// Copyright 2023 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_FetchAutomatedGa4ConfigurationOptOut_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The UA property to get the opt out status. Note this request uses + * the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. + * Format: properties/{internalWebPropertyId} + * Example: properties/1234 + */ + // const property = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callFetchAutomatedGa4ConfigurationOptOut() { + // Construct request + const request = { + property, + }; + + // Run request + const response = await adminClient.fetchAutomatedGa4ConfigurationOptOut(request); + console.log(response); + } + + callFetchAutomatedGa4ConfigurationOptOut(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_FetchAutomatedGa4ConfigurationOptOut_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_access_binding.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_access_binding.js new file mode 100644 index 00000000000..31b46782f6d --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_access_binding.js @@ -0,0 +1,64 @@ +// Copyright 2023 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_GetAccessBinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the access binding to retrieve. + * Formats: + * - accounts/{account}/accessBindings/{accessBinding} + * - properties/{property}/accessBindings/{accessBinding} + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetAccessBinding() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getAccessBinding(request); + console.log(response); + } + + callGetAccessBinding(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccessBinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_account.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_account.js new file mode 100644 index 00000000000..48934bcd2ca --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_account.js @@ -0,0 +1,63 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_attribution_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_attribution_settings.js new file mode 100644 index 00000000000..9abec8f1fe2 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_attribution_settings.js @@ -0,0 +1,62 @@ +// Copyright 2023 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_GetAttributionSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the attribution settings to retrieve. + * Format: properties/{property}/attributionSettings + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetAttributionSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getAttributionSettings(request); + console.log(response); + } + + callGetAttributionSettings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAttributionSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_audience.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_audience.js new file mode 100644 index 00000000000..4f67ea0074d --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_audience.js @@ -0,0 +1,62 @@ +// Copyright 2023 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_GetAudience_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Audience to get. + * Example format: properties/1234/audiences/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetAudience() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getAudience(request); + console.log(response); + } + + callGetAudience(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAudience_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_big_query_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_big_query_link.js new file mode 100644 index 00000000000..5564736ccf6 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_big_query_link.js @@ -0,0 +1,63 @@ +// Copyright 2023 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_GetBigQueryLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the BigQuery link to lookup. + * Format: properties/{property_id}/bigQueryLinks/{bigquery_link_id} + * Example: properties/123/bigQueryLinks/456 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetBigQueryLink() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getBigQueryLink(request); + console.log(response); + } + + callGetBigQueryLink(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetBigQueryLink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js new file mode 100644 index 00000000000..e5f84fc9277 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js @@ -0,0 +1,63 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js new file mode 100644 index 00000000000..1f2e72e8754 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js new file mode 100644 index 00000000000..9b3cd0878d3 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js new file mode 100644 index 00000000000..23bd95b466a --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js @@ -0,0 +1,64 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js new file mode 100644 index 00000000000..f00649b543f --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js @@ -0,0 +1,63 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js new file mode 100644 index 00000000000..fe0067d6930 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js new file mode 100644 index 00000000000..bba9c0e7f77 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js new file mode 100644 index 00000000000..b9f1c986cc9 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_enhanced_measurement_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_enhanced_measurement_settings.js new file mode 100644 index 00000000000..8d6711c21c0 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_enhanced_measurement_settings.js @@ -0,0 +1,64 @@ +// Copyright 2023 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_GetEnhancedMeasurementSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the settings to lookup. + * Format: + * properties/{property}/dataStreams/{data_stream}/enhancedMeasurementSettings + * Example: "properties/1000/dataStreams/2000/enhancedMeasurementSettings" + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetEnhancedMeasurementSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getEnhancedMeasurementSettings(request); + console.log(response); + } + + callGetEnhancedMeasurementSettings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetEnhancedMeasurementSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_expanded_data_set.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_expanded_data_set.js new file mode 100644 index 00000000000..96f278f0ea4 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_expanded_data_set.js @@ -0,0 +1,62 @@ +// Copyright 2023 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_GetExpandedDataSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Audience to get. + * Example format: properties/1234/expandedDataSets/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetExpandedDataSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getExpandedDataSet(request); + console.log(response); + } + + callGetExpandedDataSet(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetExpandedDataSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js new file mode 100644 index 00000000000..59f5e3d0791 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js @@ -0,0 +1,64 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js new file mode 100644 index 00000000000..d52d63e42b6 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js @@ -0,0 +1,62 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js new file mode 100644 index 00000000000..47699dbaeab --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js @@ -0,0 +1,63 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_property.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_property.js new file mode 100644 index 00000000000..404250f65ba --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_property.js @@ -0,0 +1,63 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_search_ads360_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_search_ads360_link.js new file mode 100644 index 00000000000..289b4db508b --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_search_ads360_link.js @@ -0,0 +1,62 @@ +// Copyright 2023 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_GetSearchAds360Link_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the SearchAds360Link to get. + * Example format: properties/1234/SearchAds360Link/5678 + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetSearchAds360Link() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getSearchAds360Link(request); + console.log(response); + } + + callGetSearchAds360Link(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetSearchAds360Link_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_user_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_user_link.js new file mode 100644 index 00000000000..6c45e8fc0a6 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_user_link.js @@ -0,0 +1,61 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_access_bindings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_access_bindings.js new file mode 100644 index 00000000000..42a759900f1 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_access_bindings.js @@ -0,0 +1,79 @@ +// Copyright 2023 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_ListAccessBindings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Formats: + * - accounts/{account} + * - properties/{property} + */ + // const parent = 'abc123' + /** + * The maximum number of access bindings to return. + * The service may return fewer than this value. + * If unspecified, at most 200 access bindings 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 `ListAccessBindings` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccessBindings` 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 callListAccessBindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listAccessBindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAccessBindings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccessBindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js new file mode 100644 index 00000000000..5b8c1884043 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js @@ -0,0 +1,72 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_accounts.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_accounts.js new file mode 100644 index 00000000000..9a784dda130 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_accounts.js @@ -0,0 +1,78 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_audiences.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_audiences.js new file mode 100644 index 00000000000..f8e33615a5c --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_audiences.js @@ -0,0 +1,76 @@ +// Copyright 2023 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_ListAudiences_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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 `ListAudiences` call. Provide this + * to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAudiences` 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 callListAudiences() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listAudiencesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAudiences(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAudiences_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_big_query_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_big_query_links.js new file mode 100644 index 00000000000..54814082c7a --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_big_query_links.js @@ -0,0 +1,79 @@ +// Copyright 2023 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_ListBigQueryLinks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the property to list BigQuery links under. + * 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 `ListBigQueryLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListBigQueryLinks` 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 callListBigQueryLinks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listBigQueryLinksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBigQueryLinks(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListBigQueryLinks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_connected_site_tags.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_connected_site_tags.js new file mode 100644 index 00000000000..e7a4115d8a8 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_connected_site_tags.js @@ -0,0 +1,63 @@ +// Copyright 2023 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_ListConnectedSiteTags_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The Universal Analytics property to fetch connected site tags for. + * This does not work on GA4 properties. A maximum of 20 connected site tags + * will be returned. + * Example Format: `properties/1234` + */ + // const property = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callListConnectedSiteTags() { + // Construct request + const request = { + }; + + // Run request + const response = await adminClient.listConnectedSiteTags(request); + console.log(response); + } + + callListConnectedSiteTags(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConnectedSiteTags_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js new file mode 100644 index 00000000000..70b2297f8a8 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js @@ -0,0 +1,77 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js new file mode 100644 index 00000000000..a53a7e9da4f --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js @@ -0,0 +1,76 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js new file mode 100644 index 00000000000..2256aa9d2cb --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js @@ -0,0 +1,76 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js new file mode 100644 index 00000000000..2dbc06ef961 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js @@ -0,0 +1,76 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js new file mode 100644 index 00000000000..a9c504f2629 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js @@ -0,0 +1,78 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js new file mode 100644 index 00000000000..b137201eeb0 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js @@ -0,0 +1,77 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_expanded_data_sets.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_expanded_data_sets.js new file mode 100644 index 00000000000..3b0b6199b7c --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_expanded_data_sets.js @@ -0,0 +1,76 @@ +// Copyright 2023 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_ListExpandedDataSets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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 `ListExpandedDataSets` call. Provide + * this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListExpandedDataSet` + * 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 callListExpandedDataSets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listExpandedDataSetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListExpandedDataSets(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListExpandedDataSets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js new file mode 100644 index 00000000000..bb69c4e2ab4 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js @@ -0,0 +1,78 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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 `ListFirebaseLinks` 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js new file mode 100644 index 00000000000..4d3e44d82b6 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js @@ -0,0 +1,76 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js new file mode 100644 index 00000000000..7633be4e228 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js @@ -0,0 +1,78 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_properties.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_properties.js new file mode 100644 index 00000000000..e74cc55d912 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_properties.js @@ -0,0 +1,97 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_search_ads360_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_search_ads360_links.js new file mode 100644 index 00000000000..23d2973dc51 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_search_ads360_links.js @@ -0,0 +1,77 @@ +// Copyright 2023 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_ListSearchAds360Links_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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 `ListSearchAds360Links` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListSearchAds360Links` 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 callListSearchAds360Links() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await adminClient.listSearchAds360LinksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSearchAds360Links(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListSearchAds360Links_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_user_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_user_links.js new file mode 100644 index 00000000000..6587f55080b --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_user_links.js @@ -0,0 +1,77 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js new file mode 100644 index 00000000000..4d91193354f --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js @@ -0,0 +1,65 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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 Cloud 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.run_access_report.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.run_access_report.js new file mode 100644 index 00000000000..101f8f1d967 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.run_access_report.js @@ -0,0 +1,139 @@ +// Copyright 2023 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_RunAccessReport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The Data Access Report supports requesting at the property level or account + * level. If requested at the account level, Data Access Reports include all + * access for all properties under that account. + * To request at the property level, entity should be for example + * 'properties/123' if "123" is your GA4 property ID. To request at the + * account level, entity should be for example 'accounts/1234' if "1234" is + * your GA4 Account ID. + */ + // const entity = 'abc123' + /** + * The dimensions requested and displayed in the response. Requests are + * allowed up to 9 dimensions. + */ + // const dimensions = 1234 + /** + * The metrics requested and displayed in the response. Requests are allowed + * up to 10 metrics. + */ + // const metrics = 1234 + /** + * Date ranges of access records to read. If multiple date ranges are + * requested, each response row will contain a zero based date range index. If + * two date ranges overlap, the access records for the overlapping days is + * included in the response rows for both date ranges. Requests are allowed up + * to 2 date ranges. + */ + // const dateRanges = 1234 + /** + * Dimension filters let you restrict report response to specific + * dimension values which match the filter. For example, filtering on access + * records of a single user. To learn more, see Fundamentals of Dimension + * Filters (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + */ + // const dimensionFilter = {} + /** + * Metric filters allow you to restrict report response to specific metric + * values which match the filter. Metric filters are applied after aggregating + * the report's rows, similar to SQL having-clause. Dimensions cannot be used + * in this filter. + */ + // const metricFilter = {} + /** + * The row count of the start row. The first row is counted as row 0. If + * offset is unspecified, it is treated as 0. If offset is zero, then this + * method will return the first page of results with `limit` entries. + * To learn more about this pagination parameter, see + * Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + */ + // const offset = 1234 + /** + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * The API may return fewer rows than the requested `limit`, if there aren't + * as many remaining rows as the `limit`. For instance, there are fewer than + * 300 possible values for the dimension `country`, so when reporting on only + * `country`, you can't get more than 300 rows, even if you set `limit` to a + * higher value. + * To learn more about this pagination parameter, see + * Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + */ + // const limit = 1234 + /** + * This request's time zone if specified. If unspecified, the property's time + * zone is used. The request's time zone is used to interpret the start & end + * dates of the report. + * Formatted as strings from the IANA Time Zone database + * (https://www.iana.org/time-zones); for example "America/New_York" or + * "Asia/Tokyo". + */ + // const timeZone = 'abc123' + /** + * Specifies how rows are ordered in the response. + */ + // const orderBys = 1234 + /** + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in AccessQuota (#AccessQuota). For account-level + * requests, this field must be false. + */ + // const returnEntityQuota = true + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callRunAccessReport() { + // Construct request + const request = { + }; + + // Run request + const response = await adminClient.runAccessReport(request); + console.log(response); + } + + callRunAccessReport(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_RunAccessReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js new file mode 100644 index 00000000000..0e538c86e34 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js @@ -0,0 +1,107 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.set_automated_ga4_configuration_opt_out.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.set_automated_ga4_configuration_opt_out.js new file mode 100644 index 00000000000..273015d7154 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.set_automated_ga4_configuration_opt_out.js @@ -0,0 +1,68 @@ +// Copyright 2023 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_SetAutomatedGa4ConfigurationOptOut_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The UA property to set the opt out status. Note this request uses + * the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. + * Format: properties/{internalWebPropertyId} + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * The status to set. + */ + // const optOut = true + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callSetAutomatedGa4ConfigurationOptOut() { + // Construct request + const request = { + property, + }; + + // Run request + const response = await adminClient.setAutomatedGa4ConfigurationOptOut(request); + console.log(response); + } + + callSetAutomatedGa4ConfigurationOptOut(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_SetAutomatedGa4ConfigurationOptOut_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_access_binding.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_access_binding.js new file mode 100644 index 00000000000..281f812a694 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_access_binding.js @@ -0,0 +1,61 @@ +// Copyright 2023 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(accessBinding) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccessBinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The access binding to update. + */ + // const accessBinding = {} + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callUpdateAccessBinding() { + // Construct request + const request = { + accessBinding, + }; + + // Run request + const response = await adminClient.updateAccessBinding(request); + console.log(response); + } + + callUpdateAccessBinding(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccessBinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_account.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_account.js new file mode 100644 index 00000000000..c0f57011485 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_account.js @@ -0,0 +1,70 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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 (for example, "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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_attribution_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_attribution_settings.js new file mode 100644 index 00000000000..45c242e4b9f --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_attribution_settings.js @@ -0,0 +1,70 @@ +// Copyright 2023 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(attributionSettings, updateMask) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAttributionSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The attribution settings to update. + * The `name` field is used to identify the settings to be updated. + */ + // const attributionSettings = {} + /** + * 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 callUpdateAttributionSettings() { + // Construct request + const request = { + attributionSettings, + updateMask, + }; + + // Run request + const response = await adminClient.updateAttributionSettings(request); + console.log(response); + } + + callUpdateAttributionSettings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAttributionSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_audience.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_audience.js new file mode 100644 index 00000000000..3022808b717 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_audience.js @@ -0,0 +1,70 @@ +// Copyright 2023 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(audience, updateMask) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAudience_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The audience to update. + * The audience's `name` field is used to identify the audience to be updated. + */ + // const audience = {} + /** + * 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 callUpdateAudience() { + // Construct request + const request = { + audience, + updateMask, + }; + + // Run request + const response = await adminClient.updateAudience(request); + console.log(response); + } + + callUpdateAudience(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAudience_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js new file mode 100644 index 00000000000..a3db5b174dd --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js @@ -0,0 +1,67 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js new file mode 100644 index 00000000000..b67e5c63655 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js @@ -0,0 +1,67 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js new file mode 100644 index 00000000000..e1cbc71aa94 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js @@ -0,0 +1,70 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js new file mode 100644 index 00000000000..a5a31d7fd75 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js @@ -0,0 +1,67 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js new file mode 100644 index 00000000000..57aa18ab7e2 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js @@ -0,0 +1,67 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_enhanced_measurement_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_enhanced_measurement_settings.js new file mode 100644 index 00000000000..0e7c94435b3 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_enhanced_measurement_settings.js @@ -0,0 +1,70 @@ +// Copyright 2023 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(enhancedMeasurementSettings, updateMask) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateEnhancedMeasurementSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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 enhancedMeasurementSettings = {} + /** + * 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 callUpdateEnhancedMeasurementSettings() { + // Construct request + const request = { + enhancedMeasurementSettings, + updateMask, + }; + + // Run request + const response = await adminClient.updateEnhancedMeasurementSettings(request); + console.log(response); + } + + callUpdateEnhancedMeasurementSettings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateEnhancedMeasurementSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_expanded_data_set.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_expanded_data_set.js new file mode 100644 index 00000000000..29dd5a06ae2 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_expanded_data_set.js @@ -0,0 +1,71 @@ +// Copyright 2023 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(expandedDataSet, updateMask) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateExpandedDataSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ExpandedDataSet to update. + * The resource's `name` field is used to identify the ExpandedDataSet to be + * updated. + */ + // const expandedDataSet = {} + /** + * 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 callUpdateExpandedDataSet() { + // Construct request + const request = { + expandedDataSet, + updateMask, + }; + + // Run request + const response = await adminClient.updateExpandedDataSet(request); + console.log(response); + } + + callUpdateExpandedDataSet(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateExpandedDataSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js new file mode 100644 index 00000000000..a72639f1bdc --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js @@ -0,0 +1,68 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js new file mode 100644 index 00000000000..b2d449e33d6 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js @@ -0,0 +1,70 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js new file mode 100644 index 00000000000..df2a333c0c8 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js @@ -0,0 +1,65 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_property.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_property.js new file mode 100644 index 00000000000..9b5ca7d5f5e --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_property.js @@ -0,0 +1,71 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_search_ads360_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_search_ads360_link.js new file mode 100644 index 00000000000..b0d81ed5103 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_search_ads360_link.js @@ -0,0 +1,67 @@ +// Copyright 2023 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_UpdateSearchAds360Link_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The SearchAds360Link to update + */ + // const searchAds_360Link = {} + /** + * 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 callUpdateSearchAds360Link() { + // Construct request + const request = { + updateMask, + }; + + // Run request + const response = await adminClient.updateSearchAds360Link(request); + console.log(response); + } + + callUpdateSearchAds360Link(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateSearchAds360Link_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_user_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_user_link.js new file mode 100644 index 00000000000..e7fc37a7f18 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_user_link.js @@ -0,0 +1,61 @@ +// Copyright 2023 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json new file mode 100644 index 00000000000..17dbe2d1275 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json @@ -0,0 +1,4695 @@ +{ + "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": 55, + "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": 70, + "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": 55, + "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": 62, + "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": 57, + "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": 64, + "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": 55, + "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": 89, + "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": 54, + "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 a GA4 Property.", + "canonical": true, + "file": "analytics_admin_service.delete_property.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "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": 63, + "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": 53, + "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": 63, + "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": 69, + "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": 69, + "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": 63, + "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": 68, + "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": 53, + "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": 62, + "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": 53, + "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": 62, + "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": 59, + "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": 54, + "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": 70, + "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": 56, + "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": 58, + "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": 60, + "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": 53, + "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": 68, + "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": 55, + "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": 55, + "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": 70, + "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": 59, + "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": 55, + "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": 57, + "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 through 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": 64, + "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": 99, + "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": 54, + "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": 62, + "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": 59, + "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": 55, + "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": 55, + "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": 69, + "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": 54, + "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": 69, + "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": 58, + "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": 54, + "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": 59, + "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": 54, + "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": 70, + "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": 58, + "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": 54, + "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": 54, + "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": 54, + "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": 58, + "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": 59, + "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": 68, + "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": 54, + "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": 54, + "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": 58, + "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": 59, + "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": 68, + "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": 54, + "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": 54, + "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": 56, + "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": 62, + "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": 58, + "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": 54, + "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": 59, + "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": 68, + "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": 54, + "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" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAudience_async", + "title": "AnalyticsAdminService getAudience Sample", + "origin": "API_DEFINITION", + "description": " Lookup for a single Audience. Audiences created before 2020 may not be supported. Default audiences will not show filter definitions.", + "canonical": true, + "file": "analytics_admin_service.get_audience.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAudience", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.Audience", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAudience", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAudiences_async", + "title": "AnalyticsAdminService listAudiences Sample", + "origin": "API_DEFINITION", + "description": " Lists Audiences on a property. Audiences created before 2020 may not be supported. Default audiences will not show filter definitions.", + "canonical": true, + "file": "analytics_admin_service.list_audiences.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAudiences", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAudiences", + "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.ListAudiencesResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListAudiences", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAudiences", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAudience_async", + "title": "AnalyticsAdminService createAudience Sample", + "origin": "API_DEFINITION", + "description": " Creates an Audience.", + "canonical": true, + "file": "analytics_admin_service.create_audience.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateAudience", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "audience", + "type": ".google.analytics.admin.v1alpha.Audience" + } + ], + "resultType": ".google.analytics.admin.v1alpha.Audience", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateAudience", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAudience_async", + "title": "AnalyticsAdminService updateAudience Sample", + "origin": "API_DEFINITION", + "description": " Updates an Audience on a property.", + "canonical": true, + "file": "analytics_admin_service.update_audience.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAudience", + "async": true, + "parameters": [ + { + "name": "audience", + "type": ".google.analytics.admin.v1alpha.Audience" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.Audience", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAudience", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveAudience_async", + "title": "AnalyticsAdminService archiveAudience Sample", + "origin": "API_DEFINITION", + "description": " Archives an Audience on a property.", + "canonical": true, + "file": "analytics_admin_service.archive_audience.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ArchiveAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ArchiveAudience", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ArchiveAudience", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ArchiveAudience", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetSearchAds360Link_async", + "title": "AnalyticsAdminService getSearchAds360Link Sample", + "origin": "API_DEFINITION", + "description": " Look up a single SearchAds360Link", + "canonical": true, + "file": "analytics_admin_service.get_search_ads360_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSearchAds360Link", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetSearchAds360Link", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.SearchAds360Link", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetSearchAds360Link", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetSearchAds360Link", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListSearchAds360Links_async", + "title": "AnalyticsAdminService listSearchAds360Links Sample", + "origin": "API_DEFINITION", + "description": " Lists all SearchAds360Links on a property.", + "canonical": true, + "file": "analytics_admin_service.list_search_ads360_links.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSearchAds360Links", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListSearchAds360Links", + "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.ListSearchAds360LinksResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListSearchAds360Links", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListSearchAds360Links", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateSearchAds360Link_async", + "title": "AnalyticsAdminService createSearchAds360Link Sample", + "origin": "API_DEFINITION", + "description": " Creates a SearchAds360Link.", + "canonical": true, + "file": "analytics_admin_service.create_search_ads360_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSearchAds360Link", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateSearchAds360Link", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "search_ads_360_link", + "type": ".google.analytics.admin.v1alpha.SearchAds360Link" + } + ], + "resultType": ".google.analytics.admin.v1alpha.SearchAds360Link", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateSearchAds360Link", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateSearchAds360Link", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteSearchAds360Link_async", + "title": "AnalyticsAdminService deleteSearchAds360Link Sample", + "origin": "API_DEFINITION", + "description": " Deletes a SearchAds360Link on a property.", + "canonical": true, + "file": "analytics_admin_service.delete_search_ads360_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSearchAds360Link", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteSearchAds360Link", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteSearchAds360Link", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteSearchAds360Link", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateSearchAds360Link_async", + "title": "AnalyticsAdminService updateSearchAds360Link Sample", + "origin": "API_DEFINITION", + "description": " Updates a SearchAds360Link on a property.", + "canonical": true, + "file": "analytics_admin_service.update_search_ads360_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSearchAds360Link", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateSearchAds360Link", + "async": true, + "parameters": [ + { + "name": "search_ads_360_link", + "type": ".google.analytics.admin.v1alpha.SearchAds360Link" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.SearchAds360Link", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateSearchAds360Link", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateSearchAds360Link", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAttributionSettings_async", + "title": "AnalyticsAdminService getAttributionSettings Sample", + "origin": "API_DEFINITION", + "description": " Lookup for a AttributionSettings singleton.", + "canonical": true, + "file": "analytics_admin_service.get_attribution_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAttributionSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAttributionSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.AttributionSettings", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetAttributionSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAttributionSettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAttributionSettings_async", + "title": "AnalyticsAdminService updateAttributionSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates attribution settings on a property.", + "canonical": true, + "file": "analytics_admin_service.update_attribution_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAttributionSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAttributionSettings", + "async": true, + "parameters": [ + { + "name": "attribution_settings", + "type": ".google.analytics.admin.v1alpha.AttributionSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.AttributionSettings", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateAttributionSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAttributionSettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_RunAccessReport_async", + "title": "AnalyticsAdminService runAccessReport Sample", + "origin": "API_DEFINITION", + "description": " Returns a customized report of data access records. The report provides records of each time a user reads Google Analytics reporting data. Access records are retained for up to 2 years. Data Access Reports can be requested for a property. The property must be in Google Analytics 360. This method is only available to Administrators. These data access records include GA4 UI Reporting, GA4 UI Explorations, GA4 Data API, and other products like Firebase & Admob that can retrieve data from Google Analytics through a linkage. These records don't include property configuration changes like adding a stream or changing a property's time zone. For configuration change history, see [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).", + "canonical": true, + "file": "analytics_admin_service.run_access_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 131, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunAccessReport", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.RunAccessReport", + "async": true, + "parameters": [ + { + "name": "entity", + "type": "TYPE_STRING" + }, + { + "name": "dimensions", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "metrics", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "date_ranges", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "dimension_filter", + "type": ".google.analytics.admin.v1alpha.AccessFilterExpression" + }, + { + "name": "metric_filter", + "type": ".google.analytics.admin.v1alpha.AccessFilterExpression" + }, + { + "name": "offset", + "type": "TYPE_INT64" + }, + { + "name": "limit", + "type": "TYPE_INT64" + }, + { + "name": "time_zone", + "type": "TYPE_STRING" + }, + { + "name": "order_bys", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "return_entity_quota", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.analytics.admin.v1alpha.RunAccessReportResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "RunAccessReport", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.RunAccessReport", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAccessBinding_async", + "title": "AnalyticsAdminService createAccessBinding Sample", + "origin": "API_DEFINITION", + "description": " Creates an access binding on an account or property.", + "canonical": true, + "file": "analytics_admin_service.create_access_binding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAccessBinding", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateAccessBinding", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "access_binding", + "type": ".google.analytics.admin.v1alpha.AccessBinding" + } + ], + "resultType": ".google.analytics.admin.v1alpha.AccessBinding", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateAccessBinding", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateAccessBinding", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccessBinding_async", + "title": "AnalyticsAdminService getAccessBinding Sample", + "origin": "API_DEFINITION", + "description": " Gets information about an access binding.", + "canonical": true, + "file": "analytics_admin_service.get_access_binding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAccessBinding", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAccessBinding", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.AccessBinding", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetAccessBinding", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAccessBinding", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccessBinding_async", + "title": "AnalyticsAdminService updateAccessBinding Sample", + "origin": "API_DEFINITION", + "description": " Updates an access binding on an account or property.", + "canonical": true, + "file": "analytics_admin_service.update_access_binding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAccessBinding", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAccessBinding", + "async": true, + "parameters": [ + { + "name": "access_binding", + "type": ".google.analytics.admin.v1alpha.AccessBinding" + } + ], + "resultType": ".google.analytics.admin.v1alpha.AccessBinding", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateAccessBinding", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAccessBinding", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccessBinding_async", + "title": "AnalyticsAdminService deleteAccessBinding Sample", + "origin": "API_DEFINITION", + "description": " Deletes an access binding on an account or property.", + "canonical": true, + "file": "analytics_admin_service.delete_access_binding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAccessBinding", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteAccessBinding", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteAccessBinding", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteAccessBinding", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccessBindings_async", + "title": "AnalyticsAdminService listAccessBindings Sample", + "origin": "API_DEFINITION", + "description": " Lists all access bindings on an account or property.", + "canonical": true, + "file": "analytics_admin_service.list_access_bindings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAccessBindings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccessBindings", + "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.ListAccessBindingsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListAccessBindings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccessBindings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateAccessBindings_async", + "title": "AnalyticsAdminService batchCreateAccessBindings Sample", + "origin": "API_DEFINITION", + "description": " Creates information about multiple access bindings to an account or property. This method is transactional. If any AccessBinding cannot be created, none of the AccessBindings will be created.", + "canonical": true, + "file": "analytics_admin_service.batch_create_access_bindings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchCreateAccessBindings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchCreateAccessBindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.analytics.admin.v1alpha.BatchCreateAccessBindingsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "BatchCreateAccessBindings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchCreateAccessBindings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetAccessBindings_async", + "title": "AnalyticsAdminService batchGetAccessBindings Sample", + "origin": "API_DEFINITION", + "description": " Gets information about multiple access bindings to an account or property.", + "canonical": true, + "file": "analytics_admin_service.batch_get_access_bindings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchGetAccessBindings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchGetAccessBindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "names", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.analytics.admin.v1alpha.BatchGetAccessBindingsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "BatchGetAccessBindings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchGetAccessBindings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateAccessBindings_async", + "title": "AnalyticsAdminService batchUpdateAccessBindings Sample", + "origin": "API_DEFINITION", + "description": " Updates information about multiple access bindings to an account or property.", + "canonical": true, + "file": "analytics_admin_service.batch_update_access_bindings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchUpdateAccessBindings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchUpdateAccessBindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.analytics.admin.v1alpha.BatchUpdateAccessBindingsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "BatchUpdateAccessBindings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchUpdateAccessBindings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteAccessBindings_async", + "title": "AnalyticsAdminService batchDeleteAccessBindings Sample", + "origin": "API_DEFINITION", + "description": " Deletes information about multiple users' links to an account or property.", + "canonical": true, + "file": "analytics_admin_service.batch_delete_access_bindings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchDeleteAccessBindings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchDeleteAccessBindings", + "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": "BatchDeleteAccessBindings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchDeleteAccessBindings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetExpandedDataSet_async", + "title": "AnalyticsAdminService getExpandedDataSet Sample", + "origin": "API_DEFINITION", + "description": " Lookup for a single ExpandedDataSet.", + "canonical": true, + "file": "analytics_admin_service.get_expanded_data_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetExpandedDataSet", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetExpandedDataSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ExpandedDataSet", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetExpandedDataSet", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetExpandedDataSet", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListExpandedDataSets_async", + "title": "AnalyticsAdminService listExpandedDataSets Sample", + "origin": "API_DEFINITION", + "description": " Lists ExpandedDataSets on a property.", + "canonical": true, + "file": "analytics_admin_service.list_expanded_data_sets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListExpandedDataSets", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListExpandedDataSets", + "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.ListExpandedDataSetsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListExpandedDataSets", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListExpandedDataSets", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateExpandedDataSet_async", + "title": "AnalyticsAdminService createExpandedDataSet Sample", + "origin": "API_DEFINITION", + "description": " Creates a ExpandedDataSet.", + "canonical": true, + "file": "analytics_admin_service.create_expanded_data_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateExpandedDataSet", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateExpandedDataSet", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "expanded_data_set", + "type": ".google.analytics.admin.v1alpha.ExpandedDataSet" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ExpandedDataSet", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateExpandedDataSet", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateExpandedDataSet", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateExpandedDataSet_async", + "title": "AnalyticsAdminService updateExpandedDataSet Sample", + "origin": "API_DEFINITION", + "description": " Updates a ExpandedDataSet on a property.", + "canonical": true, + "file": "analytics_admin_service.update_expanded_data_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateExpandedDataSet", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateExpandedDataSet", + "async": true, + "parameters": [ + { + "name": "expanded_data_set", + "type": ".google.analytics.admin.v1alpha.ExpandedDataSet" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ExpandedDataSet", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateExpandedDataSet", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateExpandedDataSet", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteExpandedDataSet_async", + "title": "AnalyticsAdminService deleteExpandedDataSet Sample", + "origin": "API_DEFINITION", + "description": " Deletes a ExpandedDataSet on a property.", + "canonical": true, + "file": "analytics_admin_service.delete_expanded_data_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteExpandedDataSet", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteExpandedDataSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteExpandedDataSet", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteExpandedDataSet", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_SetAutomatedGa4ConfigurationOptOut_async", + "title": "AnalyticsAdminService setAutomatedGa4ConfigurationOptOut Sample", + "origin": "API_DEFINITION", + "description": " Sets the opt out status for the automated GA4 setup process for a UA property. Note: this has no effect on GA4 property.", + "canonical": true, + "file": "analytics_admin_service.set_automated_ga4_configuration_opt_out.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetAutomatedGa4ConfigurationOptOut", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.SetAutomatedGa4ConfigurationOptOut", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "opt_out", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "SetAutomatedGa4ConfigurationOptOut", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.SetAutomatedGa4ConfigurationOptOut", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_FetchAutomatedGa4ConfigurationOptOut_async", + "title": "AnalyticsAdminService fetchAutomatedGa4ConfigurationOptOut Sample", + "origin": "API_DEFINITION", + "description": " Fetches the opt out status for the automated GA4 setup process for a UA property. Note: this has no effect on GA4 property.", + "canonical": true, + "file": "analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchAutomatedGa4ConfigurationOptOut", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.FetchAutomatedGa4ConfigurationOptOut", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "FetchAutomatedGa4ConfigurationOptOut", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.FetchAutomatedGa4ConfigurationOptOut", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetBigQueryLink_async", + "title": "AnalyticsAdminService getBigQueryLink Sample", + "origin": "API_DEFINITION", + "description": " Lookup for a single BigQuery Link.", + "canonical": true, + "file": "analytics_admin_service.get_big_query_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBigQueryLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetBigQueryLink", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.BigQueryLink", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetBigQueryLink", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetBigQueryLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListBigQueryLinks_async", + "title": "AnalyticsAdminService listBigQueryLinks Sample", + "origin": "API_DEFINITION", + "description": " Lists BigQuery Links on a property.", + "canonical": true, + "file": "analytics_admin_service.list_big_query_links.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBigQueryLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListBigQueryLinks", + "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.ListBigQueryLinksResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListBigQueryLinks", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListBigQueryLinks", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetEnhancedMeasurementSettings_async", + "title": "AnalyticsAdminService getEnhancedMeasurementSettings Sample", + "origin": "API_DEFINITION", + "description": " Returns the enhanced measurement settings for this data stream. Note that the stream must enable enhanced measurement for these settings to take effect.", + "canonical": true, + "file": "analytics_admin_service.get_enhanced_measurement_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEnhancedMeasurementSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetEnhancedMeasurementSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.EnhancedMeasurementSettings", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetEnhancedMeasurementSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetEnhancedMeasurementSettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateEnhancedMeasurementSettings_async", + "title": "AnalyticsAdminService updateEnhancedMeasurementSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates the enhanced measurement settings for this data stream. Note that the stream must enable enhanced measurement for these settings to take effect.", + "canonical": true, + "file": "analytics_admin_service.update_enhanced_measurement_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateEnhancedMeasurementSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateEnhancedMeasurementSettings", + "async": true, + "parameters": [ + { + "name": "enhanced_measurement_settings", + "type": ".google.analytics.admin.v1alpha.EnhancedMeasurementSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1alpha.EnhancedMeasurementSettings", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateEnhancedMeasurementSettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateEnhancedMeasurementSettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConnectedSiteTag_async", + "title": "AnalyticsAdminService createConnectedSiteTag Sample", + "origin": "API_DEFINITION", + "description": " Creates a connected site tag for a Universal Analytics property. You can create a maximum of 20 connected site tags per property. Note: This API cannot be used on GA4 properties.", + "canonical": true, + "file": "analytics_admin_service.create_connected_site_tag.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateConnectedSiteTag", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateConnectedSiteTag", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "connected_site_tag", + "type": ".google.analytics.admin.v1alpha.ConnectedSiteTag" + } + ], + "resultType": ".google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateConnectedSiteTag", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateConnectedSiteTag", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConnectedSiteTag_async", + "title": "AnalyticsAdminService deleteConnectedSiteTag Sample", + "origin": "API_DEFINITION", + "description": " Deletes a connected site tag for a Universal Analytics property. Note: this has no effect on GA4 properties.", + "canonical": true, + "file": "analytics_admin_service.delete_connected_site_tag.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteConnectedSiteTag", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteConnectedSiteTag", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "tag_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteConnectedSiteTag", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteConnectedSiteTag", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConnectedSiteTags_async", + "title": "AnalyticsAdminService listConnectedSiteTags Sample", + "origin": "API_DEFINITION", + "description": " Lists the connected site tags for a Universal Analytics property. A maximum of 20 connected site tags will be returned. Note: this has no effect on GA4 property.", + "canonical": true, + "file": "analytics_admin_service.list_connected_site_tags.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConnectedSiteTags", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListConnectedSiteTags", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListConnectedSiteTags", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListConnectedSiteTags", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/src/index.ts b/owl-bot-staging/google-analytics-admin/v1alpha/src/index.ts new file mode 100644 index 00000000000..cda54573e98 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2023 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/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client.ts b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client.ts new file mode 100644 index 00000000000..af40766dcc4 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client.ts @@ -0,0 +1,11750 @@ +// Copyright 2023 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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +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}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AnalyticsAdminServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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}' + ), + accountAccessBindingPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/accessBindings/{access_binding}' + ), + accountSummaryPathTemplate: new this._gaxModule.PathTemplate( + 'accountSummaries/{account_summary}' + ), + accountUserLinkPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/userLinks/{user_link}' + ), + attributionSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/attributionSettings' + ), + audiencePathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/audiences/{audience}' + ), + bigQueryLinkPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/bigQueryLinks/{bigquery_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}' + ), + enhancedMeasurementSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/dataStreams/{data_stream}/enhancedMeasurementSettings' + ), + expandedDataSetPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/expandedDataSets/{expanded_data_set}' + ), + 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}' + ), + propertyAccessBindingPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/accessBindings/{access_binding}' + ), + propertyUserLinkPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/userLinks/{user_link}' + ), + searchAds360LinkPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/searchAds360Links/{search_ads_360_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'), + listAudiences: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'audiences'), + listSearchAds360Links: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'searchAds_360Links'), + listAccessBindings: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'accessBindings'), + listExpandedDataSets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'expandedDataSets'), + listBigQueryLinks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'bigqueryLinks') + }; + + // 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 = this._gaxModule.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', 'getAudience', 'listAudiences', 'createAudience', 'updateAudience', 'archiveAudience', 'getSearchAds360Link', 'listSearchAds360Links', 'createSearchAds360Link', 'deleteSearchAds360Link', 'updateSearchAds360Link', 'getAttributionSettings', 'updateAttributionSettings', 'runAccessReport', 'createAccessBinding', 'getAccessBinding', 'updateAccessBinding', 'deleteAccessBinding', 'listAccessBindings', 'batchCreateAccessBindings', 'batchGetAccessBindings', 'batchUpdateAccessBindings', 'batchDeleteAccessBindings', 'getExpandedDataSet', 'listExpandedDataSets', 'createExpandedDataSet', 'updateExpandedDataSet', 'deleteExpandedDataSet', 'setAutomatedGa4ConfigurationOptOut', 'fetchAutomatedGa4ConfigurationOptOut', 'getBigQueryLink', 'listBigQueryLinks', 'getEnhancedMeasurementSettings', 'updateEnhancedMeasurementSettings', 'createConnectedSiteTag', 'deleteConnectedSiteTag', 'listConnectedSiteTags']; + 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._opts.fallback + ); + + 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 {@link google.analytics.admin.v1alpha.Account | 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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' + ] = this._gaxModule.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 (for example, "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 {@link google.analytics.admin.v1alpha.Account | 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' + ] = this._gaxModule.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 Cloud 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 {@link google.analytics.admin.v1alpha.ProvisionAccountTicketResponse | 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 {@link google.analytics.admin.v1alpha.Property | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.Property | 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 a 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 {@link google.analytics.admin.v1alpha.Property | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.Property | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.UserLink | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.BatchGetUserLinksResponse | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.UserLink | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.BatchCreateUserLinksResponse | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.UserLink | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.BatchUpdateUserLinksResponse | 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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.FirebaseLink | 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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.GlobalSiteTag | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.GoogleAdsLink | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.GoogleAdsLink | 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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DataSharingSettings | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.MeasurementProtocolSecret | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.MeasurementProtocolSecret | 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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.MeasurementProtocolSecret | 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' + ] = this._gaxModule.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 through 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 {@link google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionResponse | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.GoogleSignalsSettings | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.GoogleSignalsSettings | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.ConversionEvent | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.ConversionEvent | 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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink | 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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal | 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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalResponse | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomDimension | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomDimension | 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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomDimension | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomMetric | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomMetric | 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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomMetric | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DataRetentionSettings | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DataRetentionSettings | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DataStream | 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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DataStream | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DataStream | 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getDataStream(request, options, callback); + } +/** + * Lookup for a single Audience. + * Audiences created before 2020 may not be supported. + * Default audiences will not show filter definitions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Audience to get. + * Example format: properties/1234/audiences/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 {@link google.analytics.admin.v1alpha.Audience | Audience}. + * 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_audience.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAudience_async + */ + getAudience( + request?: protos.google.analytics.admin.v1alpha.IGetAudienceRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.IGetAudienceRequest|undefined, {}|undefined + ]>; + getAudience( + request: protos.google.analytics.admin.v1alpha.IGetAudienceRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.IGetAudienceRequest|null|undefined, + {}|null|undefined>): void; + getAudience( + request: protos.google.analytics.admin.v1alpha.IGetAudienceRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.IGetAudienceRequest|null|undefined, + {}|null|undefined>): void; + getAudience( + request?: protos.google.analytics.admin.v1alpha.IGetAudienceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.IGetAudienceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.IGetAudienceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.IGetAudienceRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getAudience(request, options, callback); + } +/** + * Creates an Audience. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {google.analytics.admin.v1alpha.Audience} request.audience + * Required. The audience 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 {@link google.analytics.admin.v1alpha.Audience | Audience}. + * 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_audience.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAudience_async + */ + createAudience( + request?: protos.google.analytics.admin.v1alpha.ICreateAudienceRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.ICreateAudienceRequest|undefined, {}|undefined + ]>; + createAudience( + request: protos.google.analytics.admin.v1alpha.ICreateAudienceRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.ICreateAudienceRequest|null|undefined, + {}|null|undefined>): void; + createAudience( + request: protos.google.analytics.admin.v1alpha.ICreateAudienceRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.ICreateAudienceRequest|null|undefined, + {}|null|undefined>): void; + createAudience( + request?: protos.google.analytics.admin.v1alpha.ICreateAudienceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.ICreateAudienceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.ICreateAudienceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.ICreateAudienceRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createAudience(request, options, callback); + } +/** + * Updates an Audience on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.Audience} request.audience + * Required. The audience to update. + * The audience's `name` field is used to identify the audience 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 {@link google.analytics.admin.v1alpha.Audience | Audience}. + * 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_audience.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAudience_async + */ + updateAudience( + request?: protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest|undefined, {}|undefined + ]>; + updateAudience( + request: protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest|null|undefined, + {}|null|undefined>): void; + updateAudience( + request: protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest|null|undefined, + {}|null|undefined>): void; + updateAudience( + request?: protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'audience.name': request.audience!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateAudience(request, options, callback); + } +/** + * Archives an Audience on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Example format: properties/1234/audiences/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 {@link google.protobuf.Empty | 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_audience.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveAudience_async + */ + archiveAudience( + request?: protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest|undefined, {}|undefined + ]>; + archiveAudience( + request: protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest|null|undefined, + {}|null|undefined>): void; + archiveAudience( + request: protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest|null|undefined, + {}|null|undefined>): void; + archiveAudience( + request?: protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.archiveAudience(request, options, callback); + } +/** + * Look up a single SearchAds360Link + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the SearchAds360Link to get. + * Example format: properties/1234/SearchAds360Link/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 {@link google.analytics.admin.v1alpha.SearchAds360Link | SearchAds360Link}. + * 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_search_ads360_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetSearchAds360Link_async + */ + getSearchAds360Link( + request?: protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest|undefined, {}|undefined + ]>; + getSearchAds360Link( + request: protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest|null|undefined, + {}|null|undefined>): void; + getSearchAds360Link( + request: protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest|null|undefined, + {}|null|undefined>): void; + getSearchAds360Link( + request?: protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getSearchAds360Link(request, options, callback); + } +/** + * Creates a SearchAds360Link. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {google.analytics.admin.v1alpha.SearchAds360Link} request.searchAds_360Link + * Required. The SearchAds360Link 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 {@link google.analytics.admin.v1alpha.SearchAds360Link | SearchAds360Link}. + * 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_search_ads360_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateSearchAds360Link_async + */ + createSearchAds360Link( + request?: protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest|undefined, {}|undefined + ]>; + createSearchAds360Link( + request: protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest|null|undefined, + {}|null|undefined>): void; + createSearchAds360Link( + request: protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest|null|undefined, + {}|null|undefined>): void; + createSearchAds360Link( + request?: protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createSearchAds360Link(request, options, callback); + } +/** + * Deletes a SearchAds360Link on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the SearchAds360Link to delete. + * Example format: properties/1234/SearchAds360Links/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 {@link google.protobuf.Empty | 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_search_ads360_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteSearchAds360Link_async + */ + deleteSearchAds360Link( + request?: protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest|undefined, {}|undefined + ]>; + deleteSearchAds360Link( + request: protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest|null|undefined, + {}|null|undefined>): void; + deleteSearchAds360Link( + request: protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest|null|undefined, + {}|null|undefined>): void; + deleteSearchAds360Link( + request?: protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteSearchAds360Link(request, options, callback); + } +/** + * Updates a SearchAds360Link on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.SearchAds360Link} request.searchAds_360Link + * The SearchAds360Link 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 {@link google.analytics.admin.v1alpha.SearchAds360Link | SearchAds360Link}. + * 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_search_ads360_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateSearchAds360Link_async + */ + updateSearchAds360Link( + request?: protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest|undefined, {}|undefined + ]>; + updateSearchAds360Link( + request: protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest|null|undefined, + {}|null|undefined>): void; + updateSearchAds360Link( + request: protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest|null|undefined, + {}|null|undefined>): void; + updateSearchAds360Link( + request?: protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'search_ads_360_link.name': request.searchAds_360Link!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSearchAds360Link(request, options, callback); + } +/** + * Lookup for a AttributionSettings singleton. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the attribution settings to retrieve. + * Format: properties/{property}/attributionSettings + * @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 {@link google.analytics.admin.v1alpha.AttributionSettings | AttributionSettings}. + * 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_attribution_settings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAttributionSettings_async + */ + getAttributionSettings( + request?: protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAttributionSettings, + protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest|undefined, {}|undefined + ]>; + getAttributionSettings( + request: protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAttributionSettings, + protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest|null|undefined, + {}|null|undefined>): void; + getAttributionSettings( + request: protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAttributionSettings, + protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest|null|undefined, + {}|null|undefined>): void; + getAttributionSettings( + request?: protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IAttributionSettings, + protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IAttributionSettings, + protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAttributionSettings, + protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getAttributionSettings(request, options, callback); + } +/** + * Updates attribution settings on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.AttributionSettings} request.attributionSettings + * Required. The attribution 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 {@link google.analytics.admin.v1alpha.AttributionSettings | AttributionSettings}. + * 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_attribution_settings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAttributionSettings_async + */ + updateAttributionSettings( + request?: protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAttributionSettings, + protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest|undefined, {}|undefined + ]>; + updateAttributionSettings( + request: protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAttributionSettings, + protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest|null|undefined, + {}|null|undefined>): void; + updateAttributionSettings( + request: protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAttributionSettings, + protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest|null|undefined, + {}|null|undefined>): void; + updateAttributionSettings( + request?: protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IAttributionSettings, + protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IAttributionSettings, + protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAttributionSettings, + protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'attribution_settings.name': request.attributionSettings!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateAttributionSettings(request, options, callback); + } +/** + * Returns a customized report of data access records. The report provides + * records of each time a user reads Google Analytics reporting data. Access + * records are retained for up to 2 years. + * + * Data Access Reports can be requested for a property. The property must be + * in Google Analytics 360. This method is only available to Administrators. + * + * These data access records include GA4 UI Reporting, GA4 UI Explorations, + * GA4 Data API, and other products like Firebase & Admob that can retrieve + * data from Google Analytics through a linkage. These records don't include + * property configuration changes like adding a stream or changing a + * property's time zone. For configuration change history, see + * [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.entity + * The Data Access Report supports requesting at the property level or account + * level. If requested at the account level, Data Access Reports include all + * access for all properties under that account. + * + * To request at the property level, entity should be for example + * 'properties/123' if "123" is your GA4 property ID. To request at the + * account level, entity should be for example 'accounts/1234' if "1234" is + * your GA4 Account ID. + * @param {number[]} request.dimensions + * The dimensions requested and displayed in the response. Requests are + * allowed up to 9 dimensions. + * @param {number[]} request.metrics + * The metrics requested and displayed in the response. Requests are allowed + * up to 10 metrics. + * @param {number[]} request.dateRanges + * Date ranges of access records to read. If multiple date ranges are + * requested, each response row will contain a zero based date range index. If + * two date ranges overlap, the access records for the overlapping days is + * included in the response rows for both date ranges. Requests are allowed up + * to 2 date ranges. + * @param {google.analytics.admin.v1alpha.AccessFilterExpression} request.dimensionFilter + * Dimension filters let you restrict report response to specific + * dimension values which match the filter. For example, filtering on access + * records of a single user. To learn more, see [Fundamentals of Dimension + * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + * @param {google.analytics.admin.v1alpha.AccessFilterExpression} request.metricFilter + * Metric filters allow you to restrict report response to specific metric + * values which match the filter. Metric filters are applied after aggregating + * the report's rows, similar to SQL having-clause. Dimensions cannot be used + * in this filter. + * @param {number} request.offset + * The row count of the start row. The first row is counted as row 0. If + * offset is unspecified, it is treated as 0. If offset is zero, then this + * method will return the first page of results with `limit` entries. + * + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * @param {number} request.limit + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * + * The API may return fewer rows than the requested `limit`, if there aren't + * as many remaining rows as the `limit`. For instance, there are fewer than + * 300 possible values for the dimension `country`, so when reporting on only + * `country`, you can't get more than 300 rows, even if you set `limit` to a + * higher value. + * + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * @param {string} request.timeZone + * This request's time zone if specified. If unspecified, the property's time + * zone is used. The request's time zone is used to interpret the start & end + * dates of the report. + * + * Formatted as strings from the IANA Time Zone database + * (https://www.iana.org/time-zones); for example "America/New_York" or + * "Asia/Tokyo". + * @param {number[]} request.orderBys + * Specifies how rows are ordered in the response. + * @param {boolean} request.returnEntityQuota + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in [AccessQuota](#AccessQuota). For account-level + * requests, this field must be false. + * @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 {@link google.analytics.admin.v1alpha.RunAccessReportResponse | RunAccessReportResponse}. + * 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.run_access_report.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_RunAccessReport_async + */ + runAccessReport( + request?: protos.google.analytics.admin.v1alpha.IRunAccessReportRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IRunAccessReportResponse, + protos.google.analytics.admin.v1alpha.IRunAccessReportRequest|undefined, {}|undefined + ]>; + runAccessReport( + request: protos.google.analytics.admin.v1alpha.IRunAccessReportRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IRunAccessReportResponse, + protos.google.analytics.admin.v1alpha.IRunAccessReportRequest|null|undefined, + {}|null|undefined>): void; + runAccessReport( + request: protos.google.analytics.admin.v1alpha.IRunAccessReportRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IRunAccessReportResponse, + protos.google.analytics.admin.v1alpha.IRunAccessReportRequest|null|undefined, + {}|null|undefined>): void; + runAccessReport( + request?: protos.google.analytics.admin.v1alpha.IRunAccessReportRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IRunAccessReportResponse, + protos.google.analytics.admin.v1alpha.IRunAccessReportRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IRunAccessReportResponse, + protos.google.analytics.admin.v1alpha.IRunAccessReportRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IRunAccessReportResponse, + protos.google.analytics.admin.v1alpha.IRunAccessReportRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'entity': request.entity ?? '', + }); + this.initialize(); + return this.innerApiCalls.runAccessReport(request, options, callback); + } +/** + * Creates an access binding on an account or property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Formats: + * - accounts/{account} + * - properties/{property} + * @param {google.analytics.admin.v1alpha.AccessBinding} request.accessBinding + * Required. The access binding 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 {@link google.analytics.admin.v1alpha.AccessBinding | AccessBinding}. + * 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_access_binding.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAccessBinding_async + */ + createAccessBinding( + request?: protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest|undefined, {}|undefined + ]>; + createAccessBinding( + request: protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest|null|undefined, + {}|null|undefined>): void; + createAccessBinding( + request: protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest|null|undefined, + {}|null|undefined>): void; + createAccessBinding( + request?: protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createAccessBinding(request, options, callback); + } +/** + * Gets information about an access binding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the access binding to retrieve. + * Formats: + * - accounts/{account}/accessBindings/{accessBinding} + * - properties/{property}/accessBindings/{accessBinding} + * @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 {@link google.analytics.admin.v1alpha.AccessBinding | AccessBinding}. + * 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_access_binding.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccessBinding_async + */ + getAccessBinding( + request?: protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest|undefined, {}|undefined + ]>; + getAccessBinding( + request: protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest|null|undefined, + {}|null|undefined>): void; + getAccessBinding( + request: protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest|null|undefined, + {}|null|undefined>): void; + getAccessBinding( + request?: protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getAccessBinding(request, options, callback); + } +/** + * Updates an access binding on an account or property. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.AccessBinding} request.accessBinding + * Required. The access binding 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 {@link google.analytics.admin.v1alpha.AccessBinding | AccessBinding}. + * 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_access_binding.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccessBinding_async + */ + updateAccessBinding( + request?: protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest|undefined, {}|undefined + ]>; + updateAccessBinding( + request: protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest|null|undefined, + {}|null|undefined>): void; + updateAccessBinding( + request: protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest|null|undefined, + {}|null|undefined>): void; + updateAccessBinding( + request?: protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccessBinding, + protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'access_binding.name': request.accessBinding!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateAccessBinding(request, options, callback); + } +/** + * Deletes an access binding on an account or property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Formats: + * - accounts/{account}/accessBindings/{accessBinding} + * - properties/{property}/accessBindings/{accessBinding} + * @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 {@link google.protobuf.Empty | 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_access_binding.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccessBinding_async + */ + deleteAccessBinding( + request?: protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest|undefined, {}|undefined + ]>; + deleteAccessBinding( + request: protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest|null|undefined, + {}|null|undefined>): void; + deleteAccessBinding( + request: protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest|null|undefined, + {}|null|undefined>): void; + deleteAccessBinding( + request?: protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteAccessBinding(request, options, callback); + } +/** + * Creates information about multiple access bindings to an account or + * property. + * + * This method is transactional. If any AccessBinding cannot be created, none + * of the AccessBindings will be created. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account or property that owns the access bindings. The parent + * field in the CreateAccessBindingRequest messages must either be empty or + * match this field. Formats: + * - accounts/{account} + * - properties/{property} + * @param {number[]} request.requests + * Required. The requests specifying the access bindings to create. + * A maximum of 1000 access bindings 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 {@link google.analytics.admin.v1alpha.BatchCreateAccessBindingsResponse | BatchCreateAccessBindingsResponse}. + * 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_access_bindings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateAccessBindings_async + */ + batchCreateAccessBindings( + request?: protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest|undefined, {}|undefined + ]>; + batchCreateAccessBindings( + request: protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest|null|undefined, + {}|null|undefined>): void; + batchCreateAccessBindings( + request: protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest|null|undefined, + {}|null|undefined>): void; + batchCreateAccessBindings( + request?: protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchCreateAccessBindings(request, options, callback); + } +/** + * Gets information about multiple access bindings 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 owns the access bindings. The parent + * of all provided values for the 'names' field must match this field. + * Formats: + * - accounts/{account} + * - properties/{property} + * @param {string[]} request.names + * Required. The names of the access bindings to retrieve. + * A maximum of 1000 access bindings can be retrieved in a batch. + * Formats: + * - accounts/{account}/accessBindings/{accessBinding} + * - properties/{property}/accessBindings/{accessBinding} + * @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 {@link google.analytics.admin.v1alpha.BatchGetAccessBindingsResponse | BatchGetAccessBindingsResponse}. + * 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_access_bindings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetAccessBindings_async + */ + batchGetAccessBindings( + request?: protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest|undefined, {}|undefined + ]>; + batchGetAccessBindings( + request: protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest|null|undefined, + {}|null|undefined>): void; + batchGetAccessBindings( + request: protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest|null|undefined, + {}|null|undefined>): void; + batchGetAccessBindings( + request?: protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchGetAccessBindings(request, options, callback); + } +/** + * Updates information about multiple access bindings 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 owns the access bindings. The parent + * of all provided AccessBinding in UpdateAccessBindingRequest messages must + * match this field. + * Formats: + * - accounts/{account} + * - properties/{property} + * @param {number[]} request.requests + * Required. The requests specifying the access bindings to update. + * A maximum of 1000 access bindings 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 {@link google.analytics.admin.v1alpha.BatchUpdateAccessBindingsResponse | BatchUpdateAccessBindingsResponse}. + * 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_access_bindings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateAccessBindings_async + */ + batchUpdateAccessBindings( + request?: protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest|undefined, {}|undefined + ]>; + batchUpdateAccessBindings( + request: protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest|null|undefined, + {}|null|undefined>): void; + batchUpdateAccessBindings( + request: protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest|null|undefined, + {}|null|undefined>): void; + batchUpdateAccessBindings( + request?: protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse, + protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchUpdateAccessBindings(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 owns the access bindings. The parent + * of all provided values for the 'names' field in DeleteAccessBindingRequest + * messages must match this field. Formats: + * - accounts/{account} + * - properties/{property} + * @param {number[]} request.requests + * Required. The requests specifying the access bindings to delete. + * A maximum of 1000 access bindings can be deleted 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 {@link google.protobuf.Empty | 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_access_bindings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteAccessBindings_async + */ + batchDeleteAccessBindings( + request?: protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest|undefined, {}|undefined + ]>; + batchDeleteAccessBindings( + request: protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest|null|undefined, + {}|null|undefined>): void; + batchDeleteAccessBindings( + request: protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest|null|undefined, + {}|null|undefined>): void; + batchDeleteAccessBindings( + request?: protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchDeleteAccessBindings(request, options, callback); + } +/** + * Lookup for a single ExpandedDataSet. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Audience to get. + * Example format: properties/1234/expandedDataSets/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 {@link google.analytics.admin.v1alpha.ExpandedDataSet | ExpandedDataSet}. + * 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_expanded_data_set.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetExpandedDataSet_async + */ + getExpandedDataSet( + request?: protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest|undefined, {}|undefined + ]>; + getExpandedDataSet( + request: protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest|null|undefined, + {}|null|undefined>): void; + getExpandedDataSet( + request: protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest|null|undefined, + {}|null|undefined>): void; + getExpandedDataSet( + request?: protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getExpandedDataSet(request, options, callback); + } +/** + * Creates a ExpandedDataSet. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example format: properties/1234 + * @param {google.analytics.admin.v1alpha.ExpandedDataSet} request.expandedDataSet + * Required. The ExpandedDataSet 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 {@link google.analytics.admin.v1alpha.ExpandedDataSet | ExpandedDataSet}. + * 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_expanded_data_set.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateExpandedDataSet_async + */ + createExpandedDataSet( + request?: protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest|undefined, {}|undefined + ]>; + createExpandedDataSet( + request: protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest|null|undefined, + {}|null|undefined>): void; + createExpandedDataSet( + request: protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest|null|undefined, + {}|null|undefined>): void; + createExpandedDataSet( + request?: protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createExpandedDataSet(request, options, callback); + } +/** + * Updates a ExpandedDataSet on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.ExpandedDataSet} request.expandedDataSet + * Required. The ExpandedDataSet to update. + * The resource's `name` field is used to identify the ExpandedDataSet 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 {@link google.analytics.admin.v1alpha.ExpandedDataSet | ExpandedDataSet}. + * 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_expanded_data_set.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateExpandedDataSet_async + */ + updateExpandedDataSet( + request?: protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest|undefined, {}|undefined + ]>; + updateExpandedDataSet( + request: protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest|null|undefined, + {}|null|undefined>): void; + updateExpandedDataSet( + request: protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest|null|undefined, + {}|null|undefined>): void; + updateExpandedDataSet( + request?: protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'expanded_data_set.name': request.expandedDataSet!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateExpandedDataSet(request, options, callback); + } +/** + * Deletes a ExpandedDataSet on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Example format: properties/1234/expandedDataSets/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 {@link google.protobuf.Empty | 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_expanded_data_set.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteExpandedDataSet_async + */ + deleteExpandedDataSet( + request?: protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest|undefined, {}|undefined + ]>; + deleteExpandedDataSet( + request: protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest|null|undefined, + {}|null|undefined>): void; + deleteExpandedDataSet( + request: protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest|null|undefined, + {}|null|undefined>): void; + deleteExpandedDataSet( + request?: protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteExpandedDataSet(request, options, callback); + } +/** + * Sets the opt out status for the automated GA4 setup process for a UA + * property. + * Note: this has no effect on GA4 property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * Required. The UA property to set the opt out status. Note this request uses + * the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. + * Format: properties/{internalWebPropertyId} + * Example: properties/1234 + * @param {boolean} request.optOut + * The status to set. + * @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 {@link google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse | SetAutomatedGa4ConfigurationOptOutResponse}. + * 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.set_automated_ga4_configuration_opt_out.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_SetAutomatedGa4ConfigurationOptOut_async + */ + setAutomatedGa4ConfigurationOptOut( + request?: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, + protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|undefined, {}|undefined + ]>; + setAutomatedGa4ConfigurationOptOut( + request: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, + protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|null|undefined, + {}|null|undefined>): void; + setAutomatedGa4ConfigurationOptOut( + request: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, + protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|null|undefined, + {}|null|undefined>): void; + setAutomatedGa4ConfigurationOptOut( + request?: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, + protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, + protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, + protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|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.setAutomatedGa4ConfigurationOptOut(request, options, callback); + } +/** + * Fetches the opt out status for the automated GA4 setup process for a UA + * property. + * Note: this has no effect on GA4 property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * Required. The UA property to get the opt out status. Note this request uses + * the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. + * Format: properties/{internalWebPropertyId} + * Example: properties/1234 + * @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 {@link google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse | FetchAutomatedGa4ConfigurationOptOutResponse}. + * 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.fetch_automated_ga4_configuration_opt_out.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_FetchAutomatedGa4ConfigurationOptOut_async + */ + fetchAutomatedGa4ConfigurationOptOut( + request?: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, + protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|undefined, {}|undefined + ]>; + fetchAutomatedGa4ConfigurationOptOut( + request: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, + protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|null|undefined, + {}|null|undefined>): void; + fetchAutomatedGa4ConfigurationOptOut( + request: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, + protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|null|undefined, + {}|null|undefined>): void; + fetchAutomatedGa4ConfigurationOptOut( + request?: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, + protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, + protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, + protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|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.fetchAutomatedGa4ConfigurationOptOut(request, options, callback); + } +/** + * Lookup for a single BigQuery Link. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the BigQuery link to lookup. + * Format: properties/{property_id}/bigQueryLinks/{bigquery_link_id} + * Example: properties/123/bigQueryLinks/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 {@link google.analytics.admin.v1alpha.BigQueryLink | BigQueryLink}. + * 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_big_query_link.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetBigQueryLink_async + */ + getBigQueryLink( + request?: protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IBigQueryLink, + protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest|undefined, {}|undefined + ]>; + getBigQueryLink( + request: protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IBigQueryLink, + protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest|null|undefined, + {}|null|undefined>): void; + getBigQueryLink( + request: protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IBigQueryLink, + protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest|null|undefined, + {}|null|undefined>): void; + getBigQueryLink( + request?: protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IBigQueryLink, + protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IBigQueryLink, + protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IBigQueryLink, + protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getBigQueryLink(request, options, callback); + } +/** + * Returns the enhanced measurement settings for this data stream. + * Note that the stream must enable enhanced measurement for these settings to + * take effect. + * + * @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}/dataStreams/{data_stream}/enhancedMeasurementSettings + * Example: "properties/1000/dataStreams/2000/enhancedMeasurementSettings" + * @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 {@link google.analytics.admin.v1alpha.EnhancedMeasurementSettings | EnhancedMeasurementSettings}. + * 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_enhanced_measurement_settings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetEnhancedMeasurementSettings_async + */ + getEnhancedMeasurementSettings( + request?: protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest|undefined, {}|undefined + ]>; + getEnhancedMeasurementSettings( + request: protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest|null|undefined, + {}|null|undefined>): void; + getEnhancedMeasurementSettings( + request: protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest|null|undefined, + {}|null|undefined>): void; + getEnhancedMeasurementSettings( + request?: protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getEnhancedMeasurementSettings(request, options, callback); + } +/** + * Updates the enhanced measurement settings for this data stream. + * Note that the stream must enable enhanced measurement for these settings to + * take effect. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.analytics.admin.v1alpha.EnhancedMeasurementSettings} request.enhancedMeasurementSettings + * 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 {@link google.analytics.admin.v1alpha.EnhancedMeasurementSettings | EnhancedMeasurementSettings}. + * 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_enhanced_measurement_settings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateEnhancedMeasurementSettings_async + */ + updateEnhancedMeasurementSettings( + request?: protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest|undefined, {}|undefined + ]>; + updateEnhancedMeasurementSettings( + request: protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest|null|undefined, + {}|null|undefined>): void; + updateEnhancedMeasurementSettings( + request: protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest|null|undefined, + {}|null|undefined>): void; + updateEnhancedMeasurementSettings( + request?: protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'enhanced_measurement_settings.name': request.enhancedMeasurementSettings!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateEnhancedMeasurementSettings(request, options, callback); + } +/** + * Creates a connected site tag for a Universal Analytics property. You can + * create a maximum of 20 connected site tags per property. + * Note: This API cannot be used on GA4 properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * The Universal Analytics property to create connected site tags for. + * This API does not support GA4 properties. + * Format: properties/{universalAnalyticsPropertyId} + * Example: properties/1234 + * @param {google.analytics.admin.v1alpha.ConnectedSiteTag} request.connectedSiteTag + * Required. The tag to add to the Universal Analytics 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 {@link google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse | CreateConnectedSiteTagResponse}. + * 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_connected_site_tag.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConnectedSiteTag_async + */ + createConnectedSiteTag( + request?: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, + protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|undefined, {}|undefined + ]>; + createConnectedSiteTag( + request: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, + protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|null|undefined, + {}|null|undefined>): void; + createConnectedSiteTag( + request: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, + protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|null|undefined, + {}|null|undefined>): void; + createConnectedSiteTag( + request?: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, + protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, + protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, + protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|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.createConnectedSiteTag(request, options, callback); + } +/** + * Deletes a connected site tag for a Universal Analytics property. + * Note: this has no effect on GA4 properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * The Universal Analytics property to delete connected site tags for. + * This API does not support GA4 properties. + * Format: properties/{universalAnalyticsPropertyId} + * Example: properties/1234 + * @param {string} request.tagId + * Tag ID to forward events to. Also known as the Measurement ID, or the + * "G-ID" (For example: G-12345). + * @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 {@link google.protobuf.Empty | 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_connected_site_tag.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConnectedSiteTag_async + */ + deleteConnectedSiteTag( + request?: protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|undefined, {}|undefined + ]>; + deleteConnectedSiteTag( + request: protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|null|undefined, + {}|null|undefined>): void; + deleteConnectedSiteTag( + request: protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|null|undefined, + {}|null|undefined>): void; + deleteConnectedSiteTag( + request?: protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|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.deleteConnectedSiteTag(request, options, callback); + } +/** + * Lists the connected site tags for a Universal Analytics property. A maximum + * of 20 connected site tags will be returned. Note: this has no effect on GA4 + * property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * The Universal Analytics property to fetch connected site tags for. + * This does not work on GA4 properties. A maximum of 20 connected site tags + * will be returned. + * Example Format: `properties/1234` + * @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 {@link google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse | ListConnectedSiteTagsResponse}. + * 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.list_connected_site_tags.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConnectedSiteTags_async + */ + listConnectedSiteTags( + request?: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, + protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|undefined, {}|undefined + ]>; + listConnectedSiteTags( + request: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, + protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|null|undefined, + {}|null|undefined>): void; + listConnectedSiteTags( + request: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, + protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|null|undefined, + {}|null|undefined>): void; + listConnectedSiteTags( + request?: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, + protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, + protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, + protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|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.listConnectedSiteTags(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 {@link google.analytics.admin.v1alpha.Account | 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 {@link google.analytics.admin.v1alpha.Account | 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 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 + * {@link google.analytics.admin.v1alpha.Account | 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 {}, + 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 {@link google.analytics.admin.v1alpha.AccountSummary | 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 {@link google.analytics.admin.v1alpha.AccountSummary | 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 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 + * {@link google.analytics.admin.v1alpha.AccountSummary | 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 {}, + 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 {@link google.analytics.admin.v1alpha.Property | 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 {@link google.analytics.admin.v1alpha.Property | 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 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 + * {@link google.analytics.admin.v1alpha.Property | 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 {}, + 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 {@link google.analytics.admin.v1alpha.UserLink | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.UserLink | 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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1alpha.UserLink | 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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1alpha.AuditUserLink | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.AuditUserLink | 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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1alpha.AuditUserLink | 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' + ] = this._gaxModule.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 {}, + 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 `ListFirebaseLinks` 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 {@link google.analytics.admin.v1alpha.FirebaseLink | 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' + ] = this._gaxModule.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 `ListFirebaseLinks` 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 {@link google.analytics.admin.v1alpha.FirebaseLink | 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' + ] = this._gaxModule.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 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 `ListFirebaseLinks` 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 + * {@link google.analytics.admin.v1alpha.FirebaseLink | 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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1alpha.GoogleAdsLink | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.GoogleAdsLink | 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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1alpha.GoogleAdsLink | 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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1alpha.MeasurementProtocolSecret | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.MeasurementProtocolSecret | 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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1alpha.MeasurementProtocolSecret | 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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1alpha.ChangeHistoryEvent | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.ChangeHistoryEvent | 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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1alpha.ChangeHistoryEvent | 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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1alpha.ConversionEvent | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.ConversionEvent | 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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1alpha.ConversionEvent | 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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink | 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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink | 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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal | 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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal | 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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1alpha.CustomDimension | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomDimension | 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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1alpha.CustomDimension | 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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1alpha.CustomMetric | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomMetric | 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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1alpha.CustomMetric | 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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1alpha.DataStream | 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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DataStream | 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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1alpha.DataStream | 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Audiences on a property. + * Audiences created before 2020 may not be supported. + * Default audiences will not show filter definitions. + * + * @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 `ListAudiences` call. Provide this + * to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAudiences` 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 {@link google.analytics.admin.v1alpha.Audience | Audience}. + * 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 `listAudiencesAsync()` + * 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. + */ + listAudiences( + request?: protos.google.analytics.admin.v1alpha.IListAudiencesRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAudience[], + protos.google.analytics.admin.v1alpha.IListAudiencesRequest|null, + protos.google.analytics.admin.v1alpha.IListAudiencesResponse + ]>; + listAudiences( + request: protos.google.analytics.admin.v1alpha.IListAudiencesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAudiencesRequest, + protos.google.analytics.admin.v1alpha.IListAudiencesResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAudience>): void; + listAudiences( + request: protos.google.analytics.admin.v1alpha.IListAudiencesRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAudiencesRequest, + protos.google.analytics.admin.v1alpha.IListAudiencesResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAudience>): void; + listAudiences( + request?: protos.google.analytics.admin.v1alpha.IListAudiencesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAudiencesRequest, + protos.google.analytics.admin.v1alpha.IListAudiencesResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAudience>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAudiencesRequest, + protos.google.analytics.admin.v1alpha.IListAudiencesResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAudience>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAudience[], + protos.google.analytics.admin.v1alpha.IListAudiencesRequest|null, + protos.google.analytics.admin.v1alpha.IListAudiencesResponse + ]>|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listAudiences(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 `ListAudiences` call. Provide this + * to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAudiences` 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 {@link google.analytics.admin.v1alpha.Audience | Audience} 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 `listAudiencesAsync()` + * 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. + */ + listAudiencesStream( + request?: protos.google.analytics.admin.v1alpha.IListAudiencesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAudiences']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAudiences.createStream( + this.innerApiCalls.listAudiences as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAudiences`, 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 `ListAudiences` call. Provide this + * to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAudiences` 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 + * {@link google.analytics.admin.v1alpha.Audience | Audience}. 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_audiences.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAudiences_async + */ + listAudiencesAsync( + request?: protos.google.analytics.admin.v1alpha.IListAudiencesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAudiences']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAudiences.asyncIterate( + this.innerApiCalls['listAudiences'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all SearchAds360Links 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 `ListSearchAds360Links` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListSearchAds360Links` 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 {@link google.analytics.admin.v1alpha.SearchAds360Link | SearchAds360Link}. + * 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 `listSearchAds360LinksAsync()` + * 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. + */ + listSearchAds360Links( + request?: protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.ISearchAds360Link[], + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest|null, + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksResponse + ]>; + listSearchAds360Links( + request: protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.ISearchAds360Link>): void; + listSearchAds360Links( + request: protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.ISearchAds360Link>): void; + listSearchAds360Links( + request?: protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.ISearchAds360Link>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.ISearchAds360Link>): + Promise<[ + protos.google.analytics.admin.v1alpha.ISearchAds360Link[], + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest|null, + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksResponse + ]>|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSearchAds360Links(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 `ListSearchAds360Links` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListSearchAds360Links` 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 {@link google.analytics.admin.v1alpha.SearchAds360Link | SearchAds360Link} 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 `listSearchAds360LinksAsync()` + * 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. + */ + listSearchAds360LinksStream( + request?: protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSearchAds360Links']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSearchAds360Links.createStream( + this.innerApiCalls.listSearchAds360Links as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSearchAds360Links`, 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 `ListSearchAds360Links` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListSearchAds360Links` 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 + * {@link google.analytics.admin.v1alpha.SearchAds360Link | SearchAds360Link}. 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_search_ads360_links.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListSearchAds360Links_async + */ + listSearchAds360LinksAsync( + request?: protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSearchAds360Links']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSearchAds360Links.asyncIterate( + this.innerApiCalls['listSearchAds360Links'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all access bindings on an account or property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Formats: + * - accounts/{account} + * - properties/{property} + * @param {number} request.pageSize + * The maximum number of access bindings to return. + * The service may return fewer than this value. + * If unspecified, at most 200 access bindings 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 `ListAccessBindings` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccessBindings` 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 {@link google.analytics.admin.v1alpha.AccessBinding | AccessBinding}. + * 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 `listAccessBindingsAsync()` + * 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. + */ + listAccessBindings( + request?: protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccessBinding[], + protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest|null, + protos.google.analytics.admin.v1alpha.IListAccessBindingsResponse + ]>; + listAccessBindings( + request: protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, + protos.google.analytics.admin.v1alpha.IListAccessBindingsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAccessBinding>): void; + listAccessBindings( + request: protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, + protos.google.analytics.admin.v1alpha.IListAccessBindingsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAccessBinding>): void; + listAccessBindings( + request?: protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, + protos.google.analytics.admin.v1alpha.IListAccessBindingsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAccessBinding>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, + protos.google.analytics.admin.v1alpha.IListAccessBindingsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IAccessBinding>): + Promise<[ + protos.google.analytics.admin.v1alpha.IAccessBinding[], + protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest|null, + protos.google.analytics.admin.v1alpha.IListAccessBindingsResponse + ]>|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listAccessBindings(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. Formats: + * - accounts/{account} + * - properties/{property} + * @param {number} request.pageSize + * The maximum number of access bindings to return. + * The service may return fewer than this value. + * If unspecified, at most 200 access bindings 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 `ListAccessBindings` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccessBindings` 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 {@link google.analytics.admin.v1alpha.AccessBinding | AccessBinding} 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 `listAccessBindingsAsync()` + * 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. + */ + listAccessBindingsStream( + request?: protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAccessBindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAccessBindings.createStream( + this.innerApiCalls.listAccessBindings as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAccessBindings`, 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. Formats: + * - accounts/{account} + * - properties/{property} + * @param {number} request.pageSize + * The maximum number of access bindings to return. + * The service may return fewer than this value. + * If unspecified, at most 200 access bindings 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 `ListAccessBindings` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccessBindings` 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 + * {@link google.analytics.admin.v1alpha.AccessBinding | AccessBinding}. 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_access_bindings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccessBindings_async + */ + listAccessBindingsAsync( + request?: protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAccessBindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAccessBindings.asyncIterate( + this.innerApiCalls['listAccessBindings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists ExpandedDataSets 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 `ListExpandedDataSets` call. Provide + * this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListExpandedDataSet` + * 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 {@link google.analytics.admin.v1alpha.ExpandedDataSet | ExpandedDataSet}. + * 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 `listExpandedDataSetsAsync()` + * 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. + */ + listExpandedDataSets( + request?: protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IExpandedDataSet[], + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest|null, + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsResponse + ]>; + listExpandedDataSets( + request: protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IExpandedDataSet>): void; + listExpandedDataSets( + request: protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IExpandedDataSet>): void; + listExpandedDataSets( + request?: protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IExpandedDataSet>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IExpandedDataSet>): + Promise<[ + protos.google.analytics.admin.v1alpha.IExpandedDataSet[], + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest|null, + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsResponse + ]>|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listExpandedDataSets(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 `ListExpandedDataSets` call. Provide + * this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListExpandedDataSet` + * 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 {@link google.analytics.admin.v1alpha.ExpandedDataSet | ExpandedDataSet} 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 `listExpandedDataSetsAsync()` + * 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. + */ + listExpandedDataSetsStream( + request?: protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listExpandedDataSets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listExpandedDataSets.createStream( + this.innerApiCalls.listExpandedDataSets as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listExpandedDataSets`, 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 `ListExpandedDataSets` call. Provide + * this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListExpandedDataSet` + * 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 + * {@link google.analytics.admin.v1alpha.ExpandedDataSet | ExpandedDataSet}. 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_expanded_data_sets.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListExpandedDataSets_async + */ + listExpandedDataSetsAsync( + request?: protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listExpandedDataSets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listExpandedDataSets.asyncIterate( + this.innerApiCalls['listExpandedDataSets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists BigQuery Links on a property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the property to list BigQuery links under. + * 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 `ListBigQueryLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListBigQueryLinks` 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 {@link google.analytics.admin.v1alpha.BigQueryLink | BigQueryLink}. + * 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 `listBigQueryLinksAsync()` + * 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. + */ + listBigQueryLinks( + request?: protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IBigQueryLink[], + protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest|null, + protos.google.analytics.admin.v1alpha.IListBigQueryLinksResponse + ]>; + listBigQueryLinks( + request: protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, + protos.google.analytics.admin.v1alpha.IListBigQueryLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IBigQueryLink>): void; + listBigQueryLinks( + request: protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, + protos.google.analytics.admin.v1alpha.IListBigQueryLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IBigQueryLink>): void; + listBigQueryLinks( + request?: protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, + protos.google.analytics.admin.v1alpha.IListBigQueryLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IBigQueryLink>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, + protos.google.analytics.admin.v1alpha.IListBigQueryLinksResponse|null|undefined, + protos.google.analytics.admin.v1alpha.IBigQueryLink>): + Promise<[ + protos.google.analytics.admin.v1alpha.IBigQueryLink[], + protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest|null, + protos.google.analytics.admin.v1alpha.IListBigQueryLinksResponse + ]>|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listBigQueryLinks(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 name of the property to list BigQuery links under. + * 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 `ListBigQueryLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListBigQueryLinks` 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 {@link google.analytics.admin.v1alpha.BigQueryLink | BigQueryLink} 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 `listBigQueryLinksAsync()` + * 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. + */ + listBigQueryLinksStream( + request?: protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBigQueryLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBigQueryLinks.createStream( + this.innerApiCalls.listBigQueryLinks as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBigQueryLinks`, 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 name of the property to list BigQuery links under. + * 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 `ListBigQueryLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListBigQueryLinks` 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 + * {@link google.analytics.admin.v1alpha.BigQueryLink | BigQueryLink}. 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_big_query_links.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListBigQueryLinks_async + */ + listBigQueryLinksAsync( + request?: protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBigQueryLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBigQueryLinks.asyncIterate( + this.innerApiCalls['listBigQueryLinks'] as GaxCall, + request as {}, + 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 accountAccessBinding resource name string. + * + * @param {string} account + * @param {string} access_binding + * @returns {string} Resource name string. + */ + accountAccessBindingPath(account:string,accessBinding:string) { + return this.pathTemplates.accountAccessBindingPathTemplate.render({ + account: account, + access_binding: accessBinding, + }); + } + + /** + * Parse the account from AccountAccessBinding resource. + * + * @param {string} accountAccessBindingName + * A fully-qualified path representing account_access_binding resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAccountAccessBindingName(accountAccessBindingName: string) { + return this.pathTemplates.accountAccessBindingPathTemplate.match(accountAccessBindingName).account; + } + + /** + * Parse the access_binding from AccountAccessBinding resource. + * + * @param {string} accountAccessBindingName + * A fully-qualified path representing account_access_binding resource. + * @returns {string} A string representing the access_binding. + */ + matchAccessBindingFromAccountAccessBindingName(accountAccessBindingName: string) { + return this.pathTemplates.accountAccessBindingPathTemplate.match(accountAccessBindingName).access_binding; + } + + /** + * 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 attributionSettings resource name string. + * + * @param {string} property + * @returns {string} Resource name string. + */ + attributionSettingsPath(property:string) { + return this.pathTemplates.attributionSettingsPathTemplate.render({ + property: property, + }); + } + + /** + * Parse the property from AttributionSettings resource. + * + * @param {string} attributionSettingsName + * A fully-qualified path representing AttributionSettings resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromAttributionSettingsName(attributionSettingsName: string) { + return this.pathTemplates.attributionSettingsPathTemplate.match(attributionSettingsName).property; + } + + /** + * Return a fully-qualified audience resource name string. + * + * @param {string} property + * @param {string} audience + * @returns {string} Resource name string. + */ + audiencePath(property:string,audience:string) { + return this.pathTemplates.audiencePathTemplate.render({ + property: property, + audience: audience, + }); + } + + /** + * Parse the property from Audience resource. + * + * @param {string} audienceName + * A fully-qualified path representing Audience resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromAudienceName(audienceName: string) { + return this.pathTemplates.audiencePathTemplate.match(audienceName).property; + } + + /** + * Parse the audience from Audience resource. + * + * @param {string} audienceName + * A fully-qualified path representing Audience resource. + * @returns {string} A string representing the audience. + */ + matchAudienceFromAudienceName(audienceName: string) { + return this.pathTemplates.audiencePathTemplate.match(audienceName).audience; + } + + /** + * Return a fully-qualified bigQueryLink resource name string. + * + * @param {string} property + * @param {string} bigquery_link + * @returns {string} Resource name string. + */ + bigQueryLinkPath(property:string,bigqueryLink:string) { + return this.pathTemplates.bigQueryLinkPathTemplate.render({ + property: property, + bigquery_link: bigqueryLink, + }); + } + + /** + * Parse the property from BigQueryLink resource. + * + * @param {string} bigQueryLinkName + * A fully-qualified path representing BigQueryLink resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromBigQueryLinkName(bigQueryLinkName: string) { + return this.pathTemplates.bigQueryLinkPathTemplate.match(bigQueryLinkName).property; + } + + /** + * Parse the bigquery_link from BigQueryLink resource. + * + * @param {string} bigQueryLinkName + * A fully-qualified path representing BigQueryLink resource. + * @returns {string} A string representing the bigquery_link. + */ + matchBigqueryLinkFromBigQueryLinkName(bigQueryLinkName: string) { + return this.pathTemplates.bigQueryLinkPathTemplate.match(bigQueryLinkName).bigquery_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 enhancedMeasurementSettings resource name string. + * + * @param {string} property + * @param {string} data_stream + * @returns {string} Resource name string. + */ + enhancedMeasurementSettingsPath(property:string,dataStream:string) { + return this.pathTemplates.enhancedMeasurementSettingsPathTemplate.render({ + property: property, + data_stream: dataStream, + }); + } + + /** + * Parse the property from EnhancedMeasurementSettings resource. + * + * @param {string} enhancedMeasurementSettingsName + * A fully-qualified path representing EnhancedMeasurementSettings resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromEnhancedMeasurementSettingsName(enhancedMeasurementSettingsName: string) { + return this.pathTemplates.enhancedMeasurementSettingsPathTemplate.match(enhancedMeasurementSettingsName).property; + } + + /** + * Parse the data_stream from EnhancedMeasurementSettings resource. + * + * @param {string} enhancedMeasurementSettingsName + * A fully-qualified path representing EnhancedMeasurementSettings resource. + * @returns {string} A string representing the data_stream. + */ + matchDataStreamFromEnhancedMeasurementSettingsName(enhancedMeasurementSettingsName: string) { + return this.pathTemplates.enhancedMeasurementSettingsPathTemplate.match(enhancedMeasurementSettingsName).data_stream; + } + + /** + * Return a fully-qualified expandedDataSet resource name string. + * + * @param {string} property + * @param {string} expanded_data_set + * @returns {string} Resource name string. + */ + expandedDataSetPath(property:string,expandedDataSet:string) { + return this.pathTemplates.expandedDataSetPathTemplate.render({ + property: property, + expanded_data_set: expandedDataSet, + }); + } + + /** + * Parse the property from ExpandedDataSet resource. + * + * @param {string} expandedDataSetName + * A fully-qualified path representing ExpandedDataSet resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromExpandedDataSetName(expandedDataSetName: string) { + return this.pathTemplates.expandedDataSetPathTemplate.match(expandedDataSetName).property; + } + + /** + * Parse the expanded_data_set from ExpandedDataSet resource. + * + * @param {string} expandedDataSetName + * A fully-qualified path representing ExpandedDataSet resource. + * @returns {string} A string representing the expanded_data_set. + */ + matchExpandedDataSetFromExpandedDataSetName(expandedDataSetName: string) { + return this.pathTemplates.expandedDataSetPathTemplate.match(expandedDataSetName).expanded_data_set; + } + + /** + * 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 propertyAccessBinding resource name string. + * + * @param {string} property + * @param {string} access_binding + * @returns {string} Resource name string. + */ + propertyAccessBindingPath(property:string,accessBinding:string) { + return this.pathTemplates.propertyAccessBindingPathTemplate.render({ + property: property, + access_binding: accessBinding, + }); + } + + /** + * Parse the property from PropertyAccessBinding resource. + * + * @param {string} propertyAccessBindingName + * A fully-qualified path representing property_access_binding resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromPropertyAccessBindingName(propertyAccessBindingName: string) { + return this.pathTemplates.propertyAccessBindingPathTemplate.match(propertyAccessBindingName).property; + } + + /** + * Parse the access_binding from PropertyAccessBinding resource. + * + * @param {string} propertyAccessBindingName + * A fully-qualified path representing property_access_binding resource. + * @returns {string} A string representing the access_binding. + */ + matchAccessBindingFromPropertyAccessBindingName(propertyAccessBindingName: string) { + return this.pathTemplates.propertyAccessBindingPathTemplate.match(propertyAccessBindingName).access_binding; + } + + /** + * 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; + } + + /** + * Return a fully-qualified searchAds360Link resource name string. + * + * @param {string} property + * @returns {string} Resource name string. + */ + searchAds360LinkPath(property:string) { + return this.pathTemplates.searchAds360LinkPathTemplate.render({ + property: property, + }); + } + + /** + * Parse the property from SearchAds360Link resource. + * + * @param {string} searchAds360LinkName + * A fully-qualified path representing SearchAds360Link resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromSearchAds360LinkName(searchAds360LinkName: string) { + return this.pathTemplates.searchAds360LinkPathTemplate.match(searchAds360LinkName).property; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.analyticsAdminServiceStub && !this._terminated) { + return this.analyticsAdminServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client_config.json b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client_config.json new file mode 100644 index 00000000000..ae7a81cd69a --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client_config.json @@ -0,0 +1,574 @@ +{ + "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": "non_idempotent", + "retry_params_name": "default" + }, + "ListAccounts": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAccount": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateAccount": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ProvisionAccountTicket": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAccountSummaries": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetProperty": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListProperties": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateProperty": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteProperty": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateProperty": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetUserLink": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchGetUserLinks": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListUserLinks": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AuditUserLinks": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateUserLink": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchCreateUserLinks": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateUserLink": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchUpdateUserLinks": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteUserLink": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchDeleteUserLinks": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateFirebaseLink": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteFirebaseLink": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListFirebaseLinks": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetGlobalSiteTag": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateGoogleAdsLink": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateGoogleAdsLink": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteGoogleAdsLink": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListGoogleAdsLinks": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "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" + }, + "GetAudience": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListAudiences": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateAudience": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateAudience": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ArchiveAudience": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetSearchAds360Link": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListSearchAds360Links": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateSearchAds360Link": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteSearchAds360Link": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateSearchAds360Link": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetAttributionSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateAttributionSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "RunAccessReport": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateAccessBinding": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetAccessBinding": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateAccessBinding": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteAccessBinding": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListAccessBindings": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "BatchCreateAccessBindings": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "BatchGetAccessBindings": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "BatchUpdateAccessBindings": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "BatchDeleteAccessBindings": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetExpandedDataSet": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListExpandedDataSets": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateExpandedDataSet": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateExpandedDataSet": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteExpandedDataSet": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "SetAutomatedGa4ConfigurationOptOut": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "FetchAutomatedGa4ConfigurationOptOut": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetBigQueryLink": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListBigQueryLinks": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetEnhancedMeasurementSettings": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEnhancedMeasurementSettings": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateConnectedSiteTag": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteConnectedSiteTag": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListConnectedSiteTags": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + } + } + } + } +} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_proto_list.json b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_proto_list.json new file mode 100644 index 00000000000..084ed5872e1 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_proto_list.json @@ -0,0 +1,7 @@ +[ + "../../protos/google/analytics/admin/v1alpha/access_report.proto", + "../../protos/google/analytics/admin/v1alpha/analytics_admin.proto", + "../../protos/google/analytics/admin/v1alpha/audience.proto", + "../../protos/google/analytics/admin/v1alpha/expanded_data_set.proto", + "../../protos/google/analytics/admin/v1alpha/resources.proto" +] diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/gapic_metadata.json b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/gapic_metadata.json new file mode 100644 index 00000000000..866a4731b05 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/gapic_metadata.json @@ -0,0 +1,1173 @@ +{ + "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" + ] + }, + "GetAudience": { + "methods": [ + "getAudience" + ] + }, + "CreateAudience": { + "methods": [ + "createAudience" + ] + }, + "UpdateAudience": { + "methods": [ + "updateAudience" + ] + }, + "ArchiveAudience": { + "methods": [ + "archiveAudience" + ] + }, + "GetSearchAds360Link": { + "methods": [ + "getSearchAds360Link" + ] + }, + "CreateSearchAds360Link": { + "methods": [ + "createSearchAds360Link" + ] + }, + "DeleteSearchAds360Link": { + "methods": [ + "deleteSearchAds360Link" + ] + }, + "UpdateSearchAds360Link": { + "methods": [ + "updateSearchAds360Link" + ] + }, + "GetAttributionSettings": { + "methods": [ + "getAttributionSettings" + ] + }, + "UpdateAttributionSettings": { + "methods": [ + "updateAttributionSettings" + ] + }, + "RunAccessReport": { + "methods": [ + "runAccessReport" + ] + }, + "CreateAccessBinding": { + "methods": [ + "createAccessBinding" + ] + }, + "GetAccessBinding": { + "methods": [ + "getAccessBinding" + ] + }, + "UpdateAccessBinding": { + "methods": [ + "updateAccessBinding" + ] + }, + "DeleteAccessBinding": { + "methods": [ + "deleteAccessBinding" + ] + }, + "BatchCreateAccessBindings": { + "methods": [ + "batchCreateAccessBindings" + ] + }, + "BatchGetAccessBindings": { + "methods": [ + "batchGetAccessBindings" + ] + }, + "BatchUpdateAccessBindings": { + "methods": [ + "batchUpdateAccessBindings" + ] + }, + "BatchDeleteAccessBindings": { + "methods": [ + "batchDeleteAccessBindings" + ] + }, + "GetExpandedDataSet": { + "methods": [ + "getExpandedDataSet" + ] + }, + "CreateExpandedDataSet": { + "methods": [ + "createExpandedDataSet" + ] + }, + "UpdateExpandedDataSet": { + "methods": [ + "updateExpandedDataSet" + ] + }, + "DeleteExpandedDataSet": { + "methods": [ + "deleteExpandedDataSet" + ] + }, + "SetAutomatedGa4ConfigurationOptOut": { + "methods": [ + "setAutomatedGa4ConfigurationOptOut" + ] + }, + "FetchAutomatedGa4ConfigurationOptOut": { + "methods": [ + "fetchAutomatedGa4ConfigurationOptOut" + ] + }, + "GetBigQueryLink": { + "methods": [ + "getBigQueryLink" + ] + }, + "GetEnhancedMeasurementSettings": { + "methods": [ + "getEnhancedMeasurementSettings" + ] + }, + "UpdateEnhancedMeasurementSettings": { + "methods": [ + "updateEnhancedMeasurementSettings" + ] + }, + "CreateConnectedSiteTag": { + "methods": [ + "createConnectedSiteTag" + ] + }, + "DeleteConnectedSiteTag": { + "methods": [ + "deleteConnectedSiteTag" + ] + }, + "ListConnectedSiteTags": { + "methods": [ + "listConnectedSiteTags" + ] + }, + "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" + ] + }, + "ListAudiences": { + "methods": [ + "listAudiences", + "listAudiencesStream", + "listAudiencesAsync" + ] + }, + "ListSearchAds360Links": { + "methods": [ + "listSearchAds360Links", + "listSearchAds360LinksStream", + "listSearchAds360LinksAsync" + ] + }, + "ListAccessBindings": { + "methods": [ + "listAccessBindings", + "listAccessBindingsStream", + "listAccessBindingsAsync" + ] + }, + "ListExpandedDataSets": { + "methods": [ + "listExpandedDataSets", + "listExpandedDataSetsStream", + "listExpandedDataSetsAsync" + ] + }, + "ListBigQueryLinks": { + "methods": [ + "listBigQueryLinks", + "listBigQueryLinksStream", + "listBigQueryLinksAsync" + ] + } + } + }, + "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" + ] + }, + "GetAudience": { + "methods": [ + "getAudience" + ] + }, + "CreateAudience": { + "methods": [ + "createAudience" + ] + }, + "UpdateAudience": { + "methods": [ + "updateAudience" + ] + }, + "ArchiveAudience": { + "methods": [ + "archiveAudience" + ] + }, + "GetSearchAds360Link": { + "methods": [ + "getSearchAds360Link" + ] + }, + "CreateSearchAds360Link": { + "methods": [ + "createSearchAds360Link" + ] + }, + "DeleteSearchAds360Link": { + "methods": [ + "deleteSearchAds360Link" + ] + }, + "UpdateSearchAds360Link": { + "methods": [ + "updateSearchAds360Link" + ] + }, + "GetAttributionSettings": { + "methods": [ + "getAttributionSettings" + ] + }, + "UpdateAttributionSettings": { + "methods": [ + "updateAttributionSettings" + ] + }, + "RunAccessReport": { + "methods": [ + "runAccessReport" + ] + }, + "CreateAccessBinding": { + "methods": [ + "createAccessBinding" + ] + }, + "GetAccessBinding": { + "methods": [ + "getAccessBinding" + ] + }, + "UpdateAccessBinding": { + "methods": [ + "updateAccessBinding" + ] + }, + "DeleteAccessBinding": { + "methods": [ + "deleteAccessBinding" + ] + }, + "BatchCreateAccessBindings": { + "methods": [ + "batchCreateAccessBindings" + ] + }, + "BatchGetAccessBindings": { + "methods": [ + "batchGetAccessBindings" + ] + }, + "BatchUpdateAccessBindings": { + "methods": [ + "batchUpdateAccessBindings" + ] + }, + "BatchDeleteAccessBindings": { + "methods": [ + "batchDeleteAccessBindings" + ] + }, + "GetExpandedDataSet": { + "methods": [ + "getExpandedDataSet" + ] + }, + "CreateExpandedDataSet": { + "methods": [ + "createExpandedDataSet" + ] + }, + "UpdateExpandedDataSet": { + "methods": [ + "updateExpandedDataSet" + ] + }, + "DeleteExpandedDataSet": { + "methods": [ + "deleteExpandedDataSet" + ] + }, + "SetAutomatedGa4ConfigurationOptOut": { + "methods": [ + "setAutomatedGa4ConfigurationOptOut" + ] + }, + "FetchAutomatedGa4ConfigurationOptOut": { + "methods": [ + "fetchAutomatedGa4ConfigurationOptOut" + ] + }, + "GetBigQueryLink": { + "methods": [ + "getBigQueryLink" + ] + }, + "GetEnhancedMeasurementSettings": { + "methods": [ + "getEnhancedMeasurementSettings" + ] + }, + "UpdateEnhancedMeasurementSettings": { + "methods": [ + "updateEnhancedMeasurementSettings" + ] + }, + "CreateConnectedSiteTag": { + "methods": [ + "createConnectedSiteTag" + ] + }, + "DeleteConnectedSiteTag": { + "methods": [ + "deleteConnectedSiteTag" + ] + }, + "ListConnectedSiteTags": { + "methods": [ + "listConnectedSiteTags" + ] + }, + "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" + ] + }, + "ListAudiences": { + "methods": [ + "listAudiences", + "listAudiencesStream", + "listAudiencesAsync" + ] + }, + "ListSearchAds360Links": { + "methods": [ + "listSearchAds360Links", + "listSearchAds360LinksStream", + "listSearchAds360LinksAsync" + ] + }, + "ListAccessBindings": { + "methods": [ + "listAccessBindings", + "listAccessBindingsStream", + "listAccessBindingsAsync" + ] + }, + "ListExpandedDataSets": { + "methods": [ + "listExpandedDataSets", + "listExpandedDataSetsStream", + "listExpandedDataSetsAsync" + ] + }, + "ListBigQueryLinks": { + "methods": [ + "listBigQueryLinks", + "listBigQueryLinksStream", + "listBigQueryLinksAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/index.ts b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/index.ts new file mode 100644 index 00000000000..f0f311d4088 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 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/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..de87e1ff6d4 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2023 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/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..5c5cf34906e --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2023 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/google-analytics-admin/v1alpha/system-test/install.ts b/owl-bot-staging/google-analytics-admin/v1alpha/system-test/install.ts new file mode 100644 index 00000000000..c8f81b25a86 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2023 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/google-analytics-admin/v1alpha/test/gapic_analytics_admin_service_v1alpha.ts b/owl-bot-staging/google-analytics-admin/v1alpha/test/gapic_analytics_admin_service_v1alpha.ts new file mode 100644 index 00000000000..2a9cf178cf4 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1alpha/test/gapic_analytics_admin_service_v1alpha.ts @@ -0,0 +1,15039 @@ +// Copyright 2023 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'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAccount = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAccount(request), expectedError); + const actualRequest = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccountRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAccount = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAccount(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAccount = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteAccount(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccountRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccountRequest', ['account', 'name']); + request.account.name = defaultValue1; + const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccountRequest', ['account', 'name']); + request.account.name = defaultValue1; + const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccountRequest', ['account', 'name']); + request.account.name = defaultValue1; + const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAccount = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateAccount(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccountRequest', ['account', 'name']); + request.account.name = defaultValue1; + 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 expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.ProvisionAccountTicketResponse() + ); + client.innerApiCalls.provisionAccountTicket = stubSimpleCall(expectedResponse); + const [response] = await client.provisionAccountTicket(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + 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 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); + }); + + 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 expectedError = new Error('expected'); + client.innerApiCalls.provisionAccountTicket = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.provisionAccountTicket(request), expectedError); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetPropertyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetPropertyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetPropertyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProperty = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getProperty(request), expectedError); + const actualRequest = (client.innerApiCalls.getProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetPropertyRequest', ['name']); + request.name = defaultValue1; + 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 expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.Property() + ); + client.innerApiCalls.createProperty = stubSimpleCall(expectedResponse); + const [response] = await client.createProperty(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + 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 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); + }); + + 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 expectedError = new Error('expected'); + client.innerApiCalls.createProperty = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createProperty(request), expectedError); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeletePropertyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeletePropertyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeletePropertyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProperty = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteProperty(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeletePropertyRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdatePropertyRequest', ['property', 'name']); + request.property.name = defaultValue1; + const expectedHeaderRequestParams = `property.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdatePropertyRequest', ['property', 'name']); + request.property.name = defaultValue1; + const expectedHeaderRequestParams = `property.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdatePropertyRequest', ['property', 'name']); + request.property.name = defaultValue1; + const expectedHeaderRequestParams = `property.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateProperty = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateProperty(request), expectedError); + const actualRequest = (client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdatePropertyRequest', ['property', 'name']); + request.property.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetUserLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getUserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetUserLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getUserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetUserLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getUserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getUserLink(request), expectedError); + const actualRequest = (client.innerApiCalls.getUserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetUserLinkRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchGetUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchGetUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchGetUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchGetUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchGetUserLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchGetUserLinks(request), expectedError); + const actualRequest = (client.innerApiCalls.batchGetUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchGetUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetUserLinksRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateUserLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createUserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateUserLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createUserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateUserLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createUserLink(request), expectedError); + const actualRequest = (client.innerApiCalls.createUserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateUserLinkRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchCreateUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchCreateUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateUserLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchCreateUserLinks(request), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest', ['parent']); + request.parent = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateUserLinkRequest', ['userLink', 'name']); + request.userLink.name = defaultValue1; + const expectedHeaderRequestParams = `user_link.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateUserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateUserLinkRequest', ['userLink', 'name']); + request.userLink.name = defaultValue1; + const expectedHeaderRequestParams = `user_link.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateUserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateUserLinkRequest', ['userLink', 'name']); + request.userLink.name = defaultValue1; + const expectedHeaderRequestParams = `user_link.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateUserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateUserLink(request), expectedError); + const actualRequest = (client.innerApiCalls.updateUserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateUserLinkRequest', ['userLink', 'name']); + request.userLink.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchUpdateUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchUpdateUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchUpdateUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchUpdateUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchUpdateUserLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchUpdateUserLinks(request), expectedError); + const actualRequest = (client.innerApiCalls.batchUpdateUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchUpdateUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteUserLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUserLink = stubSimpleCall(expectedResponse); + const [response] = await client.deleteUserLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteUserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteUserLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteUserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteUserLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteUserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteUserLink(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteUserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteUserLinkRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.batchDeleteUserLinks = stubSimpleCall(expectedResponse); + const [response] = await client.batchDeleteUserLinks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchDeleteUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchDeleteUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteUserLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchDeleteUserLinks(request), expectedError); + const actualRequest = (client.innerApiCalls.batchDeleteUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFirebaseLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createFirebaseLink(request), expectedError); + const actualRequest = (client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteFirebaseLink = stubSimpleCall(expectedResponse); + const [response] = await client.deleteFirebaseLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFirebaseLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteFirebaseLink(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getGlobalSiteTag as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getGlobalSiteTag as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getGlobalSiteTag as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getGlobalSiteTag as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGlobalSiteTag = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getGlobalSiteTag(request), expectedError); + const actualRequest = (client.innerApiCalls.getGlobalSiteTag as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getGlobalSiteTag as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGoogleAdsLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createGoogleAdsLink(request), expectedError); + const actualRequest = (client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest', ['parent']); + request.parent = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); + request.googleAdsLink.name = defaultValue1; + const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); + request.googleAdsLink.name = defaultValue1; + const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); + request.googleAdsLink.name = defaultValue1; + const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGoogleAdsLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateGoogleAdsLink(request), expectedError); + const actualRequest = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); + request.googleAdsLink.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCall(expectedResponse); + const [response] = await client.deleteGoogleAdsLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteGoogleAdsLink(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataSharingSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataSharingSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMeasurementProtocolSecret(request), expectedError); + const actualRequest = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createMeasurementProtocolSecret(request), expectedError); + const actualRequest = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCall(expectedResponse); + const [response] = await client.deleteMeasurementProtocolSecret(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteMeasurementProtocolSecret(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); + request.measurementProtocolSecret.name = defaultValue1; + const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); + request.measurementProtocolSecret.name = defaultValue1; + const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); + request.measurementProtocolSecret.name = defaultValue1; + const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateMeasurementProtocolSecret(request), expectedError); + const actualRequest = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); + request.measurementProtocolSecret.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest', ['property']); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest', ['property']); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest', ['property']); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.acknowledgeUserDataCollection(request), expectedError); + const actualRequest = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest', ['property']); + request.property = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getGoogleSignalsSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getGoogleSignalsSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getGoogleSignalsSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getGoogleSignalsSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGoogleSignalsSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getGoogleSignalsSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.getGoogleSignalsSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getGoogleSignalsSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest', ['googleSignalsSettings', 'name']); + request.googleSignalsSettings.name = defaultValue1; + const expectedHeaderRequestParams = `google_signals_settings.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest', ['googleSignalsSettings', 'name']); + request.googleSignalsSettings.name = defaultValue1; + const expectedHeaderRequestParams = `google_signals_settings.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest', ['googleSignalsSettings', 'name']); + request.googleSignalsSettings.name = defaultValue1; + const expectedHeaderRequestParams = `google_signals_settings.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGoogleSignalsSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateGoogleSignalsSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest', ['googleSignalsSettings', 'name']); + request.googleSignalsSettings.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateConversionEventRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateConversionEventRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateConversionEventRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConversionEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createConversionEvent(request), expectedError); + const actualRequest = (client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateConversionEventRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetConversionEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetConversionEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetConversionEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConversionEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConversionEvent(request), expectedError); + const actualRequest = (client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetConversionEventRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteConversionEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteConversionEvent = stubSimpleCall(expectedResponse); + const [response] = await client.deleteConversionEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteConversionEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteConversionEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConversionEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteConversionEvent(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteConversionEventRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDisplayVideo360AdvertiserLink(request), expectedError); + const actualRequest = (client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDisplayVideo360AdvertiserLink(request), expectedError); + const actualRequest = (client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDisplayVideo360AdvertiserLink = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDisplayVideo360AdvertiserLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDisplayVideo360AdvertiserLink(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest', ['displayVideo_360AdvertiserLink', 'name']); + request.displayVideo_360AdvertiserLink.name = defaultValue1; + const expectedHeaderRequestParams = `display_video_360_advertiser_link.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest', ['displayVideo_360AdvertiserLink', 'name']); + request.displayVideo_360AdvertiserLink.name = defaultValue1; + const expectedHeaderRequestParams = `display_video_360_advertiser_link.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest', ['displayVideo_360AdvertiserLink', 'name']); + request.displayVideo_360AdvertiserLink.name = defaultValue1; + const expectedHeaderRequestParams = `display_video_360_advertiser_link.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDisplayVideo360AdvertiserLink(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest', ['displayVideo_360AdvertiserLink', 'name']); + request.displayVideo_360AdvertiserLink.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDisplayVideo360AdvertiserLinkProposal(request), expectedError); + const actualRequest = (client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDisplayVideo360AdvertiserLinkProposal(request), expectedError); + const actualRequest = (client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDisplayVideo360AdvertiserLinkProposal(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDisplayVideo360AdvertiserLinkProposal(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.approveDisplayVideo360AdvertiserLinkProposal(request), expectedError); + const actualRequest = (client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelDisplayVideo360AdvertiserLinkProposal(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomDimensionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomDimensionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomDimensionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomDimension = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCustomDimension(request), expectedError); + const actualRequest = (client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomDimensionRequest', ['parent']); + request.parent = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest', ['customDimension', 'name']); + request.customDimension.name = defaultValue1; + const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest', ['customDimension', 'name']); + request.customDimension.name = defaultValue1; + const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest', ['customDimension', 'name']); + request.customDimension.name = defaultValue1; + const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomDimension = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCustomDimension(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest', ['customDimension', 'name']); + request.customDimension.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.archiveCustomDimension = stubSimpleCall(expectedResponse); + const [response] = await client.archiveCustomDimension(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.archiveCustomDimension = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.archiveCustomDimension(request), expectedError); + const actualRequest = (client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomDimensionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomDimensionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomDimensionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomDimension = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomDimension(request), expectedError); + const actualRequest = (client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomDimensionRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomMetricRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomMetricRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomMetricRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomMetric = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCustomMetric(request), expectedError); + const actualRequest = (client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomMetricRequest', ['parent']); + request.parent = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomMetricRequest', ['customMetric', 'name']); + request.customMetric.name = defaultValue1; + const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomMetricRequest', ['customMetric', 'name']); + request.customMetric.name = defaultValue1; + const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomMetricRequest', ['customMetric', 'name']); + request.customMetric.name = defaultValue1; + const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomMetric = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCustomMetric(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomMetricRequest', ['customMetric', 'name']); + request.customMetric.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.archiveCustomMetric = stubSimpleCall(expectedResponse); + const [response] = await client.archiveCustomMetric(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.archiveCustomMetric = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.archiveCustomMetric(request), expectedError); + const actualRequest = (client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomMetricRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomMetricRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomMetricRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomMetric = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomMetric(request), expectedError); + const actualRequest = (client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomMetricRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataRetentionSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataRetentionSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); + request.dataRetentionSettings.name = defaultValue1; + const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); + request.dataRetentionSettings.name = defaultValue1; + const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); + request.dataRetentionSettings.name = defaultValue1; + const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataRetentionSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDataRetentionSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); + request.dataRetentionSettings.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDataStreamRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDataStreamRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDataStreamRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataStream = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDataStream(request), expectedError); + const actualRequest = (client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDataStreamRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDataStreamRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDataStream = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDataStream(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDataStreamRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDataStreamRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataStream = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDataStream(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDataStreamRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataStreamRequest', ['dataStream', 'name']); + request.dataStream.name = defaultValue1; + const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataStreamRequest', ['dataStream', 'name']); + request.dataStream.name = defaultValue1; + const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataStreamRequest', ['dataStream', 'name']); + request.dataStream.name = defaultValue1; + const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataStream = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDataStream(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataStreamRequest', ['dataStream', 'name']); + request.dataStream.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataStreamRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataStreamRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataStreamRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataStream = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataStream(request), expectedError); + const actualRequest = (client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataStreamRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataStream(request), expectedError); + }); + }); + + describe('getAudience', () => { + it('invokes getAudience 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.GetAudienceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAudienceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.Audience() + ); + client.innerApiCalls.getAudience = stubSimpleCall(expectedResponse); + const [response] = await client.getAudience(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAudience as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAudience as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAudience 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.GetAudienceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAudienceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.Audience() + ); + client.innerApiCalls.getAudience = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAudience( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAudience|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAudience as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAudience as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAudience 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.GetAudienceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAudienceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAudience = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAudience(request), expectedError); + const actualRequest = (client.innerApiCalls.getAudience as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAudience as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAudience 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.GetAudienceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAudienceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAudience(request), expectedError); + }); + }); + + describe('createAudience', () => { + it('invokes createAudience 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.CreateAudienceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAudienceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.Audience() + ); + client.innerApiCalls.createAudience = stubSimpleCall(expectedResponse); + const [response] = await client.createAudience(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAudience as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAudience as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAudience 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.CreateAudienceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAudienceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.Audience() + ); + client.innerApiCalls.createAudience = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAudience( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAudience|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAudience as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAudience as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAudience 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.CreateAudienceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAudienceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAudience = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createAudience(request), expectedError); + const actualRequest = (client.innerApiCalls.createAudience as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAudience as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAudience 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.CreateAudienceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAudienceRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createAudience(request), expectedError); + }); + }); + + describe('updateAudience', () => { + it('invokes updateAudience 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.UpdateAudienceRequest() + ); + request.audience ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAudienceRequest', ['audience', 'name']); + request.audience.name = defaultValue1; + const expectedHeaderRequestParams = `audience.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.Audience() + ); + client.innerApiCalls.updateAudience = stubSimpleCall(expectedResponse); + const [response] = await client.updateAudience(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAudience as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAudience as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAudience 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.UpdateAudienceRequest() + ); + request.audience ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAudienceRequest', ['audience', 'name']); + request.audience.name = defaultValue1; + const expectedHeaderRequestParams = `audience.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.Audience() + ); + client.innerApiCalls.updateAudience = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAudience( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAudience|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAudience as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAudience as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAudience 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.UpdateAudienceRequest() + ); + request.audience ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAudienceRequest', ['audience', 'name']); + request.audience.name = defaultValue1; + const expectedHeaderRequestParams = `audience.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAudience = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateAudience(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAudience as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAudience as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAudience 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.UpdateAudienceRequest() + ); + request.audience ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAudienceRequest', ['audience', 'name']); + request.audience.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAudience(request), expectedError); + }); + }); + + describe('archiveAudience', () => { + it('invokes archiveAudience 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.ArchiveAudienceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveAudienceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.archiveAudience = stubSimpleCall(expectedResponse); + const [response] = await client.archiveAudience(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.archiveAudience as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveAudience as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes archiveAudience 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.ArchiveAudienceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveAudienceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.archiveAudience = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.archiveAudience( + 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); + const actualRequest = (client.innerApiCalls.archiveAudience as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveAudience as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes archiveAudience 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.ArchiveAudienceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveAudienceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.archiveAudience = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.archiveAudience(request), expectedError); + const actualRequest = (client.innerApiCalls.archiveAudience as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveAudience as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes archiveAudience 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.ArchiveAudienceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveAudienceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.archiveAudience(request), expectedError); + }); + }); + + describe('getSearchAds360Link', () => { + it('invokes getSearchAds360Link 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.GetSearchAds360LinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetSearchAds360LinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.SearchAds360Link() + ); + client.innerApiCalls.getSearchAds360Link = stubSimpleCall(expectedResponse); + const [response] = await client.getSearchAds360Link(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSearchAds360Link as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSearchAds360Link as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSearchAds360Link 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.GetSearchAds360LinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetSearchAds360LinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.SearchAds360Link() + ); + client.innerApiCalls.getSearchAds360Link = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSearchAds360Link( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ISearchAds360Link|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSearchAds360Link as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSearchAds360Link as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSearchAds360Link 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.GetSearchAds360LinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetSearchAds360LinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSearchAds360Link = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSearchAds360Link(request), expectedError); + const actualRequest = (client.innerApiCalls.getSearchAds360Link as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSearchAds360Link as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSearchAds360Link 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.GetSearchAds360LinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetSearchAds360LinkRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSearchAds360Link(request), expectedError); + }); + }); + + describe('createSearchAds360Link', () => { + it('invokes createSearchAds360Link 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.CreateSearchAds360LinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateSearchAds360LinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.SearchAds360Link() + ); + client.innerApiCalls.createSearchAds360Link = stubSimpleCall(expectedResponse); + const [response] = await client.createSearchAds360Link(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSearchAds360Link as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSearchAds360Link as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSearchAds360Link 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.CreateSearchAds360LinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateSearchAds360LinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.SearchAds360Link() + ); + client.innerApiCalls.createSearchAds360Link = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSearchAds360Link( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ISearchAds360Link|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSearchAds360Link as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSearchAds360Link as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSearchAds360Link 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.CreateSearchAds360LinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateSearchAds360LinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSearchAds360Link = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createSearchAds360Link(request), expectedError); + const actualRequest = (client.innerApiCalls.createSearchAds360Link as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSearchAds360Link as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSearchAds360Link 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.CreateSearchAds360LinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateSearchAds360LinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSearchAds360Link(request), expectedError); + }); + }); + + describe('deleteSearchAds360Link', () => { + it('invokes deleteSearchAds360Link 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.DeleteSearchAds360LinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteSearchAds360LinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSearchAds360Link = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSearchAds360Link(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSearchAds360Link as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSearchAds360Link as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSearchAds360Link 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.DeleteSearchAds360LinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteSearchAds360LinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSearchAds360Link = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSearchAds360Link( + 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); + const actualRequest = (client.innerApiCalls.deleteSearchAds360Link as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSearchAds360Link as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSearchAds360Link 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.DeleteSearchAds360LinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteSearchAds360LinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSearchAds360Link = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteSearchAds360Link(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSearchAds360Link as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSearchAds360Link as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSearchAds360Link 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.DeleteSearchAds360LinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteSearchAds360LinkRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSearchAds360Link(request), expectedError); + }); + }); + + describe('updateSearchAds360Link', () => { + it('invokes updateSearchAds360Link 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.UpdateSearchAds360LinkRequest() + ); + request.searchAds_360Link ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateSearchAds360LinkRequest', ['searchAds_360Link', 'name']); + request.searchAds_360Link.name = defaultValue1; + const expectedHeaderRequestParams = `search_ads_360_link.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.SearchAds360Link() + ); + client.innerApiCalls.updateSearchAds360Link = stubSimpleCall(expectedResponse); + const [response] = await client.updateSearchAds360Link(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSearchAds360Link as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSearchAds360Link as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSearchAds360Link 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.UpdateSearchAds360LinkRequest() + ); + request.searchAds_360Link ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateSearchAds360LinkRequest', ['searchAds_360Link', 'name']); + request.searchAds_360Link.name = defaultValue1; + const expectedHeaderRequestParams = `search_ads_360_link.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.SearchAds360Link() + ); + client.innerApiCalls.updateSearchAds360Link = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSearchAds360Link( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ISearchAds360Link|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSearchAds360Link as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSearchAds360Link as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSearchAds360Link 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.UpdateSearchAds360LinkRequest() + ); + request.searchAds_360Link ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateSearchAds360LinkRequest', ['searchAds_360Link', 'name']); + request.searchAds_360Link.name = defaultValue1; + const expectedHeaderRequestParams = `search_ads_360_link.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSearchAds360Link = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSearchAds360Link(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSearchAds360Link as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSearchAds360Link as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSearchAds360Link 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.UpdateSearchAds360LinkRequest() + ); + request.searchAds_360Link ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateSearchAds360LinkRequest', ['searchAds_360Link', 'name']); + request.searchAds_360Link.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSearchAds360Link(request), expectedError); + }); + }); + + describe('getAttributionSettings', () => { + it('invokes getAttributionSettings 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.GetAttributionSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAttributionSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.AttributionSettings() + ); + client.innerApiCalls.getAttributionSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getAttributionSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAttributionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAttributionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttributionSettings 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.GetAttributionSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAttributionSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.AttributionSettings() + ); + client.innerApiCalls.getAttributionSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAttributionSettings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAttributionSettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAttributionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAttributionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttributionSettings 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.GetAttributionSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAttributionSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAttributionSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAttributionSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.getAttributionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAttributionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttributionSettings 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.GetAttributionSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAttributionSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAttributionSettings(request), expectedError); + }); + }); + + describe('updateAttributionSettings', () => { + it('invokes updateAttributionSettings 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.UpdateAttributionSettingsRequest() + ); + request.attributionSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAttributionSettingsRequest', ['attributionSettings', 'name']); + request.attributionSettings.name = defaultValue1; + const expectedHeaderRequestParams = `attribution_settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.AttributionSettings() + ); + client.innerApiCalls.updateAttributionSettings = stubSimpleCall(expectedResponse); + const [response] = await client.updateAttributionSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAttributionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAttributionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAttributionSettings 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.UpdateAttributionSettingsRequest() + ); + request.attributionSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAttributionSettingsRequest', ['attributionSettings', 'name']); + request.attributionSettings.name = defaultValue1; + const expectedHeaderRequestParams = `attribution_settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.AttributionSettings() + ); + client.innerApiCalls.updateAttributionSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAttributionSettings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAttributionSettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAttributionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAttributionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAttributionSettings 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.UpdateAttributionSettingsRequest() + ); + request.attributionSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAttributionSettingsRequest', ['attributionSettings', 'name']); + request.attributionSettings.name = defaultValue1; + const expectedHeaderRequestParams = `attribution_settings.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAttributionSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateAttributionSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAttributionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAttributionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAttributionSettings 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.UpdateAttributionSettingsRequest() + ); + request.attributionSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAttributionSettingsRequest', ['attributionSettings', 'name']); + request.attributionSettings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAttributionSettings(request), expectedError); + }); + }); + + describe('runAccessReport', () => { + it('invokes runAccessReport 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.RunAccessReportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.RunAccessReportRequest', ['entity']); + request.entity = defaultValue1; + const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.RunAccessReportResponse() + ); + client.innerApiCalls.runAccessReport = stubSimpleCall(expectedResponse); + const [response] = await client.runAccessReport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.runAccessReport as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runAccessReport as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAccessReport 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.RunAccessReportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.RunAccessReportRequest', ['entity']); + request.entity = defaultValue1; + const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.RunAccessReportResponse() + ); + client.innerApiCalls.runAccessReport = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runAccessReport( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IRunAccessReportResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.runAccessReport as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runAccessReport as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAccessReport 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.RunAccessReportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.RunAccessReportRequest', ['entity']); + request.entity = defaultValue1; + const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runAccessReport = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.runAccessReport(request), expectedError); + const actualRequest = (client.innerApiCalls.runAccessReport as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runAccessReport as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAccessReport 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.RunAccessReportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.RunAccessReportRequest', ['entity']); + request.entity = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.runAccessReport(request), expectedError); + }); + }); + + describe('createAccessBinding', () => { + it('invokes createAccessBinding 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.CreateAccessBindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAccessBindingRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.AccessBinding() + ); + client.innerApiCalls.createAccessBinding = stubSimpleCall(expectedResponse); + const [response] = await client.createAccessBinding(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAccessBinding as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAccessBinding as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAccessBinding 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.CreateAccessBindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAccessBindingRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.AccessBinding() + ); + client.innerApiCalls.createAccessBinding = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAccessBinding( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccessBinding|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAccessBinding as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAccessBinding as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAccessBinding 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.CreateAccessBindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAccessBindingRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAccessBinding = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createAccessBinding(request), expectedError); + const actualRequest = (client.innerApiCalls.createAccessBinding as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAccessBinding as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAccessBinding 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.CreateAccessBindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAccessBindingRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createAccessBinding(request), expectedError); + }); + }); + + describe('getAccessBinding', () => { + it('invokes getAccessBinding 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.GetAccessBindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccessBindingRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.AccessBinding() + ); + client.innerApiCalls.getAccessBinding = stubSimpleCall(expectedResponse); + const [response] = await client.getAccessBinding(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAccessBinding as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccessBinding as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAccessBinding 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.GetAccessBindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccessBindingRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.AccessBinding() + ); + client.innerApiCalls.getAccessBinding = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAccessBinding( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccessBinding|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAccessBinding as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccessBinding as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAccessBinding 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.GetAccessBindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccessBindingRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAccessBinding = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAccessBinding(request), expectedError); + const actualRequest = (client.innerApiCalls.getAccessBinding as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccessBinding as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAccessBinding 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.GetAccessBindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccessBindingRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAccessBinding(request), expectedError); + }); + }); + + describe('updateAccessBinding', () => { + it('invokes updateAccessBinding 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.UpdateAccessBindingRequest() + ); + request.accessBinding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccessBindingRequest', ['accessBinding', 'name']); + request.accessBinding.name = defaultValue1; + const expectedHeaderRequestParams = `access_binding.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.AccessBinding() + ); + client.innerApiCalls.updateAccessBinding = stubSimpleCall(expectedResponse); + const [response] = await client.updateAccessBinding(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAccessBinding as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccessBinding as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAccessBinding 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.UpdateAccessBindingRequest() + ); + request.accessBinding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccessBindingRequest', ['accessBinding', 'name']); + request.accessBinding.name = defaultValue1; + const expectedHeaderRequestParams = `access_binding.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.AccessBinding() + ); + client.innerApiCalls.updateAccessBinding = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAccessBinding( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccessBinding|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAccessBinding as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccessBinding as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAccessBinding 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.UpdateAccessBindingRequest() + ); + request.accessBinding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccessBindingRequest', ['accessBinding', 'name']); + request.accessBinding.name = defaultValue1; + const expectedHeaderRequestParams = `access_binding.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAccessBinding = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateAccessBinding(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAccessBinding as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccessBinding as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAccessBinding 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.UpdateAccessBindingRequest() + ); + request.accessBinding ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccessBindingRequest', ['accessBinding', 'name']); + request.accessBinding.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAccessBinding(request), expectedError); + }); + }); + + describe('deleteAccessBinding', () => { + it('invokes deleteAccessBinding 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.DeleteAccessBindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccessBindingRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAccessBinding = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAccessBinding(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAccessBinding as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAccessBinding as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAccessBinding 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.DeleteAccessBindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccessBindingRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAccessBinding = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAccessBinding( + 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); + const actualRequest = (client.innerApiCalls.deleteAccessBinding as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAccessBinding as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAccessBinding 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.DeleteAccessBindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccessBindingRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAccessBinding = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteAccessBinding(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteAccessBinding as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAccessBinding as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAccessBinding 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.DeleteAccessBindingRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccessBindingRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteAccessBinding(request), expectedError); + }); + }); + + describe('batchCreateAccessBindings', () => { + it('invokes batchCreateAccessBindings 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.BatchCreateAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.BatchCreateAccessBindingsResponse() + ); + client.innerApiCalls.batchCreateAccessBindings = stubSimpleCall(expectedResponse); + const [response] = await client.batchCreateAccessBindings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchCreateAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateAccessBindings 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.BatchCreateAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.BatchCreateAccessBindingsResponse() + ); + client.innerApiCalls.batchCreateAccessBindings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateAccessBindings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchCreateAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateAccessBindings 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.BatchCreateAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateAccessBindings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchCreateAccessBindings(request), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateAccessBindings 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.BatchCreateAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchCreateAccessBindings(request), expectedError); + }); + }); + + describe('batchGetAccessBindings', () => { + it('invokes batchGetAccessBindings 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.BatchGetAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.BatchGetAccessBindingsResponse() + ); + client.innerApiCalls.batchGetAccessBindings = stubSimpleCall(expectedResponse); + const [response] = await client.batchGetAccessBindings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchGetAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchGetAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchGetAccessBindings 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.BatchGetAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.BatchGetAccessBindingsResponse() + ); + client.innerApiCalls.batchGetAccessBindings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchGetAccessBindings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchGetAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchGetAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchGetAccessBindings 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.BatchGetAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchGetAccessBindings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchGetAccessBindings(request), expectedError); + const actualRequest = (client.innerApiCalls.batchGetAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchGetAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchGetAccessBindings 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.BatchGetAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchGetAccessBindings(request), expectedError); + }); + }); + + describe('batchUpdateAccessBindings', () => { + it('invokes batchUpdateAccessBindings 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.BatchUpdateAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.BatchUpdateAccessBindingsResponse() + ); + client.innerApiCalls.batchUpdateAccessBindings = stubSimpleCall(expectedResponse); + const [response] = await client.batchUpdateAccessBindings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchUpdateAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchUpdateAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateAccessBindings 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.BatchUpdateAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.BatchUpdateAccessBindingsResponse() + ); + client.innerApiCalls.batchUpdateAccessBindings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchUpdateAccessBindings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchUpdateAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchUpdateAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateAccessBindings 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.BatchUpdateAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchUpdateAccessBindings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchUpdateAccessBindings(request), expectedError); + const actualRequest = (client.innerApiCalls.batchUpdateAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchUpdateAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateAccessBindings 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.BatchUpdateAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchUpdateAccessBindings(request), expectedError); + }); + }); + + describe('batchDeleteAccessBindings', () => { + it('invokes batchDeleteAccessBindings 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.BatchDeleteAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.batchDeleteAccessBindings = stubSimpleCall(expectedResponse); + const [response] = await client.batchDeleteAccessBindings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchDeleteAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteAccessBindings 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.BatchDeleteAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.batchDeleteAccessBindings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchDeleteAccessBindings( + 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); + const actualRequest = (client.innerApiCalls.batchDeleteAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteAccessBindings 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.BatchDeleteAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteAccessBindings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchDeleteAccessBindings(request), expectedError); + const actualRequest = (client.innerApiCalls.batchDeleteAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteAccessBindings 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.BatchDeleteAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchDeleteAccessBindings(request), expectedError); + }); + }); + + describe('getExpandedDataSet', () => { + it('invokes getExpandedDataSet 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.GetExpandedDataSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetExpandedDataSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.ExpandedDataSet() + ); + client.innerApiCalls.getExpandedDataSet = stubSimpleCall(expectedResponse); + const [response] = await client.getExpandedDataSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getExpandedDataSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExpandedDataSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExpandedDataSet 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.GetExpandedDataSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetExpandedDataSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.ExpandedDataSet() + ); + client.innerApiCalls.getExpandedDataSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExpandedDataSet( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IExpandedDataSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getExpandedDataSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExpandedDataSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExpandedDataSet 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.GetExpandedDataSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetExpandedDataSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExpandedDataSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getExpandedDataSet(request), expectedError); + const actualRequest = (client.innerApiCalls.getExpandedDataSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExpandedDataSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExpandedDataSet 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.GetExpandedDataSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetExpandedDataSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getExpandedDataSet(request), expectedError); + }); + }); + + describe('createExpandedDataSet', () => { + it('invokes createExpandedDataSet 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.CreateExpandedDataSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateExpandedDataSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.ExpandedDataSet() + ); + client.innerApiCalls.createExpandedDataSet = stubSimpleCall(expectedResponse); + const [response] = await client.createExpandedDataSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createExpandedDataSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExpandedDataSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExpandedDataSet 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.CreateExpandedDataSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateExpandedDataSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.ExpandedDataSet() + ); + client.innerApiCalls.createExpandedDataSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createExpandedDataSet( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IExpandedDataSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createExpandedDataSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExpandedDataSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExpandedDataSet 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.CreateExpandedDataSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateExpandedDataSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createExpandedDataSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createExpandedDataSet(request), expectedError); + const actualRequest = (client.innerApiCalls.createExpandedDataSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExpandedDataSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExpandedDataSet 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.CreateExpandedDataSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateExpandedDataSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createExpandedDataSet(request), expectedError); + }); + }); + + describe('updateExpandedDataSet', () => { + it('invokes updateExpandedDataSet 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.UpdateExpandedDataSetRequest() + ); + request.expandedDataSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateExpandedDataSetRequest', ['expandedDataSet', 'name']); + request.expandedDataSet.name = defaultValue1; + const expectedHeaderRequestParams = `expanded_data_set.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.ExpandedDataSet() + ); + client.innerApiCalls.updateExpandedDataSet = stubSimpleCall(expectedResponse); + const [response] = await client.updateExpandedDataSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateExpandedDataSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExpandedDataSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExpandedDataSet 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.UpdateExpandedDataSetRequest() + ); + request.expandedDataSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateExpandedDataSetRequest', ['expandedDataSet', 'name']); + request.expandedDataSet.name = defaultValue1; + const expectedHeaderRequestParams = `expanded_data_set.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.ExpandedDataSet() + ); + client.innerApiCalls.updateExpandedDataSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExpandedDataSet( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IExpandedDataSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateExpandedDataSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExpandedDataSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExpandedDataSet 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.UpdateExpandedDataSetRequest() + ); + request.expandedDataSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateExpandedDataSetRequest', ['expandedDataSet', 'name']); + request.expandedDataSet.name = defaultValue1; + const expectedHeaderRequestParams = `expanded_data_set.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExpandedDataSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateExpandedDataSet(request), expectedError); + const actualRequest = (client.innerApiCalls.updateExpandedDataSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExpandedDataSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExpandedDataSet 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.UpdateExpandedDataSetRequest() + ); + request.expandedDataSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateExpandedDataSetRequest', ['expandedDataSet', 'name']); + request.expandedDataSet.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateExpandedDataSet(request), expectedError); + }); + }); + + describe('deleteExpandedDataSet', () => { + it('invokes deleteExpandedDataSet 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.DeleteExpandedDataSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteExpandedDataSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteExpandedDataSet = stubSimpleCall(expectedResponse); + const [response] = await client.deleteExpandedDataSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteExpandedDataSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExpandedDataSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExpandedDataSet 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.DeleteExpandedDataSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteExpandedDataSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteExpandedDataSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteExpandedDataSet( + 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); + const actualRequest = (client.innerApiCalls.deleteExpandedDataSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExpandedDataSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExpandedDataSet 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.DeleteExpandedDataSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteExpandedDataSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExpandedDataSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteExpandedDataSet(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteExpandedDataSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExpandedDataSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExpandedDataSet 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.DeleteExpandedDataSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteExpandedDataSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteExpandedDataSet(request), expectedError); + }); + }); + + describe('setAutomatedGa4ConfigurationOptOut', () => { + it('invokes setAutomatedGa4ConfigurationOptOut 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.SetAutomatedGa4ConfigurationOptOutRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse() + ); + client.innerApiCalls.setAutomatedGa4ConfigurationOptOut = stubSimpleCall(expectedResponse); + const [response] = await client.setAutomatedGa4ConfigurationOptOut(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes setAutomatedGa4ConfigurationOptOut 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.SetAutomatedGa4ConfigurationOptOutRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse() + ); + client.innerApiCalls.setAutomatedGa4ConfigurationOptOut = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setAutomatedGa4ConfigurationOptOut( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes setAutomatedGa4ConfigurationOptOut 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.SetAutomatedGa4ConfigurationOptOutRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.setAutomatedGa4ConfigurationOptOut = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setAutomatedGa4ConfigurationOptOut(request), expectedError); + }); + + it('invokes setAutomatedGa4ConfigurationOptOut 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.SetAutomatedGa4ConfigurationOptOutRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setAutomatedGa4ConfigurationOptOut(request), expectedError); + }); + }); + + describe('fetchAutomatedGa4ConfigurationOptOut', () => { + it('invokes fetchAutomatedGa4ConfigurationOptOut 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.FetchAutomatedGa4ConfigurationOptOutRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse() + ); + client.innerApiCalls.fetchAutomatedGa4ConfigurationOptOut = stubSimpleCall(expectedResponse); + const [response] = await client.fetchAutomatedGa4ConfigurationOptOut(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes fetchAutomatedGa4ConfigurationOptOut 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.FetchAutomatedGa4ConfigurationOptOutRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse() + ); + client.innerApiCalls.fetchAutomatedGa4ConfigurationOptOut = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchAutomatedGa4ConfigurationOptOut( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes fetchAutomatedGa4ConfigurationOptOut 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.FetchAutomatedGa4ConfigurationOptOutRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.fetchAutomatedGa4ConfigurationOptOut = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchAutomatedGa4ConfigurationOptOut(request), expectedError); + }); + + it('invokes fetchAutomatedGa4ConfigurationOptOut 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.FetchAutomatedGa4ConfigurationOptOutRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.fetchAutomatedGa4ConfigurationOptOut(request), expectedError); + }); + }); + + describe('getBigQueryLink', () => { + it('invokes getBigQueryLink 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.GetBigQueryLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetBigQueryLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.BigQueryLink() + ); + client.innerApiCalls.getBigQueryLink = stubSimpleCall(expectedResponse); + const [response] = await client.getBigQueryLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBigQueryLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBigQueryLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBigQueryLink 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.GetBigQueryLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetBigQueryLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.BigQueryLink() + ); + client.innerApiCalls.getBigQueryLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBigQueryLink( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBigQueryLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBigQueryLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBigQueryLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBigQueryLink 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.GetBigQueryLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetBigQueryLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBigQueryLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBigQueryLink(request), expectedError); + const actualRequest = (client.innerApiCalls.getBigQueryLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBigQueryLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBigQueryLink 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.GetBigQueryLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetBigQueryLinkRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBigQueryLink(request), expectedError); + }); + }); + + describe('getEnhancedMeasurementSettings', () => { + it('invokes getEnhancedMeasurementSettings 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.GetEnhancedMeasurementSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.EnhancedMeasurementSettings() + ); + client.innerApiCalls.getEnhancedMeasurementSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getEnhancedMeasurementSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEnhancedMeasurementSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEnhancedMeasurementSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnhancedMeasurementSettings 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.GetEnhancedMeasurementSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.EnhancedMeasurementSettings() + ); + client.innerApiCalls.getEnhancedMeasurementSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEnhancedMeasurementSettings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEnhancedMeasurementSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEnhancedMeasurementSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnhancedMeasurementSettings 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.GetEnhancedMeasurementSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEnhancedMeasurementSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEnhancedMeasurementSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.getEnhancedMeasurementSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEnhancedMeasurementSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnhancedMeasurementSettings 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.GetEnhancedMeasurementSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEnhancedMeasurementSettings(request), expectedError); + }); + }); + + describe('updateEnhancedMeasurementSettings', () => { + it('invokes updateEnhancedMeasurementSettings 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.UpdateEnhancedMeasurementSettingsRequest() + ); + request.enhancedMeasurementSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest', ['enhancedMeasurementSettings', 'name']); + request.enhancedMeasurementSettings.name = defaultValue1; + const expectedHeaderRequestParams = `enhanced_measurement_settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.EnhancedMeasurementSettings() + ); + client.innerApiCalls.updateEnhancedMeasurementSettings = stubSimpleCall(expectedResponse); + const [response] = await client.updateEnhancedMeasurementSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateEnhancedMeasurementSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEnhancedMeasurementSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnhancedMeasurementSettings 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.UpdateEnhancedMeasurementSettingsRequest() + ); + request.enhancedMeasurementSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest', ['enhancedMeasurementSettings', 'name']); + request.enhancedMeasurementSettings.name = defaultValue1; + const expectedHeaderRequestParams = `enhanced_measurement_settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.EnhancedMeasurementSettings() + ); + client.innerApiCalls.updateEnhancedMeasurementSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEnhancedMeasurementSettings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateEnhancedMeasurementSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEnhancedMeasurementSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnhancedMeasurementSettings 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.UpdateEnhancedMeasurementSettingsRequest() + ); + request.enhancedMeasurementSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest', ['enhancedMeasurementSettings', 'name']); + request.enhancedMeasurementSettings.name = defaultValue1; + const expectedHeaderRequestParams = `enhanced_measurement_settings.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEnhancedMeasurementSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateEnhancedMeasurementSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.updateEnhancedMeasurementSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEnhancedMeasurementSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnhancedMeasurementSettings 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.UpdateEnhancedMeasurementSettingsRequest() + ); + request.enhancedMeasurementSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest', ['enhancedMeasurementSettings', 'name']); + request.enhancedMeasurementSettings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateEnhancedMeasurementSettings(request), expectedError); + }); + }); + + describe('createConnectedSiteTag', () => { + it('invokes createConnectedSiteTag 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.CreateConnectedSiteTagRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse() + ); + client.innerApiCalls.createConnectedSiteTag = stubSimpleCall(expectedResponse); + const [response] = await client.createConnectedSiteTag(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createConnectedSiteTag 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.CreateConnectedSiteTagRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse() + ); + client.innerApiCalls.createConnectedSiteTag = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createConnectedSiteTag( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createConnectedSiteTag 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.CreateConnectedSiteTagRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createConnectedSiteTag = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createConnectedSiteTag(request), expectedError); + }); + + it('invokes createConnectedSiteTag 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.CreateConnectedSiteTagRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createConnectedSiteTag(request), expectedError); + }); + }); + + describe('deleteConnectedSiteTag', () => { + it('invokes deleteConnectedSiteTag 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.DeleteConnectedSiteTagRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteConnectedSiteTag = stubSimpleCall(expectedResponse); + const [response] = await client.deleteConnectedSiteTag(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes deleteConnectedSiteTag 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.DeleteConnectedSiteTagRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteConnectedSiteTag = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteConnectedSiteTag( + 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); + }); + + it('invokes deleteConnectedSiteTag 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.DeleteConnectedSiteTagRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConnectedSiteTag = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteConnectedSiteTag(request), expectedError); + }); + + it('invokes deleteConnectedSiteTag 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.DeleteConnectedSiteTagRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteConnectedSiteTag(request), expectedError); + }); + }); + + describe('listConnectedSiteTags', () => { + it('invokes listConnectedSiteTags 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.ListConnectedSiteTagsRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse() + ); + client.innerApiCalls.listConnectedSiteTags = stubSimpleCall(expectedResponse); + const [response] = await client.listConnectedSiteTags(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listConnectedSiteTags 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.ListConnectedSiteTagsRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse() + ); + client.innerApiCalls.listConnectedSiteTags = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConnectedSiteTags( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listConnectedSiteTags 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.ListConnectedSiteTagsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listConnectedSiteTags = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listConnectedSiteTags(request), expectedError); + }); + + it('invokes listConnectedSiteTags 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.ListConnectedSiteTagsRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listConnectedSiteTags(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 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); + }); + + 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 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); + }); + + 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 expectedError = new Error('expected'); + client.innerApiCalls.listAccounts = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAccounts(request), expectedError); + }); + + 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 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); + }); + + 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 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); + }); + + 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 expectedError = new Error('expected'); + client.innerApiCalls.listAccountSummaries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAccountSummaries(request), expectedError); + }); + + 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 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); + }); + + 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 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); + }); + + 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 expectedError = new Error('expected'); + client.innerApiCalls.listProperties = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listProperties(request), expectedError); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUserLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUserLinks(request), expectedError); + const actualRequest = (client.innerApiCalls.listUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listUserLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listUserLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listUserLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listUserLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.AuditUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.auditUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.auditUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.AuditUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.auditUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.auditUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.AuditUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.auditUserLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.auditUserLinks(request), expectedError); + const actualRequest = (client.innerApiCalls.auditUserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.auditUserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.AuditUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.auditUserLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.AuditUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.auditUserLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.AuditUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.auditUserLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.AuditUserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.auditUserLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListFirebaseLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListFirebaseLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListFirebaseLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFirebaseLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFirebaseLinks(request), expectedError); + const actualRequest = (client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListFirebaseLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFirebaseLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListFirebaseLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFirebaseLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListFirebaseLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListFirebaseLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGoogleAdsLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listGoogleAdsLinks(request), expectedError); + const actualRequest = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMeasurementProtocolSecrets(request), expectedError); + const actualRequest = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest', ['account']); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest', ['account']); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest', ['account']); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchChangeHistoryEvents(request), expectedError); + const actualRequest = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest', ['account']); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + 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( + (client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest', ['account']); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + 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( + (client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest', ['account']); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + 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( + (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest', ['account']); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + 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( + (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListConversionEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListConversionEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListConversionEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConversionEvents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listConversionEvents(request), expectedError); + const actualRequest = (client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListConversionEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listConversionEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListConversionEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listConversionEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListConversionEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListConversionEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDisplayVideo360AdvertiserLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDisplayVideo360AdvertiserLinks(request), expectedError); + const actualRequest = (client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDisplayVideo360AdvertiserLinkProposals(request), expectedError); + const actualRequest = (client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomDimensionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomDimensionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomDimensionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomDimensions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomDimensions(request), expectedError); + const actualRequest = (client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomDimensionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomDimensions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomDimensionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomDimensions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomDimensionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomDimensionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomMetricsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomMetricsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomMetricsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomMetrics = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomMetrics(request), expectedError); + const actualRequest = (client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomMetricsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomMetrics.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomMetricsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomMetrics.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomMetricsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomMetricsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDataStreamsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDataStreamsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDataStreamsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataStreams = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDataStreams(request), expectedError); + const actualRequest = (client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDataStreamsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataStreams.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDataStreamsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataStreams.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDataStreamsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDataStreamsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAudiences', () => { + it('invokes listAudiences 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.ListAudiencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAudiencesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), + ]; + client.innerApiCalls.listAudiences = stubSimpleCall(expectedResponse); + const [response] = await client.listAudiences(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAudiences as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAudiences as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAudiences 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.ListAudiencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAudiencesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), + ]; + client.innerApiCalls.listAudiences = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAudiences( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAudience[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAudiences as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAudiences as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAudiences 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.ListAudiencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAudiencesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAudiences = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAudiences(request), expectedError); + const actualRequest = (client.innerApiCalls.listAudiences as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAudiences as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAudiencesStream 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.ListAudiencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAudiencesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), + ]; + client.descriptors.page.listAudiences.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAudiencesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.Audience[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.Audience) => { + 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.listAudiences.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAudiences, request)); + assert( + (client.descriptors.page.listAudiences.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAudiencesStream 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.ListAudiencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAudiencesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAudiences.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAudiencesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.Audience[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.Audience) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAudiences.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAudiences, request)); + assert( + (client.descriptors.page.listAudiences.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAudiences 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.ListAudiencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAudiencesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), + ]; + client.descriptors.page.listAudiences.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IAudience[] = []; + const iterable = client.listAudiencesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAudiences.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAudiences.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAudiences 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.ListAudiencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAudiencesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAudiences.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAudiencesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IAudience[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAudiences.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAudiences.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSearchAds360Links', () => { + it('invokes listSearchAds360Links 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.ListSearchAds360LinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListSearchAds360LinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), + ]; + client.innerApiCalls.listSearchAds360Links = stubSimpleCall(expectedResponse); + const [response] = await client.listSearchAds360Links(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSearchAds360Links as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSearchAds360Links as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSearchAds360Links 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.ListSearchAds360LinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListSearchAds360LinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), + ]; + client.innerApiCalls.listSearchAds360Links = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSearchAds360Links( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ISearchAds360Link[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSearchAds360Links as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSearchAds360Links as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSearchAds360Links 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.ListSearchAds360LinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListSearchAds360LinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSearchAds360Links = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSearchAds360Links(request), expectedError); + const actualRequest = (client.innerApiCalls.listSearchAds360Links as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSearchAds360Links as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSearchAds360LinksStream 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.ListSearchAds360LinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListSearchAds360LinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), + ]; + client.descriptors.page.listSearchAds360Links.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSearchAds360LinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.SearchAds360Link[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.SearchAds360Link) => { + 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.listSearchAds360Links.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSearchAds360Links, request)); + assert( + (client.descriptors.page.listSearchAds360Links.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSearchAds360LinksStream 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.ListSearchAds360LinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListSearchAds360LinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSearchAds360Links.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSearchAds360LinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.SearchAds360Link[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.SearchAds360Link) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSearchAds360Links.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSearchAds360Links, request)); + assert( + (client.descriptors.page.listSearchAds360Links.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSearchAds360Links 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.ListSearchAds360LinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListSearchAds360LinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), + ]; + client.descriptors.page.listSearchAds360Links.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.ISearchAds360Link[] = []; + const iterable = client.listSearchAds360LinksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSearchAds360Links.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSearchAds360Links.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSearchAds360Links 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.ListSearchAds360LinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListSearchAds360LinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSearchAds360Links.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSearchAds360LinksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.ISearchAds360Link[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSearchAds360Links.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSearchAds360Links.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAccessBindings', () => { + it('invokes listAccessBindings 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.ListAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), + ]; + client.innerApiCalls.listAccessBindings = stubSimpleCall(expectedResponse); + const [response] = await client.listAccessBindings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAccessBindings 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.ListAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), + ]; + client.innerApiCalls.listAccessBindings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAccessBindings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccessBinding[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAccessBindings 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.ListAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAccessBindings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAccessBindings(request), expectedError); + const actualRequest = (client.innerApiCalls.listAccessBindings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAccessBindings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAccessBindingsStream 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.ListAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), + ]; + client.descriptors.page.listAccessBindings.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAccessBindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.AccessBinding[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.AccessBinding) => { + 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.listAccessBindings.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAccessBindings, request)); + assert( + (client.descriptors.page.listAccessBindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAccessBindingsStream 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.ListAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAccessBindings.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAccessBindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.AccessBinding[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.AccessBinding) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAccessBindings.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAccessBindings, request)); + assert( + (client.descriptors.page.listAccessBindings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAccessBindings 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.ListAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), + ]; + client.descriptors.page.listAccessBindings.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IAccessBinding[] = []; + const iterable = client.listAccessBindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAccessBindings.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAccessBindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAccessBindings 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.ListAccessBindingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAccessBindingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAccessBindings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAccessBindingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IAccessBinding[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAccessBindings.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAccessBindings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listExpandedDataSets', () => { + it('invokes listExpandedDataSets 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.ListExpandedDataSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListExpandedDataSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), + ]; + client.innerApiCalls.listExpandedDataSets = stubSimpleCall(expectedResponse); + const [response] = await client.listExpandedDataSets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listExpandedDataSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExpandedDataSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExpandedDataSets 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.ListExpandedDataSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListExpandedDataSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), + ]; + client.innerApiCalls.listExpandedDataSets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExpandedDataSets( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IExpandedDataSet[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listExpandedDataSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExpandedDataSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExpandedDataSets 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.ListExpandedDataSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListExpandedDataSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExpandedDataSets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listExpandedDataSets(request), expectedError); + const actualRequest = (client.innerApiCalls.listExpandedDataSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExpandedDataSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExpandedDataSetsStream 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.ListExpandedDataSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListExpandedDataSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), + ]; + client.descriptors.page.listExpandedDataSets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listExpandedDataSetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.ExpandedDataSet[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.ExpandedDataSet) => { + 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.listExpandedDataSets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExpandedDataSets, request)); + assert( + (client.descriptors.page.listExpandedDataSets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listExpandedDataSetsStream 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.ListExpandedDataSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListExpandedDataSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExpandedDataSets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listExpandedDataSetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.ExpandedDataSet[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.ExpandedDataSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listExpandedDataSets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExpandedDataSets, request)); + assert( + (client.descriptors.page.listExpandedDataSets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listExpandedDataSets 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.ListExpandedDataSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListExpandedDataSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), + ]; + client.descriptors.page.listExpandedDataSets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IExpandedDataSet[] = []; + const iterable = client.listExpandedDataSetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listExpandedDataSets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listExpandedDataSets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listExpandedDataSets 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.ListExpandedDataSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListExpandedDataSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExpandedDataSets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExpandedDataSetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IExpandedDataSet[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listExpandedDataSets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listExpandedDataSets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBigQueryLinks', () => { + it('invokes listBigQueryLinks 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.ListBigQueryLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListBigQueryLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), + ]; + client.innerApiCalls.listBigQueryLinks = stubSimpleCall(expectedResponse); + const [response] = await client.listBigQueryLinks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBigQueryLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBigQueryLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBigQueryLinks 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.ListBigQueryLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListBigQueryLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), + ]; + client.innerApiCalls.listBigQueryLinks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBigQueryLinks( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBigQueryLink[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBigQueryLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBigQueryLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBigQueryLinks 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.ListBigQueryLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListBigQueryLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBigQueryLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBigQueryLinks(request), expectedError); + const actualRequest = (client.innerApiCalls.listBigQueryLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBigQueryLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBigQueryLinksStream 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.ListBigQueryLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListBigQueryLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), + ]; + client.descriptors.page.listBigQueryLinks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBigQueryLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.BigQueryLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.BigQueryLink) => { + 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.listBigQueryLinks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBigQueryLinks, request)); + assert( + (client.descriptors.page.listBigQueryLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBigQueryLinksStream 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.ListBigQueryLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListBigQueryLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBigQueryLinks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBigQueryLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.analytics.admin.v1alpha.BigQueryLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1alpha.BigQueryLink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBigQueryLinks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBigQueryLinks, request)); + assert( + (client.descriptors.page.listBigQueryLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBigQueryLinks 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.ListBigQueryLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListBigQueryLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), + generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), + ]; + client.descriptors.page.listBigQueryLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1alpha.IBigQueryLink[] = []; + const iterable = client.listBigQueryLinksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBigQueryLinks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBigQueryLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBigQueryLinks 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.ListBigQueryLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.ListBigQueryLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBigQueryLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBigQueryLinksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.analytics.admin.v1alpha.IBigQueryLink[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBigQueryLinks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBigQueryLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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('accountAccessBinding', () => { + const fakePath = "/rendered/path/accountAccessBinding"; + const expectedParameters = { + account: "accountValue", + access_binding: "accessBindingValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accountAccessBindingPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accountAccessBindingPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accountAccessBindingPath', () => { + const result = client.accountAccessBindingPath("accountValue", "accessBindingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accountAccessBindingPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountFromAccountAccessBindingName', () => { + const result = client.matchAccountFromAccountAccessBindingName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.accountAccessBindingPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccessBindingFromAccountAccessBindingName', () => { + const result = client.matchAccessBindingFromAccountAccessBindingName(fakePath); + assert.strictEqual(result, "accessBindingValue"); + assert((client.pathTemplates.accountAccessBindingPathTemplate.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('attributionSettings', () => { + const fakePath = "/rendered/path/attributionSettings"; + const expectedParameters = { + property: "propertyValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributionSettingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributionSettingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributionSettingsPath', () => { + const result = client.attributionSettingsPath("propertyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributionSettingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromAttributionSettingsName', () => { + const result = client.matchPropertyFromAttributionSettingsName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.attributionSettingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('audience', () => { + const fakePath = "/rendered/path/audience"; + const expectedParameters = { + property: "propertyValue", + audience: "audienceValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.audiencePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.audiencePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('audiencePath', () => { + const result = client.audiencePath("propertyValue", "audienceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.audiencePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromAudienceName', () => { + const result = client.matchPropertyFromAudienceName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.audiencePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAudienceFromAudienceName', () => { + const result = client.matchAudienceFromAudienceName(fakePath); + assert.strictEqual(result, "audienceValue"); + assert((client.pathTemplates.audiencePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('bigQueryLink', () => { + const fakePath = "/rendered/path/bigQueryLink"; + const expectedParameters = { + property: "propertyValue", + bigquery_link: "bigqueryLinkValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.bigQueryLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.bigQueryLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('bigQueryLinkPath', () => { + const result = client.bigQueryLinkPath("propertyValue", "bigqueryLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.bigQueryLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromBigQueryLinkName', () => { + const result = client.matchPropertyFromBigQueryLinkName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.bigQueryLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBigqueryLinkFromBigQueryLinkName', () => { + const result = client.matchBigqueryLinkFromBigQueryLinkName(fakePath); + assert.strictEqual(result, "bigqueryLinkValue"); + assert((client.pathTemplates.bigQueryLinkPathTemplate.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('enhancedMeasurementSettings', () => { + const fakePath = "/rendered/path/enhancedMeasurementSettings"; + 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.enhancedMeasurementSettingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.enhancedMeasurementSettingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('enhancedMeasurementSettingsPath', () => { + const result = client.enhancedMeasurementSettingsPath("propertyValue", "dataStreamValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.enhancedMeasurementSettingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromEnhancedMeasurementSettingsName', () => { + const result = client.matchPropertyFromEnhancedMeasurementSettingsName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.enhancedMeasurementSettingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataStreamFromEnhancedMeasurementSettingsName', () => { + const result = client.matchDataStreamFromEnhancedMeasurementSettingsName(fakePath); + assert.strictEqual(result, "dataStreamValue"); + assert((client.pathTemplates.enhancedMeasurementSettingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('expandedDataSet', () => { + const fakePath = "/rendered/path/expandedDataSet"; + const expectedParameters = { + property: "propertyValue", + expanded_data_set: "expandedDataSetValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.expandedDataSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.expandedDataSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('expandedDataSetPath', () => { + const result = client.expandedDataSetPath("propertyValue", "expandedDataSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.expandedDataSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromExpandedDataSetName', () => { + const result = client.matchPropertyFromExpandedDataSetName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.expandedDataSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExpandedDataSetFromExpandedDataSetName', () => { + const result = client.matchExpandedDataSetFromExpandedDataSetName(fakePath); + assert.strictEqual(result, "expandedDataSetValue"); + assert((client.pathTemplates.expandedDataSetPathTemplate.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('propertyAccessBinding', () => { + const fakePath = "/rendered/path/propertyAccessBinding"; + const expectedParameters = { + property: "propertyValue", + access_binding: "accessBindingValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.propertyAccessBindingPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.propertyAccessBindingPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('propertyAccessBindingPath', () => { + const result = client.propertyAccessBindingPath("propertyValue", "accessBindingValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.propertyAccessBindingPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromPropertyAccessBindingName', () => { + const result = client.matchPropertyFromPropertyAccessBindingName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.propertyAccessBindingPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccessBindingFromPropertyAccessBindingName', () => { + const result = client.matchAccessBindingFromPropertyAccessBindingName(fakePath); + assert.strictEqual(result, "accessBindingValue"); + assert((client.pathTemplates.propertyAccessBindingPathTemplate.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)); + }); + }); + + describe('searchAds360Link', () => { + const fakePath = "/rendered/path/searchAds360Link"; + const expectedParameters = { + property: "propertyValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.searchAds360LinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.searchAds360LinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('searchAds360LinkPath', () => { + const result = client.searchAds360LinkPath("propertyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.searchAds360LinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromSearchAds360LinkName', () => { + const result = client.matchPropertyFromSearchAds360LinkName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.searchAds360LinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/tsconfig.json b/owl-bot-staging/google-analytics-admin/v1alpha/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/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/google-analytics-admin/v1alpha/webpack.config.js b/owl-bot-staging/google-analytics-admin/v1alpha/webpack.config.js new file mode 100644 index 00000000000..0e336a8bddc --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/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', +}; diff --git a/owl-bot-staging/google-analytics-admin/v1beta/.eslintignore b/owl-bot-staging/google-analytics-admin/v1beta/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-analytics-admin/v1beta/.eslintrc.json b/owl-bot-staging/google-analytics-admin/v1beta/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/.gitignore b/owl-bot-staging/google-analytics-admin/v1beta/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-analytics-admin/v1beta/.jsdoc.js b/owl-bot-staging/google-analytics-admin/v1beta/.jsdoc.js new file mode 100644 index 00000000000..9f742f6cf16 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 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 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/admin', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-analytics-admin/v1beta/.mocharc.js b/owl-bot-staging/google-analytics-admin/v1beta/.mocharc.js new file mode 100644 index 00000000000..1a38f257db7 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2023 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/google-analytics-admin/v1beta/.prettierrc.js b/owl-bot-staging/google-analytics-admin/v1beta/.prettierrc.js new file mode 100644 index 00000000000..55639e70f9e --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2023 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/google-analytics-admin/v1beta/README.md b/owl-bot-staging/google-analytics-admin/v1beta/README.md new file mode 100644 index 00000000000..5d45b74ed37 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/README.md @@ -0,0 +1 @@ +Admin: Nodejs Client diff --git a/owl-bot-staging/google-analytics-admin/v1beta/linkinator.config.json b/owl-bot-staging/google-analytics-admin/v1beta/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/package.json b/owl-bot-staging/google-analytics-admin/v1beta/package.json new file mode 100644 index 00000000000..747d61e7329 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/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/ && minifyProtoJson", + "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.5.7" + }, + "devDependencies": { + "@types/mocha": "^10.0.1", + "@types/node": "^18.11.18", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.1.2", + "mocha": "^10.2.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.1", + "ts-loader": "^8.4.0", + "typescript": "^4.8.4", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/access_report.proto b/owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/access_report.proto new file mode 100644 index 00000000000..57b70319760 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/access_report.proto @@ -0,0 +1,334 @@ +// Copyright 2023 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.v1beta; + +option go_package = "google.golang.org/genproto/googleapis/analytics/admin/v1beta;admin"; +option java_multiple_files = true; +option java_outer_classname = "AccessReportProto"; +option java_package = "com.google.analytics.admin.v1beta"; + +// Dimensions are attributes of your data. For example, the dimension +// `userEmail` indicates the email of the user that accessed reporting data. +// Dimension values in report responses are strings. +message AccessDimension { + // The API name of the dimension. See [Data Access + // Schema](https://developers.google.com/analytics/devguides/config/admin/v1/access-api-schema) + // for the list of dimensions supported in this API. + // + // Dimensions are referenced by name in `dimensionFilter` and `orderBys`. + string dimension_name = 1; +} + +// The quantitative measurements of a report. For example, the metric +// `accessCount` is the total number of data access records. +message AccessMetric { + // The API name of the metric. See [Data Access + // Schema](https://developers.google.com/analytics/devguides/config/admin/v1/access-api-schema) + // for the list of metrics supported in this API. + // + // Metrics are referenced by name in `metricFilter` & `orderBys`. + string metric_name = 1; +} + +// A contiguous range of days: startDate, startDate + 1, ..., endDate. +message AccessDateRange { + // The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot + // be after `endDate`. The format `NdaysAgo`, `yesterday`, or `today` is also + // accepted, and in that case, the date is inferred based on the current time + // in the request's time zone. + string start_date = 1; + + // The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot + // be before `startDate`. The format `NdaysAgo`, `yesterday`, or `today` is + // also accepted, and in that case, the date is inferred based on the current + // time in the request's time zone. + string end_date = 2; +} + +// Expresses dimension or metric filters. The fields in the same expression need +// to be either all dimensions or all metrics. +message AccessFilterExpression { + // Specify one type of filter expression for `FilterExpression`. + oneof one_expression { + // Each of the FilterExpressions in the and_group has an AND relationship. + AccessFilterExpressionList and_group = 1; + + // Each of the FilterExpressions in the or_group has an OR relationship. + AccessFilterExpressionList or_group = 2; + + // The FilterExpression is NOT of not_expression. + AccessFilterExpression not_expression = 3; + + // A primitive filter. In the same FilterExpression, all of the filter's + // field names need to be either all dimensions or all metrics. + AccessFilter access_filter = 4; + } +} + +// A list of filter expressions. +message AccessFilterExpressionList { + // A list of filter expressions. + repeated AccessFilterExpression expressions = 1; +} + +// An expression to filter dimension or metric values. +message AccessFilter { + // Specify one type of filter for `Filter`. + oneof one_filter { + // Strings related filter. + AccessStringFilter string_filter = 2; + + // A filter for in list values. + AccessInListFilter in_list_filter = 3; + + // A filter for numeric or date values. + AccessNumericFilter numeric_filter = 4; + + // A filter for two values. + AccessBetweenFilter between_filter = 5; + } + + // The dimension name or metric name. + string field_name = 1; +} + +// The filter for strings. +message AccessStringFilter { + // The match type of a string filter. + enum MatchType { + // Unspecified + MATCH_TYPE_UNSPECIFIED = 0; + + // Exact match of the string value. + EXACT = 1; + + // Begins with the string value. + BEGINS_WITH = 2; + + // Ends with the string value. + ENDS_WITH = 3; + + // Contains the string value. + CONTAINS = 4; + + // Full match for the regular expression with the string value. + FULL_REGEXP = 5; + + // Partial match for the regular expression with the string value. + PARTIAL_REGEXP = 6; + } + + // The match type for this filter. + MatchType match_type = 1; + + // The string value used for the matching. + string value = 2; + + // If true, the string value is case sensitive. + bool case_sensitive = 3; +} + +// The result needs to be in a list of string values. +message AccessInListFilter { + // The list of string values. Must be non-empty. + repeated string values = 1; + + // If true, the string value is case sensitive. + bool case_sensitive = 2; +} + +// Filters for numeric or date values. +message AccessNumericFilter { + // The operation applied to a numeric filter. + enum Operation { + // Unspecified. + OPERATION_UNSPECIFIED = 0; + + // Equal + EQUAL = 1; + + // Less than + LESS_THAN = 2; + + // Less than or equal + LESS_THAN_OR_EQUAL = 3; + + // Greater than + GREATER_THAN = 4; + + // Greater than or equal + GREATER_THAN_OR_EQUAL = 5; + } + + // The operation type for this filter. + Operation operation = 1; + + // A numeric value or a date value. + NumericValue value = 2; +} + +// To express that the result needs to be between two numbers (inclusive). +message AccessBetweenFilter { + // Begins with this number. + NumericValue from_value = 1; + + // Ends with this number. + NumericValue to_value = 2; +} + +// To represent a number. +message NumericValue { + // One of a numeric value + oneof one_value { + // Integer value + int64 int64_value = 1; + + // Double value + double double_value = 2; + } +} + +// Order bys define how rows will be sorted in the response. For example, +// ordering rows by descending access count is one ordering, and ordering rows +// by the country string is a different ordering. +message AccessOrderBy { + // Sorts by metric values. + message MetricOrderBy { + // A metric name in the request to order by. + string metric_name = 1; + } + + // Sorts by dimension values. + message DimensionOrderBy { + // Rule to order the string dimension values by. + enum OrderType { + // Unspecified. + ORDER_TYPE_UNSPECIFIED = 0; + + // Alphanumeric sort by Unicode code point. For example, "2" < "A" < "X" < + // "b" < "z". + ALPHANUMERIC = 1; + + // Case insensitive alphanumeric sort by lower case Unicode code point. + // For example, "2" < "A" < "b" < "X" < "z". + CASE_INSENSITIVE_ALPHANUMERIC = 2; + + // Dimension values are converted to numbers before sorting. For example + // in NUMERIC sort, "25" < "100", and in `ALPHANUMERIC` sort, "100" < + // "25". Non-numeric dimension values all have equal ordering value below + // all numeric values. + NUMERIC = 3; + } + + // A dimension name in the request to order by. + string dimension_name = 1; + + // Controls the rule for dimension value ordering. + OrderType order_type = 2; + } + + // Specify one type of order by for `OrderBy`. + oneof one_order_by { + // Sorts results by a metric's values. + MetricOrderBy metric = 1; + + // Sorts results by a dimension's values. + DimensionOrderBy dimension = 2; + } + + // If true, sorts by descending order. If false or unspecified, sorts in + // ascending order. + bool desc = 3; +} + +// Describes a dimension column in the report. Dimensions requested in a report +// produce column entries within rows and DimensionHeaders. However, dimensions +// used exclusively within filters or expressions do not produce columns in a +// report; correspondingly, those dimensions do not produce headers. +message AccessDimensionHeader { + // The dimension's name; for example 'userEmail'. + string dimension_name = 1; +} + +// Describes a metric column in the report. Visible metrics requested in a +// report produce column entries within rows and MetricHeaders. However, +// metrics used exclusively within filters or expressions do not produce columns +// in a report; correspondingly, those metrics do not produce headers. +message AccessMetricHeader { + // The metric's name; for example 'accessCount'. + string metric_name = 1; +} + +// Access report data for each row. +message AccessRow { + // List of dimension values. These values are in the same order as specified + // in the request. + repeated AccessDimensionValue dimension_values = 1; + + // List of metric values. These values are in the same order as specified + // in the request. + repeated AccessMetricValue metric_values = 2; +} + +// The value of a dimension. +message AccessDimensionValue { + // The dimension value. For example, this value may be 'France' for the + // 'country' dimension. + string value = 1; +} + +// The value of a metric. +message AccessMetricValue { + // The measurement value. For example, this value may be '13'. + string value = 1; +} + +// Current state of all quotas for this Analytics property. If any quota for a +// property is exhausted, all requests to that property will return Resource +// Exhausted errors. +message AccessQuota { + // Properties can use 250,000 tokens per day. Most requests consume fewer than + // 10 tokens. + AccessQuotaStatus tokens_per_day = 1; + + // Properties can use 50,000 tokens per hour. An API request consumes a single + // number of tokens, and that number is deducted from all of the hourly, + // daily, and per project hourly quotas. + AccessQuotaStatus tokens_per_hour = 2; + + // Properties can use up to 50 concurrent requests. + AccessQuotaStatus concurrent_requests = 3; + + // Properties and cloud project pairs can have up to 50 server errors per + // hour. + AccessQuotaStatus server_errors_per_project_per_hour = 4; + + // Properties can use up to 25% of their tokens per project per hour. This + // amounts to Analytics 360 Properties can use 12,500 tokens per project per + // hour. An API request consumes a single number of tokens, and that number is + // deducted from all of the hourly, daily, and per project hourly quotas. + AccessQuotaStatus tokens_per_project_per_hour = 5; +} + +// Current state for a particular quota group. +message AccessQuotaStatus { + // Quota consumed by this request. + int32 consumed = 1; + + // Quota remaining after this request. + int32 remaining = 2; +} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/analytics_admin.proto b/owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/analytics_admin.proto new file mode 100644 index 00000000000..b8ecfe20e3c --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/analytics_admin.proto @@ -0,0 +1,1517 @@ +// Copyright 2023 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.v1beta; + +import "google/analytics/admin/v1beta/access_report.proto"; +import "google/analytics/admin/v1beta/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/v1beta;admin"; +option java_multiple_files = true; +option java_outer_classname = "AnalyticsAdminProto"; +option java_package = "com.google.analytics.admin.v1beta"; + +// 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.readonly"; + + // Lookup for a single Account. + rpc GetAccount(GetAccountRequest) returns (Account) { + option (google.api.http) = { + get: "/v1beta/{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: "/v1beta/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: "/v1beta/{name=accounts/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an account. + rpc UpdateAccount(UpdateAccountRequest) returns (Account) { + option (google.api.http) = { + patch: "/v1beta/{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: "/v1beta/accounts:provisionAccountTicket" + body: "*" + }; + } + + // Returns summaries of all accounts accessible by the caller. + rpc ListAccountSummaries(ListAccountSummariesRequest) + returns (ListAccountSummariesResponse) { + option (google.api.http) = { + get: "/v1beta/accountSummaries" + }; + } + + // Lookup for a single "GA4" Property. + rpc GetProperty(GetPropertyRequest) returns (Property) { + option (google.api.http) = { + get: "/v1beta/{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: "/v1beta/properties" + }; + } + + // Creates an "GA4" property with the specified location and attributes. + rpc CreateProperty(CreatePropertyRequest) returns (Property) { + option (google.api.http) = { + post: "/v1beta/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 a GA4 Property. + rpc DeleteProperty(DeletePropertyRequest) returns (Property) { + option (google.api.http) = { + delete: "/v1beta/{name=properties/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a property. + rpc UpdateProperty(UpdatePropertyRequest) returns (Property) { + option (google.api.http) = { + patch: "/v1beta/{property.name=properties/*}" + body: "property" + }; + option (google.api.method_signature) = "property,update_mask"; + } + + // Creates a FirebaseLink. + // + // Properties can have at most one FirebaseLink. + rpc CreateFirebaseLink(CreateFirebaseLinkRequest) returns (FirebaseLink) { + option (google.api.http) = { + post: "/v1beta/{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: "/v1beta/{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: "/v1beta/{parent=properties/*}/firebaseLinks" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a GoogleAdsLink. + rpc CreateGoogleAdsLink(CreateGoogleAdsLinkRequest) returns (GoogleAdsLink) { + option (google.api.http) = { + post: "/v1beta/{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: "/v1beta/{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: "/v1beta/{name=properties/*/googleAdsLinks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists GoogleAdsLinks on a property. + rpc ListGoogleAdsLinks(ListGoogleAdsLinksRequest) + returns (ListGoogleAdsLinksResponse) { + option (google.api.http) = { + get: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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 through this API) before MeasurementProtocolSecret resources may be + // created. + rpc AcknowledgeUserDataCollection(AcknowledgeUserDataCollectionRequest) + returns (AcknowledgeUserDataCollectionResponse) { + option (google.api.http) = { + post: "/v1beta/{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: "/v1beta/{account=accounts/*}:searchChangeHistoryEvents" + body: "*" + }; + } + + // Creates a conversion event with the specified attributes. + rpc CreateConversionEvent(CreateConversionEventRequest) + returns (ConversionEvent) { + option (google.api.http) = { + post: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{parent=properties/*}/conversionEvents" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a CustomDimension. + rpc CreateCustomDimension(CreateCustomDimensionRequest) + returns (CustomDimension) { + option (google.api.http) = { + post: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{name=properties/*/customDimensions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a CustomMetric. + rpc CreateCustomMetric(CreateCustomMetricRequest) returns (CustomMetric) { + option (google.api.http) = { + post: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{parent=properties/*}/dataStreams" + }; + option (google.api.method_signature) = "parent"; + } + + // Lookup for a single DataStream. + rpc GetDataStream(GetDataStreamRequest) returns (DataStream) { + option (google.api.http) = { + get: "/v1beta/{name=properties/*/dataStreams/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns a customized report of data access records. The report provides + // records of each time a user reads Google Analytics reporting data. Access + // records are retained for up to 2 years. + // + // Data Access Reports can be requested for a property. The property must be + // in Google Analytics 360. This method is only available to Administrators. + // + // These data access records include GA4 UI Reporting, GA4 UI Explorations, + // GA4 Data API, and other products like Firebase & Admob that can retrieve + // data from Google Analytics through a linkage. These records don't include + // property configuration changes like adding a stream or changing a + // property's time zone. For configuration change history, see + // [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). + rpc RunAccessReport(RunAccessReportRequest) + returns (RunAccessReportResponse) { + option (google.api.http) = { + post: "/v1beta/{entity=properties/*}:runAccessReport" + body: "*" + additional_bindings { + post: "/v1beta/{entity=accounts/*}:runAccessReport" + body: "*" + } + }; + } +} + +// The request for a Data Access Record Report. +message RunAccessReportRequest { + // The Data Access Report supports requesting at the property level or account + // level. If requested at the account level, Data Access Reports include all + // access for all properties under that account. + // + // To request at the property level, entity should be for example + // 'properties/123' if "123" is your GA4 property ID. To request at the + // account level, entity should be for example 'accounts/1234' if "1234" is + // your GA4 Account ID. + string entity = 1; + + // The dimensions requested and displayed in the response. Requests are + // allowed up to 9 dimensions. + repeated AccessDimension dimensions = 2; + + // The metrics requested and displayed in the response. Requests are allowed + // up to 10 metrics. + repeated AccessMetric metrics = 3; + + // Date ranges of access records to read. If multiple date ranges are + // requested, each response row will contain a zero based date range index. If + // two date ranges overlap, the access records for the overlapping days is + // included in the response rows for both date ranges. Requests are allowed up + // to 2 date ranges. + repeated AccessDateRange date_ranges = 4; + + // Dimension filters let you restrict report response to specific + // dimension values which match the filter. For example, filtering on access + // records of a single user. To learn more, see [Fundamentals of Dimension + // Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + // for examples. Metrics cannot be used in this filter. + AccessFilterExpression dimension_filter = 5; + + // Metric filters allow you to restrict report response to specific metric + // values which match the filter. Metric filters are applied after aggregating + // the report's rows, similar to SQL having-clause. Dimensions cannot be used + // in this filter. + AccessFilterExpression metric_filter = 6; + + // The row count of the start row. The first row is counted as row 0. If + // offset is unspecified, it is treated as 0. If offset is zero, then this + // method will return the first page of results with `limit` entries. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int64 offset = 7; + + // The number of rows to return. If unspecified, 10,000 rows are returned. The + // API returns a maximum of 100,000 rows per request, no matter how many you + // ask for. `limit` must be positive. + // + // The API may return fewer rows than the requested `limit`, if there aren't + // as many remaining rows as the `limit`. For instance, there are fewer than + // 300 possible values for the dimension `country`, so when reporting on only + // `country`, you can't get more than 300 rows, even if you set `limit` to a + // higher value. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int64 limit = 8; + + // This request's time zone if specified. If unspecified, the property's time + // zone is used. The request's time zone is used to interpret the start & end + // dates of the report. + // + // Formatted as strings from the IANA Time Zone database + // (https://www.iana.org/time-zones); for example "America/New_York" or + // "Asia/Tokyo". + string time_zone = 9; + + // Specifies how rows are ordered in the response. + repeated AccessOrderBy order_bys = 10; + + // Toggles whether to return the current state of this Analytics Property's + // quota. Quota is returned in [AccessQuota](#AccessQuota). For account-level + // requests, this field must be false. + bool return_entity_quota = 11; +} + +// The customized Data Access Record Report response. +message RunAccessReportResponse { + // The header for a column in the report that corresponds to a specific + // dimension. The number of DimensionHeaders and ordering of DimensionHeaders + // matches the dimensions present in rows. + repeated AccessDimensionHeader dimension_headers = 1; + + // The header for a column in the report that corresponds to a specific + // metric. The number of MetricHeaders and ordering of MetricHeaders matches + // the metrics present in rows. + repeated AccessMetricHeader metric_headers = 2; + + // Rows of dimension value combinations and metric values in the report. + repeated AccessRow rows = 3; + + // The total number of rows in the query result. `rowCount` is independent of + // the number of rows returned in the response, the `limit` request + // parameter, and the `offset` request parameter. For example if a query + // returns 175 rows and includes `limit` of 50 in the API request, the + // response will contain `rowCount` of 175 but only 50 rows. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int32 row_count = 4; + + // The quota state for this Analytics property including this request. This + // field doesn't work with account-level requests. + AccessQuota quota = 5; +} + +// 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 (for example, "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 Cloud 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 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 `ListFirebaseLinks` 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 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 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 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/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/resources.proto b/owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/resources.proto new file mode 100644 index 00000000000..43b299b7f58 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/resources.proto @@ -0,0 +1,922 @@ +// Copyright 2023 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.v1beta; + +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/v1beta;admin"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.analytics.admin.v1beta"; + +// 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; + + // 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; + + // AttributionSettings resource + ATTRIBUTION_SETTINGS = 20; +} + +// Types of Property resources. +enum PropertyType { + // Unknown or unspecified property type + PROPERTY_TYPE_UNSPECIFIED = 0; + + // Ordinary GA4 property + PROPERTY_TYPE_ORDINARY = 1; + + // GA4 subproperty + PROPERTY_TYPE_SUBPROPERTY = 2; + + // GA4 rollup property + PROPERTY_TYPE_ROLLUP = 3; +} + +// 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]; + + // Immutable. The property type for this Property resource. When creating a + // property, if the type is "PROPERTY_TYPE_UNSPECIFIED", then + // "ORDINARY_PROPERTY" will be implied. "SUBPROPERTY" and "ROLLUP_PROPERTY" + // types cannot yet be created with the Google Analytics Admin API. + PropertyType property_type = 14 [(google.api.field_behavior) = IMMUTABLE]; + + // 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}, properties/{property} + // Example: "accounts/100", "properties/101" + 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 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]; +} + +// 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; + + // The property's property type. + PropertyType property_type = 3; + + // Resource name of this property's logical parent. + // + // Note: The Property-Moving UI can be used to change the parent. + // Format: accounts/{account}, properties/{property} + // Example: "accounts/100", "properties/200" + string parent = 4; +} + +// 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}/dataStreams/{dataStream}/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 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 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 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 with + // 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]; +} + +// 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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js new file mode 100644 index 00000000000..6b152cbaca5 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js @@ -0,0 +1,72 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_AcknowledgeUserDataCollection_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_dimension.js new file mode 100644 index 00000000000..6ca0cc1d981 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_dimension.js @@ -0,0 +1,62 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ArchiveCustomDimension_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_metric.js new file mode 100644 index 00000000000..f441178111d --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_metric.js @@ -0,0 +1,62 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ArchiveCustomMetric_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js new file mode 100644 index 00000000000..b63a44b7a36 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js @@ -0,0 +1,67 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateConversionEvent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_dimension.js new file mode 100644 index 00000000000..79e0f4dcbb5 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_dimension.js @@ -0,0 +1,66 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateCustomDimension_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_metric.js new file mode 100644 index 00000000000..722331618d2 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_metric.js @@ -0,0 +1,66 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateCustomMetric_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_data_stream.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_data_stream.js new file mode 100644 index 00000000000..3dbe146e8cf --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_data_stream.js @@ -0,0 +1,66 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateDataStream_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_firebase_link.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_firebase_link.js new file mode 100644 index 00000000000..87bf87fed47 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_firebase_link.js @@ -0,0 +1,67 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateFirebaseLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_google_ads_link.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_google_ads_link.js new file mode 100644 index 00000000000..b58c28ceec4 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_google_ads_link.js @@ -0,0 +1,66 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateGoogleAdsLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_measurement_protocol_secret.js new file mode 100644 index 00000000000..6d9b33ab2ab --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_measurement_protocol_secret.js @@ -0,0 +1,67 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateMeasurementProtocolSecret_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_property.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_property.js new file mode 100644 index 00000000000..e93bfc32f3e --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_property.js @@ -0,0 +1,62 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateProperty_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_account.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_account.js new file mode 100644 index 00000000000..31ece9bd4ba --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_account.js @@ -0,0 +1,63 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_DeleteAccount_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_conversion_event.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_conversion_event.js new file mode 100644 index 00000000000..042ea55e2a7 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_conversion_event.js @@ -0,0 +1,63 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_DeleteConversionEvent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_data_stream.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_data_stream.js new file mode 100644 index 00000000000..104d08127da --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_data_stream.js @@ -0,0 +1,62 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_DeleteDataStream_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_firebase_link.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_firebase_link.js new file mode 100644 index 00000000000..09889812cc0 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_firebase_link.js @@ -0,0 +1,62 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_DeleteFirebaseLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_google_ads_link.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_google_ads_link.js new file mode 100644 index 00000000000..7bf84caacb2 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_google_ads_link.js @@ -0,0 +1,61 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_DeleteGoogleAdsLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_measurement_protocol_secret.js new file mode 100644 index 00000000000..8a04c18a2b1 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_measurement_protocol_secret.js @@ -0,0 +1,63 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_DeleteMeasurementProtocolSecret_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_property.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_property.js new file mode 100644 index 00000000000..760bd01d2e8 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_property.js @@ -0,0 +1,63 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_DeleteProperty_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_account.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_account.js new file mode 100644 index 00000000000..8019f72c04d --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_account.js @@ -0,0 +1,63 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetAccount_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_conversion_event.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_conversion_event.js new file mode 100644 index 00000000000..f999985b055 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_conversion_event.js @@ -0,0 +1,63 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetConversionEvent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_dimension.js new file mode 100644 index 00000000000..e3bbf1d9606 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_dimension.js @@ -0,0 +1,62 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetCustomDimension_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_metric.js new file mode 100644 index 00000000000..2bd9f9383f3 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_metric.js @@ -0,0 +1,62 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetCustomMetric_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_retention_settings.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_retention_settings.js new file mode 100644 index 00000000000..77822fa12c5 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_retention_settings.js @@ -0,0 +1,64 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetDataRetentionSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_sharing_settings.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_sharing_settings.js new file mode 100644 index 00000000000..007bbfbb076 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_sharing_settings.js @@ -0,0 +1,63 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetDataSharingSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_stream.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_stream.js new file mode 100644 index 00000000000..6a97cc695b5 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_stream.js @@ -0,0 +1,62 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetDataStream_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_measurement_protocol_secret.js new file mode 100644 index 00000000000..e22754bb3ad --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_measurement_protocol_secret.js @@ -0,0 +1,63 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_property.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_property.js new file mode 100644 index 00000000000..ea92d2e9c16 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_property.js @@ -0,0 +1,63 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetProperty_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_account_summaries.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_account_summaries.js new file mode 100644 index 00000000000..71a9bcc0103 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_account_summaries.js @@ -0,0 +1,72 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListAccountSummaries_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_accounts.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_accounts.js new file mode 100644 index 00000000000..992a358d88d --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_accounts.js @@ -0,0 +1,78 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListAccounts_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_conversion_events.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_conversion_events.js new file mode 100644 index 00000000000..e0cc416266f --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_conversion_events.js @@ -0,0 +1,77 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListConversionEvents_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_dimensions.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_dimensions.js new file mode 100644 index 00000000000..38f9d0c26be --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_dimensions.js @@ -0,0 +1,76 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListCustomDimensions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_metrics.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_metrics.js new file mode 100644 index 00000000000..9064c52e9ad --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_metrics.js @@ -0,0 +1,76 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListCustomMetrics_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_data_streams.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_data_streams.js new file mode 100644 index 00000000000..ba0f9c2e930 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_data_streams.js @@ -0,0 +1,76 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListDataStreams_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js new file mode 100644 index 00000000000..a444c5aa701 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js @@ -0,0 +1,78 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListFirebaseLinks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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 `ListFirebaseLinks` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_google_ads_links.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_google_ads_links.js new file mode 100644 index 00000000000..bbb5d96f346 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_google_ads_links.js @@ -0,0 +1,76 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListGoogleAdsLinks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js new file mode 100644 index 00000000000..eadb7020873 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js @@ -0,0 +1,78 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_properties.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_properties.js new file mode 100644 index 00000000000..855831b816b --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_properties.js @@ -0,0 +1,97 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListProperties_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js new file mode 100644 index 00000000000..55d6b28696b --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js @@ -0,0 +1,65 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ProvisionAccountTicket_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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 Cloud Console as a Redirect URI. + */ + // const redirectUri = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.run_access_report.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.run_access_report.js new file mode 100644 index 00000000000..f198a8d8b37 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.run_access_report.js @@ -0,0 +1,139 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_RunAccessReport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The Data Access Report supports requesting at the property level or account + * level. If requested at the account level, Data Access Reports include all + * access for all properties under that account. + * To request at the property level, entity should be for example + * 'properties/123' if "123" is your GA4 property ID. To request at the + * account level, entity should be for example 'accounts/1234' if "1234" is + * your GA4 Account ID. + */ + // const entity = 'abc123' + /** + * The dimensions requested and displayed in the response. Requests are + * allowed up to 9 dimensions. + */ + // const dimensions = 1234 + /** + * The metrics requested and displayed in the response. Requests are allowed + * up to 10 metrics. + */ + // const metrics = 1234 + /** + * Date ranges of access records to read. If multiple date ranges are + * requested, each response row will contain a zero based date range index. If + * two date ranges overlap, the access records for the overlapping days is + * included in the response rows for both date ranges. Requests are allowed up + * to 2 date ranges. + */ + // const dateRanges = 1234 + /** + * Dimension filters let you restrict report response to specific + * dimension values which match the filter. For example, filtering on access + * records of a single user. To learn more, see Fundamentals of Dimension + * Filters (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + */ + // const dimensionFilter = {} + /** + * Metric filters allow you to restrict report response to specific metric + * values which match the filter. Metric filters are applied after aggregating + * the report's rows, similar to SQL having-clause. Dimensions cannot be used + * in this filter. + */ + // const metricFilter = {} + /** + * The row count of the start row. The first row is counted as row 0. If + * offset is unspecified, it is treated as 0. If offset is zero, then this + * method will return the first page of results with `limit` entries. + * To learn more about this pagination parameter, see + * Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + */ + // const offset = 1234 + /** + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * The API may return fewer rows than the requested `limit`, if there aren't + * as many remaining rows as the `limit`. For instance, there are fewer than + * 300 possible values for the dimension `country`, so when reporting on only + * `country`, you can't get more than 300 rows, even if you set `limit` to a + * higher value. + * To learn more about this pagination parameter, see + * Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + */ + // const limit = 1234 + /** + * This request's time zone if specified. If unspecified, the property's time + * zone is used. The request's time zone is used to interpret the start & end + * dates of the report. + * Formatted as strings from the IANA Time Zone database + * (https://www.iana.org/time-zones); for example "America/New_York" or + * "Asia/Tokyo". + */ + // const timeZone = 'abc123' + /** + * Specifies how rows are ordered in the response. + */ + // const orderBys = 1234 + /** + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in AccessQuota (#AccessQuota). For account-level + * requests, this field must be false. + */ + // const returnEntityQuota = true + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-cloud/admin').v1beta; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callRunAccessReport() { + // Construct request + const request = { + }; + + // Run request + const response = await adminClient.runAccessReport(request); + console.log(response); + } + + callRunAccessReport(); + // [END analyticsadmin_v1beta_generated_AnalyticsAdminService_RunAccessReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js new file mode 100644 index 00000000000..62edc7851f5 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js @@ -0,0 +1,107 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_SearchChangeHistoryEvents_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_account.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_account.js new file mode 100644 index 00000000000..42a1adc651e --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_account.js @@ -0,0 +1,70 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateAccount_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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 (for example, "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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js new file mode 100644 index 00000000000..bc8726494e8 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js @@ -0,0 +1,67 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateCustomDimension_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js new file mode 100644 index 00000000000..f0de40297ff --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js @@ -0,0 +1,67 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateCustomMetric_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js new file mode 100644 index 00000000000..4dc7e9f52d6 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js @@ -0,0 +1,70 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateDataRetentionSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_stream.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_stream.js new file mode 100644 index 00000000000..f151f9e38dc --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_stream.js @@ -0,0 +1,67 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateDataStream_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js new file mode 100644 index 00000000000..a3177166541 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js @@ -0,0 +1,68 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateGoogleAdsLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_measurement_protocol_secret.js new file mode 100644 index 00000000000..9b9650091fa --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_measurement_protocol_secret.js @@ -0,0 +1,65 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateMeasurementProtocolSecret_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_property.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_property.js new file mode 100644 index 00000000000..c856ef50871 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_property.js @@ -0,0 +1,71 @@ +// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateProperty_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-cloud/admin').v1beta; + + // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json new file mode 100644 index 00000000000..f795dd8bedc --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json @@ -0,0 +1,2155 @@ +{ + "clientLibrary": { + "name": "nodejs-admin", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.analytics.admin.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "regionTag": "analyticsadmin_v1beta_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": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAccount", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetAccount", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1beta.Account", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetAccount", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetAccount", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAccounts", + "fullName": "google.analytics.admin.v1beta.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.v1beta.ListAccountsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListAccounts", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListAccounts", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAccount", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteAccount", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteAccount", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteAccount", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAccount", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateAccount", + "async": true, + "parameters": [ + { + "name": "account", + "type": ".google.analytics.admin.v1beta.Account" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1beta.Account", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateAccount", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateAccount", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ProvisionAccountTicket", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ProvisionAccountTicket", + "async": true, + "parameters": [ + { + "name": "account", + "type": ".google.analytics.admin.v1beta.Account" + }, + { + "name": "redirect_uri", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1beta.ProvisionAccountTicketResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ProvisionAccountTicket", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ProvisionAccountTicket", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAccountSummaries", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListAccountSummaries", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1beta.ListAccountSummariesResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListAccountSummaries", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListAccountSummaries", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProperty", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetProperty", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1beta.Property", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetProperty", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetProperty", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 89, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListProperties", + "fullName": "google.analytics.admin.v1beta.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.v1beta.ListPropertiesResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListProperties", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListProperties", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateProperty", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateProperty", + "async": true, + "parameters": [ + { + "name": "property", + "type": ".google.analytics.admin.v1beta.Property" + } + ], + "resultType": ".google.analytics.admin.v1beta.Property", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateProperty", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateProperty", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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 a GA4 Property.", + "canonical": true, + "file": "analytics_admin_service.delete_property.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteProperty", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteProperty", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1beta.Property", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteProperty", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteProperty", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateProperty", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateProperty", + "async": true, + "parameters": [ + { + "name": "property", + "type": ".google.analytics.admin.v1beta.Property" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1beta.Property", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateProperty", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateProperty", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFirebaseLink", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateFirebaseLink", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "firebase_link", + "type": ".google.analytics.admin.v1beta.FirebaseLink" + } + ], + "resultType": ".google.analytics.admin.v1beta.FirebaseLink", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateFirebaseLink", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateFirebaseLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteFirebaseLink", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteFirebaseLink", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteFirebaseLink", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteFirebaseLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFirebaseLinks", + "fullName": "google.analytics.admin.v1beta.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.v1beta.ListFirebaseLinksResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListFirebaseLinks", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListFirebaseLinks", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGoogleAdsLink", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateGoogleAdsLink", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "google_ads_link", + "type": ".google.analytics.admin.v1beta.GoogleAdsLink" + } + ], + "resultType": ".google.analytics.admin.v1beta.GoogleAdsLink", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateGoogleAdsLink", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateGoogleAdsLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGoogleAdsLink", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateGoogleAdsLink", + "async": true, + "parameters": [ + { + "name": "google_ads_link", + "type": ".google.analytics.admin.v1beta.GoogleAdsLink" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1beta.GoogleAdsLink", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateGoogleAdsLink", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateGoogleAdsLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGoogleAdsLink", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteGoogleAdsLink", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteGoogleAdsLink", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteGoogleAdsLink", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGoogleAdsLinks", + "fullName": "google.analytics.admin.v1beta.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.v1beta.ListGoogleAdsLinksResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListGoogleAdsLinks", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListGoogleAdsLinks", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataSharingSettings", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetDataSharingSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1beta.DataSharingSettings", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetDataSharingSettings", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetDataSharingSettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetMeasurementProtocolSecret", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1beta.MeasurementProtocolSecret", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetMeasurementProtocolSecret", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMeasurementProtocolSecrets", + "fullName": "google.analytics.admin.v1beta.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.v1beta.ListMeasurementProtocolSecretsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListMeasurementProtocolSecrets", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListMeasurementProtocolSecrets", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateMeasurementProtocolSecret", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "measurement_protocol_secret", + "type": ".google.analytics.admin.v1beta.MeasurementProtocolSecret" + } + ], + "resultType": ".google.analytics.admin.v1beta.MeasurementProtocolSecret", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateMeasurementProtocolSecret", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteMeasurementProtocolSecret", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteMeasurementProtocolSecret", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateMeasurementProtocolSecret", + "async": true, + "parameters": [ + { + "name": "measurement_protocol_secret", + "type": ".google.analytics.admin.v1beta.MeasurementProtocolSecret" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1beta.MeasurementProtocolSecret", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateMeasurementProtocolSecret", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateMeasurementProtocolSecret", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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 through 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": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AcknowledgeUserDataCollection", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.AcknowledgeUserDataCollection", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "acknowledgement", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "AcknowledgeUserDataCollection", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.AcknowledgeUserDataCollection", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 99, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchChangeHistoryEvents", + "fullName": "google.analytics.admin.v1beta.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.v1beta.SearchChangeHistoryEventsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "SearchChangeHistoryEvents", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.SearchChangeHistoryEvents", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateConversionEvent", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateConversionEvent", + "async": true, + "parameters": [ + { + "name": "conversion_event", + "type": ".google.analytics.admin.v1beta.ConversionEvent" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1beta.ConversionEvent", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateConversionEvent", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateConversionEvent", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConversionEvent", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetConversionEvent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1beta.ConversionEvent", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetConversionEvent", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetConversionEvent", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteConversionEvent", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteConversionEvent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteConversionEvent", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteConversionEvent", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConversionEvents", + "fullName": "google.analytics.admin.v1beta.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.v1beta.ListConversionEventsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListConversionEvents", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListConversionEvents", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCustomDimension", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateCustomDimension", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "custom_dimension", + "type": ".google.analytics.admin.v1beta.CustomDimension" + } + ], + "resultType": ".google.analytics.admin.v1beta.CustomDimension", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateCustomDimension", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateCustomDimension", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCustomDimension", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateCustomDimension", + "async": true, + "parameters": [ + { + "name": "custom_dimension", + "type": ".google.analytics.admin.v1beta.CustomDimension" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1beta.CustomDimension", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateCustomDimension", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateCustomDimension", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCustomDimensions", + "fullName": "google.analytics.admin.v1beta.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.v1beta.ListCustomDimensionsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListCustomDimensions", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListCustomDimensions", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ArchiveCustomDimension", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ArchiveCustomDimension", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ArchiveCustomDimension", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ArchiveCustomDimension", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCustomDimension", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetCustomDimension", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1beta.CustomDimension", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetCustomDimension", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetCustomDimension", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCustomMetric", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateCustomMetric", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "custom_metric", + "type": ".google.analytics.admin.v1beta.CustomMetric" + } + ], + "resultType": ".google.analytics.admin.v1beta.CustomMetric", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateCustomMetric", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateCustomMetric", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCustomMetric", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateCustomMetric", + "async": true, + "parameters": [ + { + "name": "custom_metric", + "type": ".google.analytics.admin.v1beta.CustomMetric" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1beta.CustomMetric", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateCustomMetric", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateCustomMetric", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCustomMetrics", + "fullName": "google.analytics.admin.v1beta.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.v1beta.ListCustomMetricsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListCustomMetrics", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListCustomMetrics", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ArchiveCustomMetric", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ArchiveCustomMetric", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ArchiveCustomMetric", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ArchiveCustomMetric", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCustomMetric", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetCustomMetric", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1beta.CustomMetric", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetCustomMetric", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetCustomMetric", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataRetentionSettings", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetDataRetentionSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1beta.DataRetentionSettings", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetDataRetentionSettings", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetDataRetentionSettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataRetentionSettings", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateDataRetentionSettings", + "async": true, + "parameters": [ + { + "name": "data_retention_settings", + "type": ".google.analytics.admin.v1beta.DataRetentionSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1beta.DataRetentionSettings", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateDataRetentionSettings", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateDataRetentionSettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDataStream", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateDataStream", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "data_stream", + "type": ".google.analytics.admin.v1beta.DataStream" + } + ], + "resultType": ".google.analytics.admin.v1beta.DataStream", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "CreateDataStream", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateDataStream", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDataStream", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteDataStream", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "DeleteDataStream", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteDataStream", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataStream", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateDataStream", + "async": true, + "parameters": [ + { + "name": "data_stream", + "type": ".google.analytics.admin.v1beta.DataStream" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.analytics.admin.v1beta.DataStream", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "UpdateDataStream", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateDataStream", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDataStreams", + "fullName": "google.analytics.admin.v1beta.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.v1beta.ListDataStreamsResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "ListDataStreams", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListDataStreams", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_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": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataStream", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetDataStream", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1beta.DataStream", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetDataStream", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetDataStream", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + }, + { + "regionTag": "analyticsadmin_v1beta_generated_AnalyticsAdminService_RunAccessReport_async", + "title": "AnalyticsAdminService runAccessReport Sample", + "origin": "API_DEFINITION", + "description": " Returns a customized report of data access records. The report provides records of each time a user reads Google Analytics reporting data. Access records are retained for up to 2 years. Data Access Reports can be requested for a property. The property must be in Google Analytics 360. This method is only available to Administrators. These data access records include GA4 UI Reporting, GA4 UI Explorations, GA4 Data API, and other products like Firebase & Admob that can retrieve data from Google Analytics through a linkage. These records don't include property configuration changes like adding a stream or changing a property's time zone. For configuration change history, see [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).", + "canonical": true, + "file": "analytics_admin_service.run_access_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 131, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunAccessReport", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.RunAccessReport", + "async": true, + "parameters": [ + { + "name": "entity", + "type": "TYPE_STRING" + }, + { + "name": "dimensions", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "metrics", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "date_ranges", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "dimension_filter", + "type": ".google.analytics.admin.v1beta.AccessFilterExpression" + }, + { + "name": "metric_filter", + "type": ".google.analytics.admin.v1beta.AccessFilterExpression" + }, + { + "name": "offset", + "type": "TYPE_INT64" + }, + { + "name": "limit", + "type": "TYPE_INT64" + }, + { + "name": "time_zone", + "type": "TYPE_STRING" + }, + { + "name": "order_bys", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "return_entity_quota", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.analytics.admin.v1beta.RunAccessReportResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "RunAccessReport", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.RunAccessReport", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/src/index.ts b/owl-bot-staging/google-analytics-admin/v1beta/src/index.ts new file mode 100644 index 00000000000..a21de875bdd --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta from './v1beta'; +const AnalyticsAdminServiceClient = v1beta.AnalyticsAdminServiceClient; +type AnalyticsAdminServiceClient = v1beta.AnalyticsAdminServiceClient; +export {v1beta, AnalyticsAdminServiceClient}; +export default {v1beta, AnalyticsAdminServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client.ts b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client.ts new file mode 100644 index 00000000000..0f27b716ed8 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client.ts @@ -0,0 +1,5766 @@ +// Copyright 2023 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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta/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 v1beta + */ +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}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AnalyticsAdminServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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}' + ), + 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}' + ), + firebaseLinkPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/firebaseLinks/{firebase_link}' + ), + googleAdsLinkPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/googleAdsLinks/{google_ads_link}' + ), + measurementProtocolSecretPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/dataStreams/{data_stream}/measurementProtocolSecrets/{measurement_protocol_secret}' + ), + propertyPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}' + ), + }; + + // 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'), + 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'), + 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.v1beta.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 = this._gaxModule.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.v1beta.AnalyticsAdminService. + this.analyticsAdminServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.analytics.admin.v1beta.AnalyticsAdminService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.analytics.admin.v1beta.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', 'createFirebaseLink', 'deleteFirebaseLink', 'listFirebaseLinks', 'createGoogleAdsLink', 'updateGoogleAdsLink', 'deleteGoogleAdsLink', 'listGoogleAdsLinks', 'getDataSharingSettings', 'getMeasurementProtocolSecret', 'listMeasurementProtocolSecrets', 'createMeasurementProtocolSecret', 'deleteMeasurementProtocolSecret', 'updateMeasurementProtocolSecret', 'acknowledgeUserDataCollection', 'searchChangeHistoryEvents', 'createConversionEvent', 'getConversionEvent', 'deleteConversionEvent', 'listConversionEvents', 'createCustomDimension', 'updateCustomDimension', 'listCustomDimensions', 'archiveCustomDimension', 'getCustomDimension', 'createCustomMetric', 'updateCustomMetric', 'listCustomMetrics', 'archiveCustomMetric', 'getCustomMetric', 'getDataRetentionSettings', 'updateDataRetentionSettings', 'createDataStream', 'deleteDataStream', 'updateDataStream', 'listDataStreams', 'getDataStream', 'runAccessReport']; + 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._opts.fallback + ); + + 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.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 {@link google.analytics.admin.v1beta.Account | 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/v1beta/analytics_admin_service.get_account.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetAccount_async + */ + getAccount( + request?: protos.google.analytics.admin.v1beta.IGetAccountRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IAccount, + protos.google.analytics.admin.v1beta.IGetAccountRequest|undefined, {}|undefined + ]>; + getAccount( + request: protos.google.analytics.admin.v1beta.IGetAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IAccount, + protos.google.analytics.admin.v1beta.IGetAccountRequest|null|undefined, + {}|null|undefined>): void; + getAccount( + request: protos.google.analytics.admin.v1beta.IGetAccountRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IAccount, + protos.google.analytics.admin.v1beta.IGetAccountRequest|null|undefined, + {}|null|undefined>): void; + getAccount( + request?: protos.google.analytics.admin.v1beta.IGetAccountRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IAccount, + protos.google.analytics.admin.v1beta.IGetAccountRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IAccount, + protos.google.analytics.admin.v1beta.IGetAccountRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IAccount, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.delete_account.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteAccount_async + */ + deleteAccount( + request?: protos.google.analytics.admin.v1beta.IDeleteAccountRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteAccountRequest|undefined, {}|undefined + ]>; + deleteAccount( + request: protos.google.analytics.admin.v1beta.IDeleteAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteAccountRequest|null|undefined, + {}|null|undefined>): void; + deleteAccount( + request: protos.google.analytics.admin.v1beta.IDeleteAccountRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteAccountRequest|null|undefined, + {}|null|undefined>): void; + deleteAccount( + request?: protos.google.analytics.admin.v1beta.IDeleteAccountRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteAccountRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteAccountRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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.v1beta.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 (for example, "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 {@link google.analytics.admin.v1beta.Account | 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/v1beta/analytics_admin_service.update_account.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateAccount_async + */ + updateAccount( + request?: protos.google.analytics.admin.v1beta.IUpdateAccountRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IAccount, + protos.google.analytics.admin.v1beta.IUpdateAccountRequest|undefined, {}|undefined + ]>; + updateAccount( + request: protos.google.analytics.admin.v1beta.IUpdateAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IAccount, + protos.google.analytics.admin.v1beta.IUpdateAccountRequest|null|undefined, + {}|null|undefined>): void; + updateAccount( + request: protos.google.analytics.admin.v1beta.IUpdateAccountRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IAccount, + protos.google.analytics.admin.v1beta.IUpdateAccountRequest|null|undefined, + {}|null|undefined>): void; + updateAccount( + request?: protos.google.analytics.admin.v1beta.IUpdateAccountRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IAccount, + protos.google.analytics.admin.v1beta.IUpdateAccountRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IAccount, + protos.google.analytics.admin.v1beta.IUpdateAccountRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IAccount, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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.v1beta.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 Cloud 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 {@link google.analytics.admin.v1beta.ProvisionAccountTicketResponse | 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/v1beta/analytics_admin_service.provision_account_ticket.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ProvisionAccountTicket_async + */ + provisionAccountTicket( + request?: protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse, + protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest|undefined, {}|undefined + ]>; + provisionAccountTicket( + request: protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse, + protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest|null|undefined, + {}|null|undefined>): void; + provisionAccountTicket( + request: protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse, + protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest|null|undefined, + {}|null|undefined>): void; + provisionAccountTicket( + request?: protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse, + protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse, + protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse, + protos.google.analytics.admin.v1beta.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 {@link google.analytics.admin.v1beta.Property | 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/v1beta/analytics_admin_service.get_property.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetProperty_async + */ + getProperty( + request?: protos.google.analytics.admin.v1beta.IGetPropertyRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IGetPropertyRequest|undefined, {}|undefined + ]>; + getProperty( + request: protos.google.analytics.admin.v1beta.IGetPropertyRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IGetPropertyRequest|null|undefined, + {}|null|undefined>): void; + getProperty( + request: protos.google.analytics.admin.v1beta.IGetPropertyRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IGetPropertyRequest|null|undefined, + {}|null|undefined>): void; + getProperty( + request?: protos.google.analytics.admin.v1beta.IGetPropertyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IGetPropertyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IGetPropertyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.Property | 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/v1beta/analytics_admin_service.create_property.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateProperty_async + */ + createProperty( + request?: protos.google.analytics.admin.v1beta.ICreatePropertyRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.ICreatePropertyRequest|undefined, {}|undefined + ]>; + createProperty( + request: protos.google.analytics.admin.v1beta.ICreatePropertyRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.ICreatePropertyRequest|null|undefined, + {}|null|undefined>): void; + createProperty( + request: protos.google.analytics.admin.v1beta.ICreatePropertyRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.ICreatePropertyRequest|null|undefined, + {}|null|undefined>): void; + createProperty( + request?: protos.google.analytics.admin.v1beta.ICreatePropertyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.ICreatePropertyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.ICreatePropertyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.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 a 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 {@link google.analytics.admin.v1beta.Property | 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/v1beta/analytics_admin_service.delete_property.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteProperty_async + */ + deleteProperty( + request?: protos.google.analytics.admin.v1beta.IDeletePropertyRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IDeletePropertyRequest|undefined, {}|undefined + ]>; + deleteProperty( + request: protos.google.analytics.admin.v1beta.IDeletePropertyRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IDeletePropertyRequest|null|undefined, + {}|null|undefined>): void; + deleteProperty( + request: protos.google.analytics.admin.v1beta.IDeletePropertyRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IDeletePropertyRequest|null|undefined, + {}|null|undefined>): void; + deleteProperty( + request?: protos.google.analytics.admin.v1beta.IDeletePropertyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IDeletePropertyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IDeletePropertyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.Property | 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/v1beta/analytics_admin_service.update_property.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateProperty_async + */ + updateProperty( + request?: protos.google.analytics.admin.v1beta.IUpdatePropertyRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IUpdatePropertyRequest|undefined, {}|undefined + ]>; + updateProperty( + request: protos.google.analytics.admin.v1beta.IUpdatePropertyRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IUpdatePropertyRequest|null|undefined, + {}|null|undefined>): void; + updateProperty( + request: protos.google.analytics.admin.v1beta.IUpdatePropertyRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IUpdatePropertyRequest|null|undefined, + {}|null|undefined>): void; + updateProperty( + request?: protos.google.analytics.admin.v1beta.IUpdatePropertyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IUpdatePropertyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IUpdatePropertyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'property.name': request.property!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateProperty(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.v1beta.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 {@link google.analytics.admin.v1beta.FirebaseLink | 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/v1beta/analytics_admin_service.create_firebase_link.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateFirebaseLink_async + */ + createFirebaseLink( + request?: protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IFirebaseLink, + protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest|undefined, {}|undefined + ]>; + createFirebaseLink( + request: protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IFirebaseLink, + protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest|null|undefined, + {}|null|undefined>): void; + createFirebaseLink( + request: protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IFirebaseLink, + protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest|null|undefined, + {}|null|undefined>): void; + createFirebaseLink( + request?: protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IFirebaseLink, + protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IFirebaseLink, + protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IFirebaseLink, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.delete_firebase_link.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteFirebaseLink_async + */ + deleteFirebaseLink( + request?: protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest|undefined, {}|undefined + ]>; + deleteFirebaseLink( + request: protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest|null|undefined, + {}|null|undefined>): void; + deleteFirebaseLink( + request: protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest|null|undefined, + {}|null|undefined>): void; + deleteFirebaseLink( + request?: protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteFirebaseLink(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.v1beta.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 {@link google.analytics.admin.v1beta.GoogleAdsLink | 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/v1beta/analytics_admin_service.create_google_ads_link.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateGoogleAdsLink_async + */ + createGoogleAdsLink( + request?: protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest|undefined, {}|undefined + ]>; + createGoogleAdsLink( + request: protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): void; + createGoogleAdsLink( + request: protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): void; + createGoogleAdsLink( + request?: protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.GoogleAdsLink | 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/v1beta/analytics_admin_service.update_google_ads_link.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateGoogleAdsLink_async + */ + updateGoogleAdsLink( + request?: protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest|undefined, {}|undefined + ]>; + updateGoogleAdsLink( + request: protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): void; + updateGoogleAdsLink( + request: protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): void; + updateGoogleAdsLink( + request?: protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.delete_google_ads_link.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteGoogleAdsLink_async + */ + deleteGoogleAdsLink( + request?: protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest|undefined, {}|undefined + ]>; + deleteGoogleAdsLink( + request: protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): void; + deleteGoogleAdsLink( + request: protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): void; + deleteGoogleAdsLink( + request?: protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.DataSharingSettings | 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/v1beta/analytics_admin_service.get_data_sharing_settings.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetDataSharingSettings_async + */ + getDataSharingSettings( + request?: protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IDataSharingSettings, + protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest|undefined, {}|undefined + ]>; + getDataSharingSettings( + request: protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IDataSharingSettings, + protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest|null|undefined, + {}|null|undefined>): void; + getDataSharingSettings( + request: protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IDataSharingSettings, + protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest|null|undefined, + {}|null|undefined>): void; + getDataSharingSettings( + request?: protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IDataSharingSettings, + protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IDataSharingSettings, + protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IDataSharingSettings, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.MeasurementProtocolSecret | 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/v1beta/analytics_admin_service.get_measurement_protocol_secret.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_async + */ + getMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest|undefined, {}|undefined + ]>; + getMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + getMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + getMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.MeasurementProtocolSecret | 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/v1beta/analytics_admin_service.create_measurement_protocol_secret.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateMeasurementProtocolSecret_async + */ + createMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest|undefined, {}|undefined + ]>; + createMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + createMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + createMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.delete_measurement_protocol_secret.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteMeasurementProtocolSecret_async + */ + deleteMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest|undefined, {}|undefined + ]>; + deleteMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + deleteMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + deleteMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.MeasurementProtocolSecret | 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/v1beta/analytics_admin_service.update_measurement_protocol_secret.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateMeasurementProtocolSecret_async + */ + updateMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest|undefined, {}|undefined + ]>; + updateMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + updateMeasurementProtocolSecret( + request: protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): void; + updateMeasurementProtocolSecret( + request?: protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 through 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 {@link google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse | 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/v1beta/analytics_admin_service.acknowledge_user_data_collection.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_AcknowledgeUserDataCollection_async + */ + acknowledgeUserDataCollection( + request?: protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse, + protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest|undefined, {}|undefined + ]>; + acknowledgeUserDataCollection( + request: protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse, + protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest|null|undefined, + {}|null|undefined>): void; + acknowledgeUserDataCollection( + request: protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse, + protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest|null|undefined, + {}|null|undefined>): void; + acknowledgeUserDataCollection( + request?: protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse, + protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse, + protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'property': request.property ?? '', + }); + this.initialize(); + return this.innerApiCalls.acknowledgeUserDataCollection(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.v1beta.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 {@link google.analytics.admin.v1beta.ConversionEvent | 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/v1beta/analytics_admin_service.create_conversion_event.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateConversionEvent_async + */ + createConversionEvent( + request?: protos.google.analytics.admin.v1beta.ICreateConversionEventRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IConversionEvent, + protos.google.analytics.admin.v1beta.ICreateConversionEventRequest|undefined, {}|undefined + ]>; + createConversionEvent( + request: protos.google.analytics.admin.v1beta.ICreateConversionEventRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IConversionEvent, + protos.google.analytics.admin.v1beta.ICreateConversionEventRequest|null|undefined, + {}|null|undefined>): void; + createConversionEvent( + request: protos.google.analytics.admin.v1beta.ICreateConversionEventRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IConversionEvent, + protos.google.analytics.admin.v1beta.ICreateConversionEventRequest|null|undefined, + {}|null|undefined>): void; + createConversionEvent( + request?: protos.google.analytics.admin.v1beta.ICreateConversionEventRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IConversionEvent, + protos.google.analytics.admin.v1beta.ICreateConversionEventRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IConversionEvent, + protos.google.analytics.admin.v1beta.ICreateConversionEventRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IConversionEvent, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.ConversionEvent | 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/v1beta/analytics_admin_service.get_conversion_event.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetConversionEvent_async + */ + getConversionEvent( + request?: protos.google.analytics.admin.v1beta.IGetConversionEventRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IConversionEvent, + protos.google.analytics.admin.v1beta.IGetConversionEventRequest|undefined, {}|undefined + ]>; + getConversionEvent( + request: protos.google.analytics.admin.v1beta.IGetConversionEventRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IConversionEvent, + protos.google.analytics.admin.v1beta.IGetConversionEventRequest|null|undefined, + {}|null|undefined>): void; + getConversionEvent( + request: protos.google.analytics.admin.v1beta.IGetConversionEventRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IConversionEvent, + protos.google.analytics.admin.v1beta.IGetConversionEventRequest|null|undefined, + {}|null|undefined>): void; + getConversionEvent( + request?: protos.google.analytics.admin.v1beta.IGetConversionEventRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IConversionEvent, + protos.google.analytics.admin.v1beta.IGetConversionEventRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IConversionEvent, + protos.google.analytics.admin.v1beta.IGetConversionEventRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IConversionEvent, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.delete_conversion_event.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteConversionEvent_async + */ + deleteConversionEvent( + request?: protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest|undefined, {}|undefined + ]>; + deleteConversionEvent( + request: protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest|null|undefined, + {}|null|undefined>): void; + deleteConversionEvent( + request: protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest|null|undefined, + {}|null|undefined>): void; + deleteConversionEvent( + request?: protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteConversionEvent(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.v1beta.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 {@link google.analytics.admin.v1beta.CustomDimension | 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/v1beta/analytics_admin_service.create_custom_dimension.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateCustomDimension_async + */ + createCustomDimension( + request?: protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest|undefined, {}|undefined + ]>; + createCustomDimension( + request: protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + createCustomDimension( + request: protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + createCustomDimension( + request?: protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.CustomDimension | 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/v1beta/analytics_admin_service.update_custom_dimension.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateCustomDimension_async + */ + updateCustomDimension( + request?: protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest|undefined, {}|undefined + ]>; + updateCustomDimension( + request: protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + updateCustomDimension( + request: protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + updateCustomDimension( + request?: protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.archive_custom_dimension.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ArchiveCustomDimension_async + */ + archiveCustomDimension( + request?: protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest|undefined, {}|undefined + ]>; + archiveCustomDimension( + request: protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + archiveCustomDimension( + request: protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + archiveCustomDimension( + request?: protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.CustomDimension | 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/v1beta/analytics_admin_service.get_custom_dimension.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetCustomDimension_async + */ + getCustomDimension( + request?: protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest|undefined, {}|undefined + ]>; + getCustomDimension( + request: protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + getCustomDimension( + request: protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest|null|undefined, + {}|null|undefined>): void; + getCustomDimension( + request?: protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomDimension, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.CustomMetric | 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/v1beta/analytics_admin_service.create_custom_metric.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateCustomMetric_async + */ + createCustomMetric( + request?: protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest|undefined, {}|undefined + ]>; + createCustomMetric( + request: protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + createCustomMetric( + request: protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + createCustomMetric( + request?: protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.CustomMetric | 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/v1beta/analytics_admin_service.update_custom_metric.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateCustomMetric_async + */ + updateCustomMetric( + request?: protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest|undefined, {}|undefined + ]>; + updateCustomMetric( + request: protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + updateCustomMetric( + request: protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + updateCustomMetric( + request?: protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.archive_custom_metric.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ArchiveCustomMetric_async + */ + archiveCustomMetric( + request?: protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest|undefined, {}|undefined + ]>; + archiveCustomMetric( + request: protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + archiveCustomMetric( + request: protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + archiveCustomMetric( + request?: protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.CustomMetric | 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/v1beta/analytics_admin_service.get_custom_metric.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetCustomMetric_async + */ + getCustomMetric( + request?: protos.google.analytics.admin.v1beta.IGetCustomMetricRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.IGetCustomMetricRequest|undefined, {}|undefined + ]>; + getCustomMetric( + request: protos.google.analytics.admin.v1beta.IGetCustomMetricRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.IGetCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + getCustomMetric( + request: protos.google.analytics.admin.v1beta.IGetCustomMetricRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.IGetCustomMetricRequest|null|undefined, + {}|null|undefined>): void; + getCustomMetric( + request?: protos.google.analytics.admin.v1beta.IGetCustomMetricRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.IGetCustomMetricRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.IGetCustomMetricRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomMetric, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.DataRetentionSettings | 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/v1beta/analytics_admin_service.get_data_retention_settings.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetDataRetentionSettings_async + */ + getDataRetentionSettings( + request?: protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest|undefined, {}|undefined + ]>; + getDataRetentionSettings( + request: protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>): void; + getDataRetentionSettings( + request: protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>): void; + getDataRetentionSettings( + request?: protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.DataRetentionSettings | 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/v1beta/analytics_admin_service.update_data_retention_settings.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateDataRetentionSettings_async + */ + updateDataRetentionSettings( + request?: protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest|undefined, {}|undefined + ]>; + updateDataRetentionSettings( + request: protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>): void; + updateDataRetentionSettings( + request: protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>): void; + updateDataRetentionSettings( + request?: protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.DataStream | 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/v1beta/analytics_admin_service.create_data_stream.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateDataStream_async + */ + createDataStream( + request?: protos.google.analytics.admin.v1beta.ICreateDataStreamRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.ICreateDataStreamRequest|undefined, {}|undefined + ]>; + createDataStream( + request: protos.google.analytics.admin.v1beta.ICreateDataStreamRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.ICreateDataStreamRequest|null|undefined, + {}|null|undefined>): void; + createDataStream( + request: protos.google.analytics.admin.v1beta.ICreateDataStreamRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.ICreateDataStreamRequest|null|undefined, + {}|null|undefined>): void; + createDataStream( + request?: protos.google.analytics.admin.v1beta.ICreateDataStreamRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.ICreateDataStreamRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.ICreateDataStreamRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.delete_data_stream.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteDataStream_async + */ + deleteDataStream( + request?: protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest|undefined, {}|undefined + ]>; + deleteDataStream( + request: protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest|null|undefined, + {}|null|undefined>): void; + deleteDataStream( + request: protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest|null|undefined, + {}|null|undefined>): void; + deleteDataStream( + request?: protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.DataStream | 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/v1beta/analytics_admin_service.update_data_stream.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateDataStream_async + */ + updateDataStream( + request?: protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest|undefined, {}|undefined + ]>; + updateDataStream( + request: protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest|null|undefined, + {}|null|undefined>): void; + updateDataStream( + request: protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest|null|undefined, + {}|null|undefined>): void; + updateDataStream( + request?: protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.DataStream | 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/v1beta/analytics_admin_service.get_data_stream.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetDataStream_async + */ + getDataStream( + request?: protos.google.analytics.admin.v1beta.IGetDataStreamRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.IGetDataStreamRequest|undefined, {}|undefined + ]>; + getDataStream( + request: protos.google.analytics.admin.v1beta.IGetDataStreamRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.IGetDataStreamRequest|null|undefined, + {}|null|undefined>): void; + getDataStream( + request: protos.google.analytics.admin.v1beta.IGetDataStreamRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.IGetDataStreamRequest|null|undefined, + {}|null|undefined>): void; + getDataStream( + request?: protos.google.analytics.admin.v1beta.IGetDataStreamRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.IGetDataStreamRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.IGetDataStreamRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IDataStream, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getDataStream(request, options, callback); + } +/** + * Returns a customized report of data access records. The report provides + * records of each time a user reads Google Analytics reporting data. Access + * records are retained for up to 2 years. + * + * Data Access Reports can be requested for a property. The property must be + * in Google Analytics 360. This method is only available to Administrators. + * + * These data access records include GA4 UI Reporting, GA4 UI Explorations, + * GA4 Data API, and other products like Firebase & Admob that can retrieve + * data from Google Analytics through a linkage. These records don't include + * property configuration changes like adding a stream or changing a + * property's time zone. For configuration change history, see + * [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.entity + * The Data Access Report supports requesting at the property level or account + * level. If requested at the account level, Data Access Reports include all + * access for all properties under that account. + * + * To request at the property level, entity should be for example + * 'properties/123' if "123" is your GA4 property ID. To request at the + * account level, entity should be for example 'accounts/1234' if "1234" is + * your GA4 Account ID. + * @param {number[]} request.dimensions + * The dimensions requested and displayed in the response. Requests are + * allowed up to 9 dimensions. + * @param {number[]} request.metrics + * The metrics requested and displayed in the response. Requests are allowed + * up to 10 metrics. + * @param {number[]} request.dateRanges + * Date ranges of access records to read. If multiple date ranges are + * requested, each response row will contain a zero based date range index. If + * two date ranges overlap, the access records for the overlapping days is + * included in the response rows for both date ranges. Requests are allowed up + * to 2 date ranges. + * @param {google.analytics.admin.v1beta.AccessFilterExpression} request.dimensionFilter + * Dimension filters let you restrict report response to specific + * dimension values which match the filter. For example, filtering on access + * records of a single user. To learn more, see [Fundamentals of Dimension + * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + * @param {google.analytics.admin.v1beta.AccessFilterExpression} request.metricFilter + * Metric filters allow you to restrict report response to specific metric + * values which match the filter. Metric filters are applied after aggregating + * the report's rows, similar to SQL having-clause. Dimensions cannot be used + * in this filter. + * @param {number} request.offset + * The row count of the start row. The first row is counted as row 0. If + * offset is unspecified, it is treated as 0. If offset is zero, then this + * method will return the first page of results with `limit` entries. + * + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * @param {number} request.limit + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * + * The API may return fewer rows than the requested `limit`, if there aren't + * as many remaining rows as the `limit`. For instance, there are fewer than + * 300 possible values for the dimension `country`, so when reporting on only + * `country`, you can't get more than 300 rows, even if you set `limit` to a + * higher value. + * + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * @param {string} request.timeZone + * This request's time zone if specified. If unspecified, the property's time + * zone is used. The request's time zone is used to interpret the start & end + * dates of the report. + * + * Formatted as strings from the IANA Time Zone database + * (https://www.iana.org/time-zones); for example "America/New_York" or + * "Asia/Tokyo". + * @param {number[]} request.orderBys + * Specifies how rows are ordered in the response. + * @param {boolean} request.returnEntityQuota + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in [AccessQuota](#AccessQuota). For account-level + * requests, this field must be false. + * @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 {@link google.analytics.admin.v1beta.RunAccessReportResponse | RunAccessReportResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/analytics_admin_service.run_access_report.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_RunAccessReport_async + */ + runAccessReport( + request?: protos.google.analytics.admin.v1beta.IRunAccessReportRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IRunAccessReportResponse, + protos.google.analytics.admin.v1beta.IRunAccessReportRequest|undefined, {}|undefined + ]>; + runAccessReport( + request: protos.google.analytics.admin.v1beta.IRunAccessReportRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IRunAccessReportResponse, + protos.google.analytics.admin.v1beta.IRunAccessReportRequest|null|undefined, + {}|null|undefined>): void; + runAccessReport( + request: protos.google.analytics.admin.v1beta.IRunAccessReportRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IRunAccessReportResponse, + protos.google.analytics.admin.v1beta.IRunAccessReportRequest|null|undefined, + {}|null|undefined>): void; + runAccessReport( + request?: protos.google.analytics.admin.v1beta.IRunAccessReportRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1beta.IRunAccessReportResponse, + protos.google.analytics.admin.v1beta.IRunAccessReportRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1beta.IRunAccessReportResponse, + protos.google.analytics.admin.v1beta.IRunAccessReportRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1beta.IRunAccessReportResponse, + protos.google.analytics.admin.v1beta.IRunAccessReportRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'entity': request.entity ?? '', + }); + this.initialize(); + return this.innerApiCalls.runAccessReport(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 {@link google.analytics.admin.v1beta.Account | 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.v1beta.IListAccountsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IAccount[], + protos.google.analytics.admin.v1beta.IListAccountsRequest|null, + protos.google.analytics.admin.v1beta.IListAccountsResponse + ]>; + listAccounts( + request: protos.google.analytics.admin.v1beta.IListAccountsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListAccountsRequest, + protos.google.analytics.admin.v1beta.IListAccountsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IAccount>): void; + listAccounts( + request: protos.google.analytics.admin.v1beta.IListAccountsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListAccountsRequest, + protos.google.analytics.admin.v1beta.IListAccountsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IAccount>): void; + listAccounts( + request?: protos.google.analytics.admin.v1beta.IListAccountsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1beta.IListAccountsRequest, + protos.google.analytics.admin.v1beta.IListAccountsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IAccount>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1beta.IListAccountsRequest, + protos.google.analytics.admin.v1beta.IListAccountsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IAccount>): + Promise<[ + protos.google.analytics.admin.v1beta.IAccount[], + protos.google.analytics.admin.v1beta.IListAccountsRequest|null, + protos.google.analytics.admin.v1beta.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 {@link google.analytics.admin.v1beta.Account | 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.v1beta.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 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 + * {@link google.analytics.admin.v1beta.Account | 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/v1beta/analytics_admin_service.list_accounts.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListAccounts_async + */ + listAccountsAsync( + request?: protos.google.analytics.admin.v1beta.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 {}, + 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 {@link google.analytics.admin.v1beta.AccountSummary | 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.v1beta.IListAccountSummariesRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IAccountSummary[], + protos.google.analytics.admin.v1beta.IListAccountSummariesRequest|null, + protos.google.analytics.admin.v1beta.IListAccountSummariesResponse + ]>; + listAccountSummaries( + request: protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, + protos.google.analytics.admin.v1beta.IListAccountSummariesResponse|null|undefined, + protos.google.analytics.admin.v1beta.IAccountSummary>): void; + listAccountSummaries( + request: protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, + protos.google.analytics.admin.v1beta.IListAccountSummariesResponse|null|undefined, + protos.google.analytics.admin.v1beta.IAccountSummary>): void; + listAccountSummaries( + request?: protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, + protos.google.analytics.admin.v1beta.IListAccountSummariesResponse|null|undefined, + protos.google.analytics.admin.v1beta.IAccountSummary>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, + protos.google.analytics.admin.v1beta.IListAccountSummariesResponse|null|undefined, + protos.google.analytics.admin.v1beta.IAccountSummary>): + Promise<[ + protos.google.analytics.admin.v1beta.IAccountSummary[], + protos.google.analytics.admin.v1beta.IListAccountSummariesRequest|null, + protos.google.analytics.admin.v1beta.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 {@link google.analytics.admin.v1beta.AccountSummary | 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.v1beta.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 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 + * {@link google.analytics.admin.v1beta.AccountSummary | 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/v1beta/analytics_admin_service.list_account_summaries.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListAccountSummaries_async + */ + listAccountSummariesAsync( + request?: protos.google.analytics.admin.v1beta.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 {}, + 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 {@link google.analytics.admin.v1beta.Property | 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.v1beta.IListPropertiesRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IProperty[], + protos.google.analytics.admin.v1beta.IListPropertiesRequest|null, + protos.google.analytics.admin.v1beta.IListPropertiesResponse + ]>; + listProperties( + request: protos.google.analytics.admin.v1beta.IListPropertiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListPropertiesRequest, + protos.google.analytics.admin.v1beta.IListPropertiesResponse|null|undefined, + protos.google.analytics.admin.v1beta.IProperty>): void; + listProperties( + request: protos.google.analytics.admin.v1beta.IListPropertiesRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListPropertiesRequest, + protos.google.analytics.admin.v1beta.IListPropertiesResponse|null|undefined, + protos.google.analytics.admin.v1beta.IProperty>): void; + listProperties( + request?: protos.google.analytics.admin.v1beta.IListPropertiesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1beta.IListPropertiesRequest, + protos.google.analytics.admin.v1beta.IListPropertiesResponse|null|undefined, + protos.google.analytics.admin.v1beta.IProperty>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1beta.IListPropertiesRequest, + protos.google.analytics.admin.v1beta.IListPropertiesResponse|null|undefined, + protos.google.analytics.admin.v1beta.IProperty>): + Promise<[ + protos.google.analytics.admin.v1beta.IProperty[], + protos.google.analytics.admin.v1beta.IListPropertiesRequest|null, + protos.google.analytics.admin.v1beta.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 {@link google.analytics.admin.v1beta.Property | 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.v1beta.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 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 + * {@link google.analytics.admin.v1beta.Property | 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/v1beta/analytics_admin_service.list_properties.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListProperties_async + */ + listPropertiesAsync( + request?: protos.google.analytics.admin.v1beta.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 {}, + 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 `ListFirebaseLinks` 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 {@link google.analytics.admin.v1beta.FirebaseLink | 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.v1beta.IListFirebaseLinksRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IFirebaseLink[], + protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest|null, + protos.google.analytics.admin.v1beta.IListFirebaseLinksResponse + ]>; + listFirebaseLinks( + request: protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, + protos.google.analytics.admin.v1beta.IListFirebaseLinksResponse|null|undefined, + protos.google.analytics.admin.v1beta.IFirebaseLink>): void; + listFirebaseLinks( + request: protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, + protos.google.analytics.admin.v1beta.IListFirebaseLinksResponse|null|undefined, + protos.google.analytics.admin.v1beta.IFirebaseLink>): void; + listFirebaseLinks( + request?: protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, + protos.google.analytics.admin.v1beta.IListFirebaseLinksResponse|null|undefined, + protos.google.analytics.admin.v1beta.IFirebaseLink>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, + protos.google.analytics.admin.v1beta.IListFirebaseLinksResponse|null|undefined, + protos.google.analytics.admin.v1beta.IFirebaseLink>): + Promise<[ + protos.google.analytics.admin.v1beta.IFirebaseLink[], + protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest|null, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 `ListFirebaseLinks` 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 {@link google.analytics.admin.v1beta.FirebaseLink | 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.v1beta.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' + ] = this._gaxModule.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 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 `ListFirebaseLinks` 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 + * {@link google.analytics.admin.v1beta.FirebaseLink | 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/v1beta/analytics_admin_service.list_firebase_links.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListFirebaseLinks_async + */ + listFirebaseLinksAsync( + request?: protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1beta.GoogleAdsLink | 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.v1beta.IListGoogleAdsLinksRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IGoogleAdsLink[], + protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest|null, + protos.google.analytics.admin.v1beta.IListGoogleAdsLinksResponse + ]>; + listGoogleAdsLinks( + request: protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, + protos.google.analytics.admin.v1beta.IListGoogleAdsLinksResponse|null|undefined, + protos.google.analytics.admin.v1beta.IGoogleAdsLink>): void; + listGoogleAdsLinks( + request: protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, + protos.google.analytics.admin.v1beta.IListGoogleAdsLinksResponse|null|undefined, + protos.google.analytics.admin.v1beta.IGoogleAdsLink>): void; + listGoogleAdsLinks( + request?: protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, + protos.google.analytics.admin.v1beta.IListGoogleAdsLinksResponse|null|undefined, + protos.google.analytics.admin.v1beta.IGoogleAdsLink>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, + protos.google.analytics.admin.v1beta.IListGoogleAdsLinksResponse|null|undefined, + protos.google.analytics.admin.v1beta.IGoogleAdsLink>): + Promise<[ + protos.google.analytics.admin.v1beta.IGoogleAdsLink[], + protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest|null, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.GoogleAdsLink | 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.v1beta.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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1beta.GoogleAdsLink | 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/v1beta/analytics_admin_service.list_google_ads_links.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListGoogleAdsLinks_async + */ + listGoogleAdsLinksAsync( + request?: protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1beta.MeasurementProtocolSecret | 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.v1beta.IListMeasurementProtocolSecretsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret[], + protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest|null, + protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsResponse + ]>; + listMeasurementProtocolSecrets( + request: protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, + protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret>): void; + listMeasurementProtocolSecrets( + request: protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, + protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret>): void; + listMeasurementProtocolSecrets( + request?: protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, + protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, + protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret>): + Promise<[ + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret[], + protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest|null, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.MeasurementProtocolSecret | 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.v1beta.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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1beta.MeasurementProtocolSecret | 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/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_async + */ + listMeasurementProtocolSecretsAsync( + request?: protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1beta.ChangeHistoryEvent | 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.v1beta.ISearchChangeHistoryEventsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IChangeHistoryEvent[], + protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest|null, + protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsResponse + ]>; + searchChangeHistoryEvents( + request: protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, + protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IChangeHistoryEvent>): void; + searchChangeHistoryEvents( + request: protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, + protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IChangeHistoryEvent>): void; + searchChangeHistoryEvents( + request?: protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, + protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IChangeHistoryEvent>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, + protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IChangeHistoryEvent>): + Promise<[ + protos.google.analytics.admin.v1beta.IChangeHistoryEvent[], + protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest|null, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.ChangeHistoryEvent | 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.v1beta.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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1beta.ChangeHistoryEvent | 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/v1beta/analytics_admin_service.search_change_history_events.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_SearchChangeHistoryEvents_async + */ + searchChangeHistoryEventsAsync( + request?: protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1beta.ConversionEvent | 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.v1beta.IListConversionEventsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IConversionEvent[], + protos.google.analytics.admin.v1beta.IListConversionEventsRequest|null, + protos.google.analytics.admin.v1beta.IListConversionEventsResponse + ]>; + listConversionEvents( + request: protos.google.analytics.admin.v1beta.IListConversionEventsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListConversionEventsRequest, + protos.google.analytics.admin.v1beta.IListConversionEventsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IConversionEvent>): void; + listConversionEvents( + request: protos.google.analytics.admin.v1beta.IListConversionEventsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListConversionEventsRequest, + protos.google.analytics.admin.v1beta.IListConversionEventsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IConversionEvent>): void; + listConversionEvents( + request?: protos.google.analytics.admin.v1beta.IListConversionEventsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1beta.IListConversionEventsRequest, + protos.google.analytics.admin.v1beta.IListConversionEventsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IConversionEvent>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1beta.IListConversionEventsRequest, + protos.google.analytics.admin.v1beta.IListConversionEventsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IConversionEvent>): + Promise<[ + protos.google.analytics.admin.v1beta.IConversionEvent[], + protos.google.analytics.admin.v1beta.IListConversionEventsRequest|null, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.ConversionEvent | 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.v1beta.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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1beta.ConversionEvent | 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/v1beta/analytics_admin_service.list_conversion_events.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListConversionEvents_async + */ + listConversionEventsAsync( + request?: protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1beta.CustomDimension | 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.v1beta.IListCustomDimensionsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomDimension[], + protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest|null, + protos.google.analytics.admin.v1beta.IListCustomDimensionsResponse + ]>; + listCustomDimensions( + request: protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, + protos.google.analytics.admin.v1beta.IListCustomDimensionsResponse|null|undefined, + protos.google.analytics.admin.v1beta.ICustomDimension>): void; + listCustomDimensions( + request: protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, + protos.google.analytics.admin.v1beta.IListCustomDimensionsResponse|null|undefined, + protos.google.analytics.admin.v1beta.ICustomDimension>): void; + listCustomDimensions( + request?: protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, + protos.google.analytics.admin.v1beta.IListCustomDimensionsResponse|null|undefined, + protos.google.analytics.admin.v1beta.ICustomDimension>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, + protos.google.analytics.admin.v1beta.IListCustomDimensionsResponse|null|undefined, + protos.google.analytics.admin.v1beta.ICustomDimension>): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomDimension[], + protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest|null, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.CustomDimension | 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.v1beta.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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1beta.CustomDimension | 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/v1beta/analytics_admin_service.list_custom_dimensions.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListCustomDimensions_async + */ + listCustomDimensionsAsync( + request?: protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1beta.CustomMetric | 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.v1beta.IListCustomMetricsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomMetric[], + protos.google.analytics.admin.v1beta.IListCustomMetricsRequest|null, + protos.google.analytics.admin.v1beta.IListCustomMetricsResponse + ]>; + listCustomMetrics( + request: protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, + protos.google.analytics.admin.v1beta.IListCustomMetricsResponse|null|undefined, + protos.google.analytics.admin.v1beta.ICustomMetric>): void; + listCustomMetrics( + request: protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, + protos.google.analytics.admin.v1beta.IListCustomMetricsResponse|null|undefined, + protos.google.analytics.admin.v1beta.ICustomMetric>): void; + listCustomMetrics( + request?: protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, + protos.google.analytics.admin.v1beta.IListCustomMetricsResponse|null|undefined, + protos.google.analytics.admin.v1beta.ICustomMetric>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, + protos.google.analytics.admin.v1beta.IListCustomMetricsResponse|null|undefined, + protos.google.analytics.admin.v1beta.ICustomMetric>): + Promise<[ + protos.google.analytics.admin.v1beta.ICustomMetric[], + protos.google.analytics.admin.v1beta.IListCustomMetricsRequest|null, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.CustomMetric | 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.v1beta.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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1beta.CustomMetric | 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/v1beta/analytics_admin_service.list_custom_metrics.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListCustomMetrics_async + */ + listCustomMetricsAsync( + request?: protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {}, + 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 {@link google.analytics.admin.v1beta.DataStream | 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.v1beta.IListDataStreamsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1beta.IDataStream[], + protos.google.analytics.admin.v1beta.IListDataStreamsRequest|null, + protos.google.analytics.admin.v1beta.IListDataStreamsResponse + ]>; + listDataStreams( + request: protos.google.analytics.admin.v1beta.IListDataStreamsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListDataStreamsRequest, + protos.google.analytics.admin.v1beta.IListDataStreamsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IDataStream>): void; + listDataStreams( + request: protos.google.analytics.admin.v1beta.IListDataStreamsRequest, + callback: PaginationCallback< + protos.google.analytics.admin.v1beta.IListDataStreamsRequest, + protos.google.analytics.admin.v1beta.IListDataStreamsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IDataStream>): void; + listDataStreams( + request?: protos.google.analytics.admin.v1beta.IListDataStreamsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.analytics.admin.v1beta.IListDataStreamsRequest, + protos.google.analytics.admin.v1beta.IListDataStreamsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IDataStream>, + callback?: PaginationCallback< + protos.google.analytics.admin.v1beta.IListDataStreamsRequest, + protos.google.analytics.admin.v1beta.IListDataStreamsResponse|null|undefined, + protos.google.analytics.admin.v1beta.IDataStream>): + Promise<[ + protos.google.analytics.admin.v1beta.IDataStream[], + protos.google.analytics.admin.v1beta.IListDataStreamsRequest|null, + protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.DataStream | 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.v1beta.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' + ] = this._gaxModule.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 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 + * {@link google.analytics.admin.v1beta.DataStream | 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/v1beta/analytics_admin_service.list_data_streams.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListDataStreams_async + */ + listDataStreamsAsync( + request?: protos.google.analytics.admin.v1beta.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' + ] = this._gaxModule.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 {}, + 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 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 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 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 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; + } + + /** + * 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/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client_config.json b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client_config.json new file mode 100644 index 00000000000..aabd0a6eb1e --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client_config.json @@ -0,0 +1,279 @@ +{ + "interfaces": { + "google.analytics.admin.v1beta.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" + }, + "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" + }, + "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" + }, + "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" + }, + "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" + }, + "RunAccessReport": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + } + } + } + } +} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_proto_list.json b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_proto_list.json new file mode 100644 index 00000000000..95cd6a5fee5 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/analytics/admin/v1beta/access_report.proto", + "../../protos/google/analytics/admin/v1beta/analytics_admin.proto", + "../../protos/google/analytics/admin/v1beta/resources.proto" +] diff --git a/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/gapic_metadata.json b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/gapic_metadata.json new file mode 100644 index 00000000000..5c694601ea0 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/gapic_metadata.json @@ -0,0 +1,547 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.analytics.admin.v1beta", + "libraryPackage": "@google-cloud/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" + ] + }, + "CreateFirebaseLink": { + "methods": [ + "createFirebaseLink" + ] + }, + "DeleteFirebaseLink": { + "methods": [ + "deleteFirebaseLink" + ] + }, + "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" + ] + }, + "CreateConversionEvent": { + "methods": [ + "createConversionEvent" + ] + }, + "GetConversionEvent": { + "methods": [ + "getConversionEvent" + ] + }, + "DeleteConversionEvent": { + "methods": [ + "deleteConversionEvent" + ] + }, + "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" + ] + }, + "RunAccessReport": { + "methods": [ + "runAccessReport" + ] + }, + "ListAccounts": { + "methods": [ + "listAccounts", + "listAccountsStream", + "listAccountsAsync" + ] + }, + "ListAccountSummaries": { + "methods": [ + "listAccountSummaries", + "listAccountSummariesStream", + "listAccountSummariesAsync" + ] + }, + "ListProperties": { + "methods": [ + "listProperties", + "listPropertiesStream", + "listPropertiesAsync" + ] + }, + "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" + ] + }, + "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" + ] + }, + "CreateFirebaseLink": { + "methods": [ + "createFirebaseLink" + ] + }, + "DeleteFirebaseLink": { + "methods": [ + "deleteFirebaseLink" + ] + }, + "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" + ] + }, + "CreateConversionEvent": { + "methods": [ + "createConversionEvent" + ] + }, + "GetConversionEvent": { + "methods": [ + "getConversionEvent" + ] + }, + "DeleteConversionEvent": { + "methods": [ + "deleteConversionEvent" + ] + }, + "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" + ] + }, + "RunAccessReport": { + "methods": [ + "runAccessReport" + ] + }, + "ListAccounts": { + "methods": [ + "listAccounts", + "listAccountsStream", + "listAccountsAsync" + ] + }, + "ListAccountSummaries": { + "methods": [ + "listAccountSummaries", + "listAccountSummariesStream", + "listAccountSummariesAsync" + ] + }, + "ListProperties": { + "methods": [ + "listProperties", + "listPropertiesStream", + "listPropertiesAsync" + ] + }, + "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" + ] + }, + "ListCustomDimensions": { + "methods": [ + "listCustomDimensions", + "listCustomDimensionsStream", + "listCustomDimensionsAsync" + ] + }, + "ListCustomMetrics": { + "methods": [ + "listCustomMetrics", + "listCustomMetricsStream", + "listCustomMetricsAsync" + ] + }, + "ListDataStreams": { + "methods": [ + "listDataStreams", + "listDataStreamsStream", + "listDataStreamsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/index.ts b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/index.ts new file mode 100644 index 00000000000..f0f311d4088 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 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/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..3d1ef8d9342 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2023 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-cloud/admin'); + +function main() { + const analyticsAdminServiceClient = new admin.AnalyticsAdminServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..5b3ec35c38f --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2023 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-cloud/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/google-analytics-admin/v1beta/system-test/install.ts b/owl-bot-staging/google-analytics-admin/v1beta/system-test/install.ts new file mode 100644 index 00000000000..c8f81b25a86 --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2023 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/google-analytics-admin/v1beta/test/gapic_analytics_admin_service_v1beta.ts b/owl-bot-staging/google-analytics-admin/v1beta/test/gapic_analytics_admin_service_v1beta.ts new file mode 100644 index 00000000000..7377b008d2a --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/test/gapic_analytics_admin_service_v1beta.ts @@ -0,0 +1,7071 @@ +// Copyright 2023 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'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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('v1beta.AnalyticsAdminServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new analyticsadminserviceModule.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.Account() + ); + client.innerApiCalls.getAccount = stubSimpleCall(expectedResponse); + const [response] = await client.getAccount(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAccount without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.Account() + ); + client.innerApiCalls.getAccount = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAccount( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IAccount|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAccount with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAccount = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAccount(request), expectedError); + const actualRequest = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAccount with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetAccountRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAccount = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAccount(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAccount without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAccount with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAccount = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteAccount(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAccount with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteAccountRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateAccountRequest() + ); + request.account ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateAccountRequest', ['account', 'name']); + request.account.name = defaultValue1; + const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.Account() + ); + client.innerApiCalls.updateAccount = stubSimpleCall(expectedResponse); + const [response] = await client.updateAccount(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAccount without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateAccountRequest() + ); + request.account ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateAccountRequest', ['account', 'name']); + request.account.name = defaultValue1; + const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.Account() + ); + client.innerApiCalls.updateAccount = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAccount( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IAccount|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAccount with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateAccountRequest() + ); + request.account ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateAccountRequest', ['account', 'name']); + request.account.name = defaultValue1; + const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAccount = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateAccount(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAccount with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateAccountRequest() + ); + request.account ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateAccountRequest', ['account', 'name']); + request.account.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ProvisionAccountTicketRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ProvisionAccountTicketResponse() + ); + client.innerApiCalls.provisionAccountTicket = stubSimpleCall(expectedResponse); + const [response] = await client.provisionAccountTicket(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes provisionAccountTicket without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ProvisionAccountTicketRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ProvisionAccountTicketResponse() + ); + client.innerApiCalls.provisionAccountTicket = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.provisionAccountTicket( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes provisionAccountTicket with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ProvisionAccountTicketRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.provisionAccountTicket = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.provisionAccountTicket(request), expectedError); + }); + + it('invokes provisionAccountTicket with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetPropertyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetPropertyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.Property() + ); + client.innerApiCalls.getProperty = stubSimpleCall(expectedResponse); + const [response] = await client.getProperty(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProperty without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetPropertyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetPropertyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.Property() + ); + client.innerApiCalls.getProperty = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProperty( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IProperty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProperty with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetPropertyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetPropertyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProperty = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getProperty(request), expectedError); + const actualRequest = (client.innerApiCalls.getProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProperty with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetPropertyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetPropertyRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreatePropertyRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.Property() + ); + client.innerApiCalls.createProperty = stubSimpleCall(expectedResponse); + const [response] = await client.createProperty(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createProperty without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreatePropertyRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.Property() + ); + client.innerApiCalls.createProperty = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createProperty( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IProperty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createProperty with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreatePropertyRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createProperty = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createProperty(request), expectedError); + }); + + it('invokes createProperty with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeletePropertyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeletePropertyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.Property() + ); + client.innerApiCalls.deleteProperty = stubSimpleCall(expectedResponse); + const [response] = await client.deleteProperty(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProperty without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeletePropertyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeletePropertyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.Property() + ); + client.innerApiCalls.deleteProperty = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteProperty( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IProperty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProperty with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeletePropertyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeletePropertyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProperty = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteProperty(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProperty with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeletePropertyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeletePropertyRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdatePropertyRequest() + ); + request.property ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdatePropertyRequest', ['property', 'name']); + request.property.name = defaultValue1; + const expectedHeaderRequestParams = `property.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.Property() + ); + client.innerApiCalls.updateProperty = stubSimpleCall(expectedResponse); + const [response] = await client.updateProperty(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProperty without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdatePropertyRequest() + ); + request.property ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdatePropertyRequest', ['property', 'name']); + request.property.name = defaultValue1; + const expectedHeaderRequestParams = `property.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.Property() + ); + client.innerApiCalls.updateProperty = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateProperty( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IProperty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProperty with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdatePropertyRequest() + ); + request.property ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdatePropertyRequest', ['property', 'name']); + request.property.name = defaultValue1; + const expectedHeaderRequestParams = `property.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateProperty = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateProperty(request), expectedError); + const actualRequest = (client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateProperty as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProperty with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdatePropertyRequest() + ); + request.property ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdatePropertyRequest', ['property', 'name']); + request.property.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateProperty(request), expectedError); + }); + }); + + describe('createFirebaseLink', () => { + it('invokes createFirebaseLink without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateFirebaseLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateFirebaseLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.FirebaseLink() + ); + client.innerApiCalls.createFirebaseLink = stubSimpleCall(expectedResponse); + const [response] = await client.createFirebaseLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFirebaseLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateFirebaseLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateFirebaseLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.FirebaseLink() + ); + client.innerApiCalls.createFirebaseLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFirebaseLink( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IFirebaseLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFirebaseLink with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateFirebaseLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateFirebaseLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFirebaseLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createFirebaseLink(request), expectedError); + const actualRequest = (client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFirebaseLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFirebaseLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateFirebaseLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateFirebaseLinkRequest', ['parent']); + request.parent = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteFirebaseLink = stubSimpleCall(expectedResponse); + const [response] = await client.deleteFirebaseLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFirebaseLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFirebaseLink with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFirebaseLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteFirebaseLink(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFirebaseLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFirebaseLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteFirebaseLink(request), expectedError); + }); + }); + + describe('createGoogleAdsLink', () => { + it('invokes createGoogleAdsLink without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GoogleAdsLink() + ); + client.innerApiCalls.createGoogleAdsLink = stubSimpleCall(expectedResponse); + const [response] = await client.createGoogleAdsLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGoogleAdsLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GoogleAdsLink() + ); + client.innerApiCalls.createGoogleAdsLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGoogleAdsLink( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IGoogleAdsLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGoogleAdsLink with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGoogleAdsLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createGoogleAdsLink(request), expectedError); + const actualRequest = (client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGoogleAdsLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest', ['parent']); + request.parent = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest() + ); + request.googleAdsLink ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); + request.googleAdsLink.name = defaultValue1; + const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GoogleAdsLink() + ); + client.innerApiCalls.updateGoogleAdsLink = stubSimpleCall(expectedResponse); + const [response] = await client.updateGoogleAdsLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGoogleAdsLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest() + ); + request.googleAdsLink ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); + request.googleAdsLink.name = defaultValue1; + const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GoogleAdsLink() + ); + client.innerApiCalls.updateGoogleAdsLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGoogleAdsLink( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IGoogleAdsLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGoogleAdsLink with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest() + ); + request.googleAdsLink ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); + request.googleAdsLink.name = defaultValue1; + const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGoogleAdsLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateGoogleAdsLink(request), expectedError); + const actualRequest = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGoogleAdsLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest() + ); + request.googleAdsLink ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); + request.googleAdsLink.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCall(expectedResponse); + const [response] = await client.deleteGoogleAdsLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGoogleAdsLink without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGoogleAdsLink with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteGoogleAdsLink(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGoogleAdsLink with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetDataSharingSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataSharingSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DataSharingSettings() + ); + client.innerApiCalls.getDataSharingSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getDataSharingSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSharingSettings without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetDataSharingSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataSharingSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DataSharingSettings() + ); + client.innerApiCalls.getDataSharingSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataSharingSettings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IDataSharingSettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSharingSettings with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetDataSharingSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataSharingSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataSharingSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataSharingSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataSharingSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSharingSettings with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetDataSharingSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataSharingSettingsRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() + ); + client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCall(expectedResponse); + const [response] = await client.getMeasurementProtocolSecret(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMeasurementProtocolSecret without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() + ); + client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMeasurementProtocolSecret( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMeasurementProtocolSecret with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMeasurementProtocolSecret(request), expectedError); + const actualRequest = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMeasurementProtocolSecret with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() + ); + client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCall(expectedResponse); + const [response] = await client.createMeasurementProtocolSecret(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMeasurementProtocolSecret without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() + ); + client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMeasurementProtocolSecret( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMeasurementProtocolSecret with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createMeasurementProtocolSecret(request), expectedError); + const actualRequest = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMeasurementProtocolSecret with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest', ['parent']); + request.parent = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCall(expectedResponse); + const [response] = await client.deleteMeasurementProtocolSecret(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMeasurementProtocolSecret without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMeasurementProtocolSecret with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteMeasurementProtocolSecret(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMeasurementProtocolSecret with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest() + ); + request.measurementProtocolSecret ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); + request.measurementProtocolSecret.name = defaultValue1; + const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() + ); + client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCall(expectedResponse); + const [response] = await client.updateMeasurementProtocolSecret(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMeasurementProtocolSecret without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest() + ); + request.measurementProtocolSecret ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); + request.measurementProtocolSecret.name = defaultValue1; + const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() + ); + client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMeasurementProtocolSecret( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMeasurementProtocolSecret with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest() + ); + request.measurementProtocolSecret ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); + request.measurementProtocolSecret.name = defaultValue1; + const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateMeasurementProtocolSecret(request), expectedError); + const actualRequest = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMeasurementProtocolSecret with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest() + ); + request.measurementProtocolSecret ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); + request.measurementProtocolSecret.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest', ['property']); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse() + ); + client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCall(expectedResponse); + const [response] = await client.acknowledgeUserDataCollection(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acknowledgeUserDataCollection without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest', ['property']); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse() + ); + client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.acknowledgeUserDataCollection( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acknowledgeUserDataCollection with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest', ['property']); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.acknowledgeUserDataCollection(request), expectedError); + const actualRequest = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acknowledgeUserDataCollection with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest', ['property']); + request.property = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.acknowledgeUserDataCollection(request), expectedError); + }); + }); + + describe('createConversionEvent', () => { + it('invokes createConversionEvent without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateConversionEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateConversionEventRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ConversionEvent() + ); + client.innerApiCalls.createConversionEvent = stubSimpleCall(expectedResponse); + const [response] = await client.createConversionEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConversionEvent without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateConversionEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateConversionEventRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ConversionEvent() + ); + client.innerApiCalls.createConversionEvent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createConversionEvent( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IConversionEvent|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConversionEvent with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateConversionEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateConversionEventRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConversionEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createConversionEvent(request), expectedError); + const actualRequest = (client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConversionEvent with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateConversionEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateConversionEventRequest', ['parent']); + request.parent = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetConversionEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetConversionEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ConversionEvent() + ); + client.innerApiCalls.getConversionEvent = stubSimpleCall(expectedResponse); + const [response] = await client.getConversionEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversionEvent without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetConversionEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetConversionEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ConversionEvent() + ); + client.innerApiCalls.getConversionEvent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConversionEvent( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IConversionEvent|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversionEvent with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetConversionEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetConversionEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConversionEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConversionEvent(request), expectedError); + const actualRequest = (client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversionEvent with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetConversionEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetConversionEventRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteConversionEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteConversionEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteConversionEvent = stubSimpleCall(expectedResponse); + const [response] = await client.deleteConversionEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversionEvent without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteConversionEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteConversionEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversionEvent with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteConversionEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteConversionEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConversionEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteConversionEvent(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversionEvent with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteConversionEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteConversionEventRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteConversionEvent(request), expectedError); + }); + }); + + describe('createCustomDimension', () => { + it('invokes createCustomDimension without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateCustomDimensionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomDimensionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CustomDimension() + ); + client.innerApiCalls.createCustomDimension = stubSimpleCall(expectedResponse); + const [response] = await client.createCustomDimension(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomDimension without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateCustomDimensionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomDimensionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CustomDimension() + ); + client.innerApiCalls.createCustomDimension = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomDimension( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomDimension|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomDimension with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateCustomDimensionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomDimensionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomDimension = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCustomDimension(request), expectedError); + const actualRequest = (client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomDimension with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateCustomDimensionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomDimensionRequest', ['parent']); + request.parent = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateCustomDimensionRequest() + ); + request.customDimension ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomDimensionRequest', ['customDimension', 'name']); + request.customDimension.name = defaultValue1; + const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CustomDimension() + ); + client.innerApiCalls.updateCustomDimension = stubSimpleCall(expectedResponse); + const [response] = await client.updateCustomDimension(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomDimension without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateCustomDimensionRequest() + ); + request.customDimension ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomDimensionRequest', ['customDimension', 'name']); + request.customDimension.name = defaultValue1; + const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CustomDimension() + ); + client.innerApiCalls.updateCustomDimension = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCustomDimension( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomDimension|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomDimension with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateCustomDimensionRequest() + ); + request.customDimension ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomDimensionRequest', ['customDimension', 'name']); + request.customDimension.name = defaultValue1; + const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomDimension = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCustomDimension(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomDimension with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateCustomDimensionRequest() + ); + request.customDimension ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomDimensionRequest', ['customDimension', 'name']); + request.customDimension.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.archiveCustomDimension = stubSimpleCall(expectedResponse); + const [response] = await client.archiveCustomDimension(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes archiveCustomDimension without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes archiveCustomDimension with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.archiveCustomDimension = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.archiveCustomDimension(request), expectedError); + const actualRequest = (client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes archiveCustomDimension with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetCustomDimensionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomDimensionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CustomDimension() + ); + client.innerApiCalls.getCustomDimension = stubSimpleCall(expectedResponse); + const [response] = await client.getCustomDimension(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomDimension without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetCustomDimensionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomDimensionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CustomDimension() + ); + client.innerApiCalls.getCustomDimension = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCustomDimension( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomDimension|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomDimension with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetCustomDimensionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomDimensionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomDimension = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomDimension(request), expectedError); + const actualRequest = (client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomDimension as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomDimension with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetCustomDimensionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomDimensionRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateCustomMetricRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomMetricRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CustomMetric() + ); + client.innerApiCalls.createCustomMetric = stubSimpleCall(expectedResponse); + const [response] = await client.createCustomMetric(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomMetric without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateCustomMetricRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomMetricRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CustomMetric() + ); + client.innerApiCalls.createCustomMetric = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomMetric( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomMetric|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomMetric with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateCustomMetricRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomMetricRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomMetric = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCustomMetric(request), expectedError); + const actualRequest = (client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomMetric with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateCustomMetricRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomMetricRequest', ['parent']); + request.parent = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateCustomMetricRequest() + ); + request.customMetric ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomMetricRequest', ['customMetric', 'name']); + request.customMetric.name = defaultValue1; + const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CustomMetric() + ); + client.innerApiCalls.updateCustomMetric = stubSimpleCall(expectedResponse); + const [response] = await client.updateCustomMetric(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomMetric without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateCustomMetricRequest() + ); + request.customMetric ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomMetricRequest', ['customMetric', 'name']); + request.customMetric.name = defaultValue1; + const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CustomMetric() + ); + client.innerApiCalls.updateCustomMetric = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCustomMetric( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomMetric|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomMetric with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateCustomMetricRequest() + ); + request.customMetric ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomMetricRequest', ['customMetric', 'name']); + request.customMetric.name = defaultValue1; + const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomMetric = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCustomMetric(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomMetric with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateCustomMetricRequest() + ); + request.customMetric ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomMetricRequest', ['customMetric', 'name']); + request.customMetric.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ArchiveCustomMetricRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomMetricRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.archiveCustomMetric = stubSimpleCall(expectedResponse); + const [response] = await client.archiveCustomMetric(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes archiveCustomMetric without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ArchiveCustomMetricRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomMetricRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes archiveCustomMetric with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ArchiveCustomMetricRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomMetricRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.archiveCustomMetric = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.archiveCustomMetric(request), expectedError); + const actualRequest = (client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes archiveCustomMetric with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ArchiveCustomMetricRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomMetricRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetCustomMetricRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomMetricRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CustomMetric() + ); + client.innerApiCalls.getCustomMetric = stubSimpleCall(expectedResponse); + const [response] = await client.getCustomMetric(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomMetric without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetCustomMetricRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomMetricRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CustomMetric() + ); + client.innerApiCalls.getCustomMetric = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCustomMetric( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomMetric|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomMetric with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetCustomMetricRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomMetricRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomMetric = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomMetric(request), expectedError); + const actualRequest = (client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomMetric as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomMetric with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetCustomMetricRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomMetricRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DataRetentionSettings() + ); + client.innerApiCalls.getDataRetentionSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getDataRetentionSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataRetentionSettings without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DataRetentionSettings() + ); + client.innerApiCalls.getDataRetentionSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataRetentionSettings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IDataRetentionSettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataRetentionSettings with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataRetentionSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataRetentionSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataRetentionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataRetentionSettings with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest() + ); + request.dataRetentionSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); + request.dataRetentionSettings.name = defaultValue1; + const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DataRetentionSettings() + ); + client.innerApiCalls.updateDataRetentionSettings = stubSimpleCall(expectedResponse); + const [response] = await client.updateDataRetentionSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataRetentionSettings without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest() + ); + request.dataRetentionSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); + request.dataRetentionSettings.name = defaultValue1; + const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DataRetentionSettings() + ); + client.innerApiCalls.updateDataRetentionSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataRetentionSettings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IDataRetentionSettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataRetentionSettings with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest() + ); + request.dataRetentionSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); + request.dataRetentionSettings.name = defaultValue1; + const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataRetentionSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDataRetentionSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataRetentionSettings with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest() + ); + request.dataRetentionSettings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); + request.dataRetentionSettings.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateDataStreamRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateDataStreamRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DataStream() + ); + client.innerApiCalls.createDataStream = stubSimpleCall(expectedResponse); + const [response] = await client.createDataStream(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataStream without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateDataStreamRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateDataStreamRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DataStream() + ); + client.innerApiCalls.createDataStream = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataStream( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IDataStream|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataStream with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateDataStreamRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateDataStreamRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataStream = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDataStream(request), expectedError); + const actualRequest = (client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataStream with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.CreateDataStreamRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.CreateDataStreamRequest', ['parent']); + request.parent = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteDataStreamRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteDataStreamRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDataStream = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDataStream(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataStream without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteDataStreamRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteDataStreamRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataStream with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteDataStreamRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteDataStreamRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataStream = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDataStream(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataStream with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DeleteDataStreamRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteDataStreamRequest', ['name']); + request.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateDataStreamRequest() + ); + request.dataStream ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataStreamRequest', ['dataStream', 'name']); + request.dataStream.name = defaultValue1; + const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DataStream() + ); + client.innerApiCalls.updateDataStream = stubSimpleCall(expectedResponse); + const [response] = await client.updateDataStream(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataStream without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateDataStreamRequest() + ); + request.dataStream ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataStreamRequest', ['dataStream', 'name']); + request.dataStream.name = defaultValue1; + const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DataStream() + ); + client.innerApiCalls.updateDataStream = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataStream( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IDataStream|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataStream with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateDataStreamRequest() + ); + request.dataStream ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataStreamRequest', ['dataStream', 'name']); + request.dataStream.name = defaultValue1; + const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataStream = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDataStream(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataStream with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.UpdateDataStreamRequest() + ); + request.dataStream ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataStreamRequest', ['dataStream', 'name']); + request.dataStream.name = defaultValue1; + 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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetDataStreamRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataStreamRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DataStream() + ); + client.innerApiCalls.getDataStream = stubSimpleCall(expectedResponse); + const [response] = await client.getDataStream(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataStream without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetDataStreamRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataStreamRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.DataStream() + ); + client.innerApiCalls.getDataStream = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataStream( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IDataStream|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataStream with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetDataStreamRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataStreamRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataStream = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataStream(request), expectedError); + const actualRequest = (client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataStream as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataStream with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.GetDataStreamRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataStreamRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataStream(request), expectedError); + }); + }); + + describe('runAccessReport', () => { + it('invokes runAccessReport without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.RunAccessReportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.RunAccessReportRequest', ['entity']); + request.entity = defaultValue1; + const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.RunAccessReportResponse() + ); + client.innerApiCalls.runAccessReport = stubSimpleCall(expectedResponse); + const [response] = await client.runAccessReport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.runAccessReport as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runAccessReport as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAccessReport without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.RunAccessReportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.RunAccessReportRequest', ['entity']); + request.entity = defaultValue1; + const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.RunAccessReportResponse() + ); + client.innerApiCalls.runAccessReport = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runAccessReport( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IRunAccessReportResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.runAccessReport as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runAccessReport as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAccessReport with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.RunAccessReportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.RunAccessReportRequest', ['entity']); + request.entity = defaultValue1; + const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runAccessReport = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.runAccessReport(request), expectedError); + const actualRequest = (client.innerApiCalls.runAccessReport as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runAccessReport as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAccessReport with closed client', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.RunAccessReportRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.RunAccessReportRequest', ['entity']); + request.entity = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.runAccessReport(request), expectedError); + }); + }); + + describe('listAccounts', () => { + it('invokes listAccounts without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListAccountsRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), + ]; + client.innerApiCalls.listAccounts = stubSimpleCall(expectedResponse); + const [response] = await client.listAccounts(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listAccounts without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListAccountsRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), + ]; + client.innerApiCalls.listAccounts = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAccounts( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IAccount[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listAccounts with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListAccountsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listAccounts = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAccounts(request), expectedError); + }); + + it('invokes listAccountsStream without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListAccountsRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.Account[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.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.v1beta.Account[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListAccountsRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), + ]; + client.descriptors.page.listAccounts.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.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.v1beta.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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListAccountSummariesRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), + ]; + client.innerApiCalls.listAccountSummaries = stubSimpleCall(expectedResponse); + const [response] = await client.listAccountSummaries(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listAccountSummaries without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListAccountSummariesRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), + ]; + client.innerApiCalls.listAccountSummaries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAccountSummaries( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IAccountSummary[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listAccountSummaries with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListAccountSummariesRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listAccountSummaries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAccountSummaries(request), expectedError); + }); + + it('invokes listAccountSummariesStream without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListAccountSummariesRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.AccountSummary[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.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.v1beta.AccountSummary[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListAccountSummariesRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), + ]; + client.descriptors.page.listAccountSummaries.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.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.v1beta.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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListPropertiesRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), + ]; + client.innerApiCalls.listProperties = stubSimpleCall(expectedResponse); + const [response] = await client.listProperties(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listProperties without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListPropertiesRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), + ]; + client.innerApiCalls.listProperties = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listProperties( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IProperty[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listProperties with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListPropertiesRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listProperties = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listProperties(request), expectedError); + }); + + it('invokes listPropertiesStream without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListPropertiesRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.Property[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.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.v1beta.Property[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListPropertiesRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), + ]; + client.descriptors.page.listProperties.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.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.v1beta.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('listFirebaseLinks', () => { + it('invokes listFirebaseLinks without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListFirebaseLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListFirebaseLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), + ]; + client.innerApiCalls.listFirebaseLinks = stubSimpleCall(expectedResponse); + const [response] = await client.listFirebaseLinks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFirebaseLinks without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListFirebaseLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListFirebaseLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), + ]; + client.innerApiCalls.listFirebaseLinks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFirebaseLinks( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IFirebaseLink[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFirebaseLinks with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListFirebaseLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListFirebaseLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFirebaseLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFirebaseLinks(request), expectedError); + const actualRequest = (client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFirebaseLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFirebaseLinksStream without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListFirebaseLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListFirebaseLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.FirebaseLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listFirebaseLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listFirebaseLinksStream with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListFirebaseLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListFirebaseLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.v1beta.FirebaseLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listFirebaseLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFirebaseLinks without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListFirebaseLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListFirebaseLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), + ]; + client.descriptors.page.listFirebaseLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFirebaseLinks with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListFirebaseLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListFirebaseLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.v1beta.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( + (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listGoogleAdsLinks', () => { + it('invokes listGoogleAdsLinks without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), + ]; + client.innerApiCalls.listGoogleAdsLinks = stubSimpleCall(expectedResponse); + const [response] = await client.listGoogleAdsLinks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGoogleAdsLinks without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), + ]; + client.innerApiCalls.listGoogleAdsLinks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGoogleAdsLinks( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IGoogleAdsLink[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGoogleAdsLinks with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGoogleAdsLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listGoogleAdsLinks(request), expectedError); + const actualRequest = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGoogleAdsLinksStream without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.GoogleAdsLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listGoogleAdsLinksStream with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.v1beta.GoogleAdsLink[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGoogleAdsLinks without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), + ]; + client.descriptors.page.listGoogleAdsLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGoogleAdsLinks with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.v1beta.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( + (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listMeasurementProtocolSecrets', () => { + it('invokes listMeasurementProtocolSecrets without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), + ]; + client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCall(expectedResponse); + const [response] = await client.listMeasurementProtocolSecrets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMeasurementProtocolSecrets without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), + ]; + client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMeasurementProtocolSecrets( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMeasurementProtocolSecrets with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMeasurementProtocolSecrets(request), expectedError); + const actualRequest = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMeasurementProtocolSecretsStream without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.MeasurementProtocolSecret[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMeasurementProtocolSecretsStream with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.v1beta.MeasurementProtocolSecret[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMeasurementProtocolSecrets without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), + ]; + client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMeasurementProtocolSecrets with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.v1beta.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( + (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchChangeHistoryEvents', () => { + it('invokes searchChangeHistoryEvents without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest', ['account']); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), + ]; + client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCall(expectedResponse); + const [response] = await client.searchChangeHistoryEvents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchChangeHistoryEvents without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest', ['account']); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), + ]; + client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchChangeHistoryEvents( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IChangeHistoryEvent[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchChangeHistoryEvents with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest', ['account']); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchChangeHistoryEvents(request), expectedError); + const actualRequest = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchChangeHistoryEventsStream without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest', ['account']); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.ChangeHistoryEvent[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchChangeHistoryEventsStream with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest', ['account']); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + 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.v1beta.ChangeHistoryEvent[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchChangeHistoryEvents without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest', ['account']); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), + ]; + client.descriptors.page.searchChangeHistoryEvents.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchChangeHistoryEvents with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest', ['account']); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + 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.v1beta.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( + (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listConversionEvents', () => { + it('invokes listConversionEvents without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListConversionEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListConversionEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), + ]; + client.innerApiCalls.listConversionEvents = stubSimpleCall(expectedResponse); + const [response] = await client.listConversionEvents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversionEvents without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListConversionEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListConversionEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), + ]; + client.innerApiCalls.listConversionEvents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConversionEvents( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IConversionEvent[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversionEvents with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListConversionEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListConversionEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConversionEvents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listConversionEvents(request), expectedError); + const actualRequest = (client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversionEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversionEventsStream without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListConversionEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListConversionEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.ConversionEvent[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listConversionEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConversionEventsStream with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListConversionEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListConversionEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.v1beta.ConversionEvent[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listConversionEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConversionEvents without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListConversionEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListConversionEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), + ]; + client.descriptors.page.listConversionEvents.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConversionEvents with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListConversionEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListConversionEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.v1beta.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( + (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCustomDimensions', () => { + it('invokes listCustomDimensions without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListCustomDimensionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomDimensionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), + ]; + client.innerApiCalls.listCustomDimensions = stubSimpleCall(expectedResponse); + const [response] = await client.listCustomDimensions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomDimensions without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListCustomDimensionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomDimensionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), + ]; + client.innerApiCalls.listCustomDimensions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCustomDimensions( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomDimension[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomDimensions with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListCustomDimensionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomDimensionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomDimensions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomDimensions(request), expectedError); + const actualRequest = (client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomDimensions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomDimensionsStream without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListCustomDimensionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomDimensionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.CustomDimension[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listCustomDimensions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCustomDimensionsStream with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListCustomDimensionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomDimensionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.v1beta.CustomDimension[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listCustomDimensions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomDimensions without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListCustomDimensionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomDimensionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), + ]; + client.descriptors.page.listCustomDimensions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomDimensions with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListCustomDimensionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomDimensionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.v1beta.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( + (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCustomMetrics', () => { + it('invokes listCustomMetrics without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListCustomMetricsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomMetricsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), + ]; + client.innerApiCalls.listCustomMetrics = stubSimpleCall(expectedResponse); + const [response] = await client.listCustomMetrics(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomMetrics without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListCustomMetricsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomMetricsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), + ]; + client.innerApiCalls.listCustomMetrics = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCustomMetrics( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomMetric[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomMetrics with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListCustomMetricsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomMetricsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomMetrics = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomMetrics(request), expectedError); + const actualRequest = (client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomMetrics as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomMetricsStream without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListCustomMetricsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomMetricsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.CustomMetric[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listCustomMetrics.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCustomMetricsStream with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListCustomMetricsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomMetricsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.v1beta.CustomMetric[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listCustomMetrics.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomMetrics without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListCustomMetricsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomMetricsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), + ]; + client.descriptors.page.listCustomMetrics.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomMetrics with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListCustomMetricsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomMetricsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.v1beta.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( + (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDataStreams', () => { + it('invokes listDataStreams without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListDataStreamsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListDataStreamsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), + ]; + client.innerApiCalls.listDataStreams = stubSimpleCall(expectedResponse); + const [response] = await client.listDataStreams(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataStreams without error using callback', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListDataStreamsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListDataStreamsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), + ]; + client.innerApiCalls.listDataStreams = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataStreams( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IDataStream[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataStreams with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListDataStreamsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListDataStreamsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataStreams = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDataStreams(request), expectedError); + const actualRequest = (client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataStreams as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataStreamsStream without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListDataStreamsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListDataStreamsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.DataStream[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listDataStreams.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDataStreamsStream with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListDataStreamsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListDataStreamsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.v1beta.DataStream[] = []; + stream.on('data', (response: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listDataStreams.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataStreams without error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListDataStreamsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListDataStreamsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), + generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), + ]; + client.descriptors.page.listDataStreams.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.analytics.admin.v1beta.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( + (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataStreams with error', async () => { + const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.ListDataStreamsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1beta.ListDataStreamsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.v1beta.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( + (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new analyticsadminserviceModule.v1beta.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.v1beta.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('conversionEvent', () => { + const fakePath = "/rendered/path/conversionEvent"; + const expectedParameters = { + property: "propertyValue", + conversion_event: "conversionEventValue", + }; + const client = new analyticsadminserviceModule.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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('firebaseLink', () => { + const fakePath = "/rendered/path/firebaseLink"; + const expectedParameters = { + property: "propertyValue", + firebase_link: "firebaseLinkValue", + }; + const client = new analyticsadminserviceModule.v1beta.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('googleAdsLink', () => { + const fakePath = "/rendered/path/googleAdsLink"; + const expectedParameters = { + property: "propertyValue", + google_ads_link: "googleAdsLinkValue", + }; + const client = new analyticsadminserviceModule.v1beta.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('measurementProtocolSecret', () => { + const fakePath = "/rendered/path/measurementProtocolSecret"; + const expectedParameters = { + property: "propertyValue", + data_stream: "dataStreamValue", + measurement_protocol_secret: "measurementProtocolSecretValue", + }; + const client = new analyticsadminserviceModule.v1beta.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.v1beta.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)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-analytics-admin/v1beta/tsconfig.json b/owl-bot-staging/google-analytics-admin/v1beta/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/webpack.config.js b/owl-bot-staging/google-analytics-admin/v1beta/webpack.config.js new file mode 100644 index 00000000000..0e336a8bddc --- /dev/null +++ b/owl-bot-staging/google-analytics-admin/v1beta/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: '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 21767c4de416c14d7bbae573b454491daac97dcf Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 24 Mar 2023 09:14:38 +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 --- .../v1alpha/.eslintignore | 7 - .../v1alpha/.eslintrc.json | 3 - .../google-analytics-admin/v1alpha/.gitignore | 14 - .../google-analytics-admin/v1alpha/.jsdoc.js | 55 - .../v1alpha/.mocharc.js | 33 - .../v1alpha/.prettierrc.js | 22 - .../google-analytics-admin/v1alpha/README.md | 1 - .../v1alpha/linkinator.config.json | 16 - .../v1alpha/package.json | 64 - .../admin/v1alpha/access_report.proto | 334 - .../admin/v1alpha/analytics_admin.proto | 3264 ---- .../analytics/admin/v1alpha/audience.proto | 419 - .../admin/v1alpha/expanded_data_set.proto | 151 - .../analytics/admin/v1alpha/resources.proto | 1555 -- ...ervice.acknowledge_user_data_collection.js | 72 - ...splay_video360_advertiser_link_proposal.js | 62 - ...nalytics_admin_service.archive_audience.js | 61 - ..._admin_service.archive_custom_dimension.js | 62 - ...ics_admin_service.archive_custom_metric.js | 62 - ...nalytics_admin_service.audit_user_links.js | 77 - ...in_service.batch_create_access_bindings.js | 71 - ...s_admin_service.batch_create_user_links.js | 76 - ...in_service.batch_delete_access_bindings.js | 71 - ...s_admin_service.batch_delete_user_links.js | 70 - ...admin_service.batch_get_access_bindings.js | 74 - ...tics_admin_service.batch_get_user_links.js | 71 - ...in_service.batch_update_access_bindings.js | 72 - ...s_admin_service.batch_update_user_links.js | 70 - ...splay_video360_advertiser_link_proposal.js | 62 - ...ics_admin_service.create_access_binding.js | 68 - ...analytics_admin_service.create_audience.js | 66 - ...admin_service.create_connected_site_tag.js | 68 - ...s_admin_service.create_conversion_event.js | 67 - ...s_admin_service.create_custom_dimension.js | 66 - ...tics_admin_service.create_custom_metric.js | 66 - ...lytics_admin_service.create_data_stream.js | 66 - ...create_display_video360_advertiser_link.js | 66 - ...splay_video360_advertiser_link_proposal.js | 66 - ..._admin_service.create_expanded_data_set.js | 66 - ...tics_admin_service.create_firebase_link.js | 67 - ...cs_admin_service.create_google_ads_link.js | 66 - ...vice.create_measurement_protocol_secret.js | 67 - ...analytics_admin_service.create_property.js | 62 - ...admin_service.create_search_ads360_link.js | 66 - ...nalytics_admin_service.create_user_link.js | 71 - ...ics_admin_service.delete_access_binding.js | 63 - .../analytics_admin_service.delete_account.js | 63 - ...admin_service.delete_connected_site_tag.js | 68 - ...s_admin_service.delete_conversion_event.js | 63 - ...lytics_admin_service.delete_data_stream.js | 62 - ...delete_display_video360_advertiser_link.js | 62 - ...splay_video360_advertiser_link_proposal.js | 62 - ..._admin_service.delete_expanded_data_set.js | 61 - ...tics_admin_service.delete_firebase_link.js | 62 - ...cs_admin_service.delete_google_ads_link.js | 61 - ...vice.delete_measurement_protocol_secret.js | 63 - ...analytics_admin_service.delete_property.js | 63 - ...admin_service.delete_search_ads360_link.js | 62 - ...nalytics_admin_service.delete_user_link.js | 61 - ...tch_automated_ga4_configuration_opt_out.js | 64 - ...lytics_admin_service.get_access_binding.js | 64 - .../analytics_admin_service.get_account.js | 63 - ..._admin_service.get_attribution_settings.js | 62 - .../analytics_admin_service.get_audience.js | 62 - ...lytics_admin_service.get_big_query_link.js | 63 - ...tics_admin_service.get_conversion_event.js | 63 - ...tics_admin_service.get_custom_dimension.js | 62 - ...alytics_admin_service.get_custom_metric.js | 62 - ...min_service.get_data_retention_settings.js | 64 - ...admin_service.get_data_sharing_settings.js | 63 - ...analytics_admin_service.get_data_stream.js | 62 - ...ce.get_display_video360_advertiser_link.js | 62 - ...splay_video360_advertiser_link_proposal.js | 62 - ...rvice.get_enhanced_measurement_settings.js | 64 - ...ics_admin_service.get_expanded_data_set.js | 62 - ...ytics_admin_service.get_global_site_tag.js | 64 - ...min_service.get_google_signals_settings.js | 62 - ...service.get_measurement_protocol_secret.js | 63 - .../analytics_admin_service.get_property.js | 63 - ...cs_admin_service.get_search_ads360_link.js | 62 - .../analytics_admin_service.get_user_link.js | 61 - ...tics_admin_service.list_access_bindings.js | 79 - ...cs_admin_service.list_account_summaries.js | 72 - .../analytics_admin_service.list_accounts.js | 78 - .../analytics_admin_service.list_audiences.js | 76 - ...tics_admin_service.list_big_query_links.js | 79 - ..._admin_service.list_connected_site_tags.js | 63 - ...cs_admin_service.list_conversion_events.js | 77 - ...cs_admin_service.list_custom_dimensions.js | 76 - ...ytics_admin_service.list_custom_metrics.js | 76 - ...alytics_admin_service.list_data_streams.js | 76 - ...play_video360_advertiser_link_proposals.js | 78 - ....list_display_video360_advertiser_links.js | 77 - ...s_admin_service.list_expanded_data_sets.js | 76 - ...ytics_admin_service.list_firebase_links.js | 78 - ...ics_admin_service.list_google_ads_links.js | 76 - ...rvice.list_measurement_protocol_secrets.js | 78 - ...analytics_admin_service.list_properties.js | 97 - ..._admin_service.list_search_ads360_links.js | 77 - ...analytics_admin_service.list_user_links.js | 77 - ..._admin_service.provision_account_ticket.js | 65 - ...alytics_admin_service.run_access_report.js | 139 - ...in_service.search_change_history_events.js | 107 - ...set_automated_ga4_configuration_opt_out.js | 68 - ...ics_admin_service.update_access_binding.js | 61 - .../analytics_admin_service.update_account.js | 70 - ...min_service.update_attribution_settings.js | 70 - ...analytics_admin_service.update_audience.js | 70 - ...s_admin_service.update_custom_dimension.js | 67 - ...tics_admin_service.update_custom_metric.js | 67 - ..._service.update_data_retention_settings.js | 70 - ...lytics_admin_service.update_data_stream.js | 67 - ...update_display_video360_advertiser_link.js | 67 - ...ce.update_enhanced_measurement_settings.js | 70 - ..._admin_service.update_expanded_data_set.js | 71 - ...cs_admin_service.update_google_ads_link.js | 68 - ..._service.update_google_signals_settings.js | 70 - ...vice.update_measurement_protocol_secret.js | 65 - ...analytics_admin_service.update_property.js | 71 - ...admin_service.update_search_ads360_link.js | 67 - ...nalytics_admin_service.update_user_link.js | 61 - ...tadata.google.analytics.admin.v1alpha.json | 4695 ----- .../v1alpha/src/index.ts | 25 - .../v1alpha/analytics_admin_service_client.ts | 11750 ------------ ...analytics_admin_service_client_config.json | 574 - .../analytics_admin_service_proto_list.json | 7 - .../v1alpha/src/v1alpha/gapic_metadata.json | 1173 -- .../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 | 15039 ---------------- .../v1alpha/tsconfig.json | 19 - .../v1alpha/webpack.config.js | 64 - .../v1beta/.eslintignore | 7 - .../v1beta/.eslintrc.json | 3 - .../google-analytics-admin/v1beta/.gitignore | 14 - .../google-analytics-admin/v1beta/.jsdoc.js | 55 - .../google-analytics-admin/v1beta/.mocharc.js | 33 - .../v1beta/.prettierrc.js | 22 - .../google-analytics-admin/v1beta/README.md | 1 - .../v1beta/linkinator.config.json | 16 - .../v1beta/package.json | 64 - .../admin/v1beta/analytics_admin.proto | 1517 -- .../analytics/admin/v1beta/resources.proto | 922 - ...ervice.acknowledge_user_data_collection.js | 72 - ..._admin_service.archive_custom_dimension.js | 62 - ...ics_admin_service.archive_custom_metric.js | 62 - ...s_admin_service.create_conversion_event.js | 67 - ...s_admin_service.create_custom_dimension.js | 66 - ...tics_admin_service.create_custom_metric.js | 66 - ...lytics_admin_service.create_data_stream.js | 66 - ...tics_admin_service.create_firebase_link.js | 67 - ...cs_admin_service.create_google_ads_link.js | 66 - ...vice.create_measurement_protocol_secret.js | 67 - ...analytics_admin_service.create_property.js | 62 - .../analytics_admin_service.delete_account.js | 63 - ...s_admin_service.delete_conversion_event.js | 63 - ...lytics_admin_service.delete_data_stream.js | 62 - ...tics_admin_service.delete_firebase_link.js | 62 - ...cs_admin_service.delete_google_ads_link.js | 61 - ...vice.delete_measurement_protocol_secret.js | 63 - ...analytics_admin_service.delete_property.js | 63 - .../analytics_admin_service.get_account.js | 63 - ...tics_admin_service.get_conversion_event.js | 63 - ...tics_admin_service.get_custom_dimension.js | 62 - ...alytics_admin_service.get_custom_metric.js | 62 - ...min_service.get_data_retention_settings.js | 64 - ...admin_service.get_data_sharing_settings.js | 63 - ...analytics_admin_service.get_data_stream.js | 62 - ...service.get_measurement_protocol_secret.js | 63 - .../analytics_admin_service.get_property.js | 63 - ...cs_admin_service.list_account_summaries.js | 72 - .../analytics_admin_service.list_accounts.js | 78 - ...cs_admin_service.list_conversion_events.js | 77 - ...cs_admin_service.list_custom_dimensions.js | 76 - ...ytics_admin_service.list_custom_metrics.js | 76 - ...alytics_admin_service.list_data_streams.js | 76 - ...ytics_admin_service.list_firebase_links.js | 78 - ...ics_admin_service.list_google_ads_links.js | 76 - ...rvice.list_measurement_protocol_secrets.js | 78 - ...analytics_admin_service.list_properties.js | 97 - ..._admin_service.provision_account_ticket.js | 65 - ...in_service.search_change_history_events.js | 107 - .../analytics_admin_service.update_account.js | 70 - ...s_admin_service.update_custom_dimension.js | 67 - ...tics_admin_service.update_custom_metric.js | 67 - ..._service.update_data_retention_settings.js | 70 - ...lytics_admin_service.update_data_stream.js | 67 - ...cs_admin_service.update_google_ads_link.js | 68 - ...vice.update_measurement_protocol_secret.js | 65 - ...analytics_admin_service.update_property.js | 71 - ...etadata.google.analytics.admin.v1beta.json | 2155 --- .../v1beta/src/index.ts | 25 - .../v1beta/analytics_admin_service_client.ts | 5766 ------ ...analytics_admin_service_client_config.json | 279 - .../analytics_admin_service_proto_list.json | 5 - .../v1beta/src/v1beta/gapic_metadata.json | 547 - .../v1beta/src/v1beta/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1beta/system-test/install.ts | 49 - .../gapic_analytics_admin_service_v1beta.ts | 7071 -------- .../v1beta/tsconfig.json | 19 - .../v1beta/webpack.config.js | 64 - packages/google-analytics-admin/README.md | 1 + .../admin/v1beta/access_report.proto | 0 .../admin/v1beta/analytics_admin.proto | 356 +- .../analytics/admin/v1beta/resources.proto | 127 +- .../google-analytics-admin/protos/protos.d.ts | 2527 +++ .../google-analytics-admin/protos/protos.js | 8543 +++++++-- .../google-analytics-admin/protos/protos.json | 438 + .../google-analytics-admin/samples/README.md | 18 + ...ervice.acknowledge_user_data_collection.js | 4 +- ...s_admin_service.create_conversion_event.js | 4 +- ...ytics_admin_service.list_firebase_links.js | 2 +- ..._admin_service.provision_account_ticket.js | 2 +- ...alytics_admin_service.run_access_report.js | 0 ...in_service.search_change_history_events.js | 23 +- .../analytics_admin_service.update_account.js | 7 +- ...s_admin_service.update_custom_dimension.js | 6 +- ...tics_admin_service.update_custom_metric.js | 6 +- ..._service.update_data_retention_settings.js | 7 +- ...lytics_admin_service.update_data_stream.js | 6 +- ...cs_admin_service.update_google_ads_link.js | 7 +- ...analytics_admin_service.update_property.js | 7 +- ...etadata.google.analytics.admin.v1beta.json | 94 +- .../v1beta/analytics_admin_service_client.ts | 304 +- ...analytics_admin_service_client_config.json | 73 +- .../analytics_admin_service_proto_list.json | 1 + .../src/v1beta/gapic_metadata.json | 10 + .../gapic_analytics_admin_service_v1beta.ts | 134 + 232 files changed, 11278 insertions(+), 70127 deletions(-) delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/.eslintignore delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/.eslintrc.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/.gitignore delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/.jsdoc.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/.mocharc.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/.prettierrc.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/README.md delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/linkinator.config.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/package.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/access_report.proto delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/analytics_admin.proto delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/audience.proto delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/expanded_data_set.proto delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_audience.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.audit_user_links.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_access_bindings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_user_links.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_access_bindings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_user_links.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_access_bindings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_user_links.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_access_bindings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_user_links.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_access_binding.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_audience.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_connected_site_tag.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_expanded_data_set.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_property.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_search_ads360_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_user_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_access_binding.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_account.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_connected_site_tag.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_expanded_data_set.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_property.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_search_ads360_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_user_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_access_binding.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_account.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_attribution_settings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_audience.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_big_query_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_enhanced_measurement_settings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_expanded_data_set.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_property.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_search_ads360_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_user_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_access_bindings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_accounts.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_audiences.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_big_query_links.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_connected_site_tags.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_expanded_data_sets.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_properties.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_search_ads360_links.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_user_links.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.run_access_report.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.set_automated_ga4_configuration_opt_out.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_access_binding.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_account.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_attribution_settings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_audience.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_enhanced_measurement_settings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_expanded_data_set.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_property.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_search_ads360_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_user_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/src/index.ts delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client.ts delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client_config.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_proto_list.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/gapic_metadata.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/index.ts delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/system-test/install.ts delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/test/gapic_analytics_admin_service_v1alpha.ts delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/tsconfig.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1alpha/webpack.config.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/.eslintignore delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/.eslintrc.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/.gitignore delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/.jsdoc.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/.mocharc.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/.prettierrc.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/README.md delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/linkinator.config.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/package.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/analytics_admin.proto delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/resources.proto delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_dimension.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_metric.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_dimension.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_metric.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_data_stream.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_firebase_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_google_ads_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_measurement_protocol_secret.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_property.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_account.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_conversion_event.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_data_stream.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_firebase_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_google_ads_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_measurement_protocol_secret.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_property.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_account.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_conversion_event.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_dimension.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_metric.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_retention_settings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_sharing_settings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_stream.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_measurement_protocol_secret.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_property.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_account_summaries.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_accounts.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_conversion_events.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_dimensions.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_metrics.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_data_streams.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_google_ads_links.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_properties.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_account.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_stream.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_measurement_protocol_secret.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_property.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/src/index.ts delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client.ts delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client_config.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_proto_list.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/index.ts delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/system-test/install.ts delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/test/gapic_analytics_admin_service_v1beta.ts delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/tsconfig.json delete mode 100644 owl-bot-staging/google-analytics-admin/v1beta/webpack.config.js rename {owl-bot-staging/google-analytics-admin/v1beta => packages/google-analytics-admin}/protos/google/analytics/admin/v1beta/access_report.proto (100%) rename {owl-bot-staging/google-analytics-admin/v1beta => packages/google-analytics-admin}/samples/generated/v1beta/analytics_admin_service.run_access_report.js (100%) diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/.eslintignore b/owl-bot-staging/google-analytics-admin/v1alpha/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/.eslintrc.json b/owl-bot-staging/google-analytics-admin/v1alpha/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/.gitignore b/owl-bot-staging/google-analytics-admin/v1alpha/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-analytics-admin/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/google-analytics-admin/v1alpha/.jsdoc.js b/owl-bot-staging/google-analytics-admin/v1alpha/.jsdoc.js deleted file mode 100644 index 909f62e0847..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 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 2023 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-analytics/admin', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/.mocharc.js b/owl-bot-staging/google-analytics-admin/v1alpha/.mocharc.js deleted file mode 100644 index 1a38f257db7..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 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/google-analytics-admin/v1alpha/.prettierrc.js b/owl-bot-staging/google-analytics-admin/v1alpha/.prettierrc.js deleted file mode 100644 index 55639e70f9e..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 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/google-analytics-admin/v1alpha/README.md b/owl-bot-staging/google-analytics-admin/v1alpha/README.md deleted file mode 100644 index 5d45b74ed37..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/README.md +++ /dev/null @@ -1 +0,0 @@ -Admin: Nodejs Client diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/linkinator.config.json b/owl-bot-staging/google-analytics-admin/v1alpha/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-analytics-admin/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/google-analytics-admin/v1alpha/package.json b/owl-bot-staging/google-analytics-admin/v1alpha/package.json deleted file mode 100644 index 887c3c07385..00000000000 --- a/owl-bot-staging/google-analytics-admin/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/ && minifyProtoJson", - "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.5.7" - }, - "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^4.0.0", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", - "mocha": "^10.2.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^15.0.1", - "ts-loader": "^8.4.0", - "typescript": "^4.8.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/access_report.proto b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/access_report.proto deleted file mode 100644 index eb489c2523f..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/access_report.proto +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright 2023 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; - -option go_package = "google.golang.org/genproto/googleapis/analytics/admin/v1alpha;admin"; -option java_multiple_files = true; -option java_outer_classname = "AccessReportProto"; -option java_package = "com.google.analytics.admin.v1alpha"; - -// Dimensions are attributes of your data. For example, the dimension -// `userEmail` indicates the email of the user that accessed reporting data. -// Dimension values in report responses are strings. -message AccessDimension { - // The API name of the dimension. See [Data Access - // Schema](https://developers.google.com/analytics/devguides/config/admin/v1/access-api-schema) - // for the list of dimensions supported in this API. - // - // Dimensions are referenced by name in `dimensionFilter` and `orderBys`. - string dimension_name = 1; -} - -// The quantitative measurements of a report. For example, the metric -// `accessCount` is the total number of data access records. -message AccessMetric { - // The API name of the metric. See [Data Access - // Schema](https://developers.google.com/analytics/devguides/config/admin/v1/access-api-schema) - // for the list of metrics supported in this API. - // - // Metrics are referenced by name in `metricFilter` & `orderBys`. - string metric_name = 1; -} - -// A contiguous range of days: startDate, startDate + 1, ..., endDate. -message AccessDateRange { - // The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot - // be after `endDate`. The format `NdaysAgo`, `yesterday`, or `today` is also - // accepted, and in that case, the date is inferred based on the current time - // in the request's time zone. - string start_date = 1; - - // The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot - // be before `startDate`. The format `NdaysAgo`, `yesterday`, or `today` is - // also accepted, and in that case, the date is inferred based on the current - // time in the request's time zone. - string end_date = 2; -} - -// Expresses dimension or metric filters. The fields in the same expression need -// to be either all dimensions or all metrics. -message AccessFilterExpression { - // Specify one type of filter expression for `FilterExpression`. - oneof one_expression { - // Each of the FilterExpressions in the and_group has an AND relationship. - AccessFilterExpressionList and_group = 1; - - // Each of the FilterExpressions in the or_group has an OR relationship. - AccessFilterExpressionList or_group = 2; - - // The FilterExpression is NOT of not_expression. - AccessFilterExpression not_expression = 3; - - // A primitive filter. In the same FilterExpression, all of the filter's - // field names need to be either all dimensions or all metrics. - AccessFilter access_filter = 4; - } -} - -// A list of filter expressions. -message AccessFilterExpressionList { - // A list of filter expressions. - repeated AccessFilterExpression expressions = 1; -} - -// An expression to filter dimension or metric values. -message AccessFilter { - // Specify one type of filter for `Filter`. - oneof one_filter { - // Strings related filter. - AccessStringFilter string_filter = 2; - - // A filter for in list values. - AccessInListFilter in_list_filter = 3; - - // A filter for numeric or date values. - AccessNumericFilter numeric_filter = 4; - - // A filter for two values. - AccessBetweenFilter between_filter = 5; - } - - // The dimension name or metric name. - string field_name = 1; -} - -// The filter for strings. -message AccessStringFilter { - // The match type of a string filter. - enum MatchType { - // Unspecified - MATCH_TYPE_UNSPECIFIED = 0; - - // Exact match of the string value. - EXACT = 1; - - // Begins with the string value. - BEGINS_WITH = 2; - - // Ends with the string value. - ENDS_WITH = 3; - - // Contains the string value. - CONTAINS = 4; - - // Full match for the regular expression with the string value. - FULL_REGEXP = 5; - - // Partial match for the regular expression with the string value. - PARTIAL_REGEXP = 6; - } - - // The match type for this filter. - MatchType match_type = 1; - - // The string value used for the matching. - string value = 2; - - // If true, the string value is case sensitive. - bool case_sensitive = 3; -} - -// The result needs to be in a list of string values. -message AccessInListFilter { - // The list of string values. Must be non-empty. - repeated string values = 1; - - // If true, the string value is case sensitive. - bool case_sensitive = 2; -} - -// Filters for numeric or date values. -message AccessNumericFilter { - // The operation applied to a numeric filter. - enum Operation { - // Unspecified. - OPERATION_UNSPECIFIED = 0; - - // Equal - EQUAL = 1; - - // Less than - LESS_THAN = 2; - - // Less than or equal - LESS_THAN_OR_EQUAL = 3; - - // Greater than - GREATER_THAN = 4; - - // Greater than or equal - GREATER_THAN_OR_EQUAL = 5; - } - - // The operation type for this filter. - Operation operation = 1; - - // A numeric value or a date value. - NumericValue value = 2; -} - -// To express that the result needs to be between two numbers (inclusive). -message AccessBetweenFilter { - // Begins with this number. - NumericValue from_value = 1; - - // Ends with this number. - NumericValue to_value = 2; -} - -// To represent a number. -message NumericValue { - // One of a numeric value - oneof one_value { - // Integer value - int64 int64_value = 1; - - // Double value - double double_value = 2; - } -} - -// Order bys define how rows will be sorted in the response. For example, -// ordering rows by descending access count is one ordering, and ordering rows -// by the country string is a different ordering. -message AccessOrderBy { - // Sorts by metric values. - message MetricOrderBy { - // A metric name in the request to order by. - string metric_name = 1; - } - - // Sorts by dimension values. - message DimensionOrderBy { - // Rule to order the string dimension values by. - enum OrderType { - // Unspecified. - ORDER_TYPE_UNSPECIFIED = 0; - - // Alphanumeric sort by Unicode code point. For example, "2" < "A" < "X" < - // "b" < "z". - ALPHANUMERIC = 1; - - // Case insensitive alphanumeric sort by lower case Unicode code point. - // For example, "2" < "A" < "b" < "X" < "z". - CASE_INSENSITIVE_ALPHANUMERIC = 2; - - // Dimension values are converted to numbers before sorting. For example - // in NUMERIC sort, "25" < "100", and in `ALPHANUMERIC` sort, "100" < - // "25". Non-numeric dimension values all have equal ordering value below - // all numeric values. - NUMERIC = 3; - } - - // A dimension name in the request to order by. - string dimension_name = 1; - - // Controls the rule for dimension value ordering. - OrderType order_type = 2; - } - - // Specify one type of order by for `OrderBy`. - oneof one_order_by { - // Sorts results by a metric's values. - MetricOrderBy metric = 1; - - // Sorts results by a dimension's values. - DimensionOrderBy dimension = 2; - } - - // If true, sorts by descending order. If false or unspecified, sorts in - // ascending order. - bool desc = 3; -} - -// Describes a dimension column in the report. Dimensions requested in a report -// produce column entries within rows and DimensionHeaders. However, dimensions -// used exclusively within filters or expressions do not produce columns in a -// report; correspondingly, those dimensions do not produce headers. -message AccessDimensionHeader { - // The dimension's name; for example 'userEmail'. - string dimension_name = 1; -} - -// Describes a metric column in the report. Visible metrics requested in a -// report produce column entries within rows and MetricHeaders. However, -// metrics used exclusively within filters or expressions do not produce columns -// in a report; correspondingly, those metrics do not produce headers. -message AccessMetricHeader { - // The metric's name; for example 'accessCount'. - string metric_name = 1; -} - -// Access report data for each row. -message AccessRow { - // List of dimension values. These values are in the same order as specified - // in the request. - repeated AccessDimensionValue dimension_values = 1; - - // List of metric values. These values are in the same order as specified - // in the request. - repeated AccessMetricValue metric_values = 2; -} - -// The value of a dimension. -message AccessDimensionValue { - // The dimension value. For example, this value may be 'France' for the - // 'country' dimension. - string value = 1; -} - -// The value of a metric. -message AccessMetricValue { - // The measurement value. For example, this value may be '13'. - string value = 1; -} - -// Current state of all quotas for this Analytics property. If any quota for a -// property is exhausted, all requests to that property will return Resource -// Exhausted errors. -message AccessQuota { - // Properties can use 250,000 tokens per day. Most requests consume fewer than - // 10 tokens. - AccessQuotaStatus tokens_per_day = 1; - - // Properties can use 50,000 tokens per hour. An API request consumes a single - // number of tokens, and that number is deducted from all of the hourly, - // daily, and per project hourly quotas. - AccessQuotaStatus tokens_per_hour = 2; - - // Properties can use up to 50 concurrent requests. - AccessQuotaStatus concurrent_requests = 3; - - // Properties and cloud project pairs can have up to 50 server errors per - // hour. - AccessQuotaStatus server_errors_per_project_per_hour = 4; - - // Properties can use up to 25% of their tokens per project per hour. This - // amounts to Analytics 360 Properties can use 12,500 tokens per project per - // hour. An API request consumes a single number of tokens, and that number is - // deducted from all of the hourly, daily, and per project hourly quotas. - AccessQuotaStatus tokens_per_project_per_hour = 5; -} - -// Current state for a particular quota group. -message AccessQuotaStatus { - // Quota consumed by this request. - int32 consumed = 1; - - // Quota remaining after this request. - int32 remaining = 2; -} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/analytics_admin.proto b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/analytics_admin.proto deleted file mode 100644 index cbcf3155ca0..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/analytics_admin.proto +++ /dev/null @@ -1,3264 +0,0 @@ -// Copyright 2023 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/access_report.proto"; -import "google/analytics/admin/v1alpha/audience.proto"; -import "google/analytics/admin/v1alpha/expanded_data_set.proto"; -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 a 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 through 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"; - } - - // Lookup for a single Audience. - // Audiences created before 2020 may not be supported. - // Default audiences will not show filter definitions. - rpc GetAudience(GetAudienceRequest) returns (Audience) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/audiences/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Audiences on a property. - // Audiences created before 2020 may not be supported. - // Default audiences will not show filter definitions. - rpc ListAudiences(ListAudiencesRequest) returns (ListAudiencesResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=properties/*}/audiences" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates an Audience. - rpc CreateAudience(CreateAudienceRequest) returns (Audience) { - option (google.api.http) = { - post: "/v1alpha/{parent=properties/*}/audiences" - body: "audience" - }; - option (google.api.method_signature) = "parent,audience"; - } - - // Updates an Audience on a property. - rpc UpdateAudience(UpdateAudienceRequest) returns (Audience) { - option (google.api.http) = { - patch: "/v1alpha/{audience.name=properties/*/audiences/*}" - body: "audience" - }; - option (google.api.method_signature) = "audience,update_mask"; - } - - // Archives an Audience on a property. - rpc ArchiveAudience(ArchiveAudienceRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1alpha/{name=properties/*/audiences/*}:archive" - body: "*" - }; - } - - // Look up a single SearchAds360Link - rpc GetSearchAds360Link(GetSearchAds360LinkRequest) - returns (SearchAds360Link) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/searchAds360Links/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all SearchAds360Links on a property. - rpc ListSearchAds360Links(ListSearchAds360LinksRequest) - returns (ListSearchAds360LinksResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=properties/*}/searchAds360Links" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates a SearchAds360Link. - rpc CreateSearchAds360Link(CreateSearchAds360LinkRequest) - returns (SearchAds360Link) { - option (google.api.http) = { - post: "/v1alpha/{parent=properties/*}/searchAds360Links" - body: "search_ads_360_link" - }; - option (google.api.method_signature) = "parent,search_ads_360_link"; - } - - // Deletes a SearchAds360Link on a property. - rpc DeleteSearchAds360Link(DeleteSearchAds360LinkRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha/{name=properties/*/searchAds360Links/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a SearchAds360Link on a property. - rpc UpdateSearchAds360Link(UpdateSearchAds360LinkRequest) - returns (SearchAds360Link) { - option (google.api.http) = { - patch: "/v1alpha/{search_ads_360_link.name=properties/*/searchAds360Links/*}" - body: "search_ads_360_link" - }; - option (google.api.method_signature) = "search_ads_360_link,update_mask"; - } - - // Lookup for a AttributionSettings singleton. - rpc GetAttributionSettings(GetAttributionSettingsRequest) - returns (AttributionSettings) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/attributionSettings}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates attribution settings on a property. - rpc UpdateAttributionSettings(UpdateAttributionSettingsRequest) - returns (AttributionSettings) { - option (google.api.http) = { - patch: "/v1alpha/{attribution_settings.name=properties/*/attributionSettings}" - body: "attribution_settings" - }; - option (google.api.method_signature) = "attribution_settings,update_mask"; - } - - // Returns a customized report of data access records. The report provides - // records of each time a user reads Google Analytics reporting data. Access - // records are retained for up to 2 years. - // - // Data Access Reports can be requested for a property. The property must be - // in Google Analytics 360. This method is only available to Administrators. - // - // These data access records include GA4 UI Reporting, GA4 UI Explorations, - // GA4 Data API, and other products like Firebase & Admob that can retrieve - // data from Google Analytics through a linkage. These records don't include - // property configuration changes like adding a stream or changing a - // property's time zone. For configuration change history, see - // [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). - rpc RunAccessReport(RunAccessReportRequest) - returns (RunAccessReportResponse) { - option (google.api.http) = { - post: "/v1alpha/{entity=properties/*}:runAccessReport" - body: "*" - additional_bindings { - post: "/v1alpha/{entity=accounts/*}:runAccessReport" - body: "*" - } - }; - } - - // Creates an access binding on an account or property. - rpc CreateAccessBinding(CreateAccessBindingRequest) returns (AccessBinding) { - option (google.api.http) = { - post: "/v1alpha/{parent=accounts/*}/accessBindings" - body: "access_binding" - additional_bindings { - post: "/v1alpha/{parent=properties/*}/accessBindings" - body: "access_binding" - } - }; - option (google.api.method_signature) = "parent,access_binding"; - } - - // Gets information about an access binding. - rpc GetAccessBinding(GetAccessBindingRequest) returns (AccessBinding) { - option (google.api.http) = { - get: "/v1alpha/{name=accounts/*/accessBindings/*}" - additional_bindings { - get: "/v1alpha/{name=properties/*/accessBindings/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Updates an access binding on an account or property. - rpc UpdateAccessBinding(UpdateAccessBindingRequest) returns (AccessBinding) { - option (google.api.http) = { - patch: "/v1alpha/{access_binding.name=accounts/*/accessBindings/*}" - body: "access_binding" - additional_bindings { - patch: "/v1alpha/{access_binding.name=properties/*/accessBindings/*}" - body: "access_binding" - } - }; - option (google.api.method_signature) = "access_binding"; - } - - // Deletes an access binding on an account or property. - rpc DeleteAccessBinding(DeleteAccessBindingRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha/{name=accounts/*/accessBindings/*}" - additional_bindings { - delete: "/v1alpha/{name=properties/*/accessBindings/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists all access bindings on an account or property. - rpc ListAccessBindings(ListAccessBindingsRequest) - returns (ListAccessBindingsResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=accounts/*}/accessBindings" - additional_bindings { - get: "/v1alpha/{parent=properties/*}/accessBindings" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Creates information about multiple access bindings to an account or - // property. - // - // This method is transactional. If any AccessBinding cannot be created, none - // of the AccessBindings will be created. - rpc BatchCreateAccessBindings(BatchCreateAccessBindingsRequest) - returns (BatchCreateAccessBindingsResponse) { - option (google.api.http) = { - post: "/v1alpha/{parent=accounts/*}/accessBindings:batchCreate" - body: "*" - additional_bindings { - post: "/v1alpha/{parent=properties/*}/accessBindings:batchCreate" - body: "*" - } - }; - } - - // Gets information about multiple access bindings to an account or property. - rpc BatchGetAccessBindings(BatchGetAccessBindingsRequest) - returns (BatchGetAccessBindingsResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=accounts/*}/accessBindings:batchGet" - additional_bindings { - get: "/v1alpha/{parent=properties/*}/accessBindings:batchGet" - } - }; - } - - // Updates information about multiple access bindings to an account or - // property. - rpc BatchUpdateAccessBindings(BatchUpdateAccessBindingsRequest) - returns (BatchUpdateAccessBindingsResponse) { - option (google.api.http) = { - post: "/v1alpha/{parent=accounts/*}/accessBindings:batchUpdate" - body: "*" - additional_bindings { - post: "/v1alpha/{parent=properties/*}/accessBindings:batchUpdate" - body: "*" - } - }; - } - - // Deletes information about multiple users' links to an account or property. - rpc BatchDeleteAccessBindings(BatchDeleteAccessBindingsRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1alpha/{parent=accounts/*}/accessBindings:batchDelete" - body: "*" - additional_bindings { - post: "/v1alpha/{parent=properties/*}/accessBindings:batchDelete" - body: "*" - } - }; - } - - // Lookup for a single ExpandedDataSet. - rpc GetExpandedDataSet(GetExpandedDataSetRequest) returns (ExpandedDataSet) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/expandedDataSets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists ExpandedDataSets on a property. - rpc ListExpandedDataSets(ListExpandedDataSetsRequest) - returns (ListExpandedDataSetsResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=properties/*}/expandedDataSets" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates a ExpandedDataSet. - rpc CreateExpandedDataSet(CreateExpandedDataSetRequest) - returns (ExpandedDataSet) { - option (google.api.http) = { - post: "/v1alpha/{parent=properties/*}/expandedDataSets" - body: "expanded_data_set" - }; - option (google.api.method_signature) = "parent,expanded_data_set"; - } - - // Updates a ExpandedDataSet on a property. - rpc UpdateExpandedDataSet(UpdateExpandedDataSetRequest) - returns (ExpandedDataSet) { - option (google.api.http) = { - patch: "/v1alpha/{expanded_data_set.name=properties/*/expandedDataSets/*}" - body: "expanded_data_set" - }; - option (google.api.method_signature) = "expanded_data_set,update_mask"; - } - - // Deletes a ExpandedDataSet on a property. - rpc DeleteExpandedDataSet(DeleteExpandedDataSetRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha/{name=properties/*/expandedDataSets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Sets the opt out status for the automated GA4 setup process for a UA - // property. - // Note: this has no effect on GA4 property. - rpc SetAutomatedGa4ConfigurationOptOut( - SetAutomatedGa4ConfigurationOptOutRequest) - returns (SetAutomatedGa4ConfigurationOptOutResponse) { - option (google.api.http) = { - post: "/v1alpha/properties:setAutomatedGa4ConfigurationOptOut" - body: "*" - }; - } - - // Fetches the opt out status for the automated GA4 setup process for a UA - // property. - // Note: this has no effect on GA4 property. - rpc FetchAutomatedGa4ConfigurationOptOut( - FetchAutomatedGa4ConfigurationOptOutRequest) - returns (FetchAutomatedGa4ConfigurationOptOutResponse) { - option (google.api.http) = { - post: "/v1alpha/properties:fetchAutomatedGa4ConfigurationOptOut" - body: "*" - }; - } - - // Lookup for a single BigQuery Link. - rpc GetBigQueryLink(GetBigQueryLinkRequest) returns (BigQueryLink) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/bigQueryLinks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists BigQuery Links on a property. - rpc ListBigQueryLinks(ListBigQueryLinksRequest) - returns (ListBigQueryLinksResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=properties/*}/bigQueryLinks" - }; - option (google.api.method_signature) = "parent"; - } - - // Returns the enhanced measurement settings for this data stream. - // Note that the stream must enable enhanced measurement for these settings to - // take effect. - rpc GetEnhancedMeasurementSettings(GetEnhancedMeasurementSettingsRequest) - returns (EnhancedMeasurementSettings) { - option (google.api.http) = { - get: "/v1alpha/{name=properties/*/dataStreams/*/enhancedMeasurementSettings}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates the enhanced measurement settings for this data stream. - // Note that the stream must enable enhanced measurement for these settings to - // take effect. - rpc UpdateEnhancedMeasurementSettings( - UpdateEnhancedMeasurementSettingsRequest) - returns (EnhancedMeasurementSettings) { - option (google.api.http) = { - patch: "/v1alpha/{enhanced_measurement_settings.name=properties/*/dataStreams/*/enhancedMeasurementSettings}" - body: "enhanced_measurement_settings" - }; - option (google.api.method_signature) = - "enhanced_measurement_settings,update_mask"; - } - - // Creates a connected site tag for a Universal Analytics property. You can - // create a maximum of 20 connected site tags per property. - // Note: This API cannot be used on GA4 properties. - rpc CreateConnectedSiteTag(CreateConnectedSiteTagRequest) - returns (CreateConnectedSiteTagResponse) { - option (google.api.http) = { - post: "/v1alpha/properties:createConnectedSiteTag" - body: "*" - }; - } - - // Deletes a connected site tag for a Universal Analytics property. - // Note: this has no effect on GA4 properties. - rpc DeleteConnectedSiteTag(DeleteConnectedSiteTagRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1alpha/properties:deleteConnectedSiteTag" - body: "*" - }; - } - - // Lists the connected site tags for a Universal Analytics property. A maximum - // of 20 connected site tags will be returned. Note: this has no effect on GA4 - // property. - rpc ListConnectedSiteTags(ListConnectedSiteTagsRequest) - returns (ListConnectedSiteTagsResponse) { - option (google.api.http) = { - post: "/v1alpha/properties:listConnectedSiteTags" - body: "*" - }; - } -} - -// The request for a Data Access Record Report. -message RunAccessReportRequest { - // The Data Access Report supports requesting at the property level or account - // level. If requested at the account level, Data Access Reports include all - // access for all properties under that account. - // - // To request at the property level, entity should be for example - // 'properties/123' if "123" is your GA4 property ID. To request at the - // account level, entity should be for example 'accounts/1234' if "1234" is - // your GA4 Account ID. - string entity = 1; - - // The dimensions requested and displayed in the response. Requests are - // allowed up to 9 dimensions. - repeated AccessDimension dimensions = 2; - - // The metrics requested and displayed in the response. Requests are allowed - // up to 10 metrics. - repeated AccessMetric metrics = 3; - - // Date ranges of access records to read. If multiple date ranges are - // requested, each response row will contain a zero based date range index. If - // two date ranges overlap, the access records for the overlapping days is - // included in the response rows for both date ranges. Requests are allowed up - // to 2 date ranges. - repeated AccessDateRange date_ranges = 4; - - // Dimension filters let you restrict report response to specific - // dimension values which match the filter. For example, filtering on access - // records of a single user. To learn more, see [Fundamentals of Dimension - // Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) - // for examples. Metrics cannot be used in this filter. - AccessFilterExpression dimension_filter = 5; - - // Metric filters allow you to restrict report response to specific metric - // values which match the filter. Metric filters are applied after aggregating - // the report's rows, similar to SQL having-clause. Dimensions cannot be used - // in this filter. - AccessFilterExpression metric_filter = 6; - - // The row count of the start row. The first row is counted as row 0. If - // offset is unspecified, it is treated as 0. If offset is zero, then this - // method will return the first page of results with `limit` entries. - // - // To learn more about this pagination parameter, see - // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - int64 offset = 7; - - // The number of rows to return. If unspecified, 10,000 rows are returned. The - // API returns a maximum of 100,000 rows per request, no matter how many you - // ask for. `limit` must be positive. - // - // The API may return fewer rows than the requested `limit`, if there aren't - // as many remaining rows as the `limit`. For instance, there are fewer than - // 300 possible values for the dimension `country`, so when reporting on only - // `country`, you can't get more than 300 rows, even if you set `limit` to a - // higher value. - // - // To learn more about this pagination parameter, see - // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - int64 limit = 8; - - // This request's time zone if specified. If unspecified, the property's time - // zone is used. The request's time zone is used to interpret the start & end - // dates of the report. - // - // Formatted as strings from the IANA Time Zone database - // (https://www.iana.org/time-zones); for example "America/New_York" or - // "Asia/Tokyo". - string time_zone = 9; - - // Specifies how rows are ordered in the response. - repeated AccessOrderBy order_bys = 10; - - // Toggles whether to return the current state of this Analytics Property's - // quota. Quota is returned in [AccessQuota](#AccessQuota). For account-level - // requests, this field must be false. - bool return_entity_quota = 11; -} - -// The customized Data Access Record Report response. -message RunAccessReportResponse { - // The header for a column in the report that corresponds to a specific - // dimension. The number of DimensionHeaders and ordering of DimensionHeaders - // matches the dimensions present in rows. - repeated AccessDimensionHeader dimension_headers = 1; - - // The header for a column in the report that corresponds to a specific - // metric. The number of MetricHeaders and ordering of MetricHeaders matches - // the metrics present in rows. - repeated AccessMetricHeader metric_headers = 2; - - // Rows of dimension value combinations and metric values in the report. - repeated AccessRow rows = 3; - - // The total number of rows in the query result. `rowCount` is independent of - // the number of rows returned in the response, the `limit` request - // parameter, and the `offset` request parameter. For example if a query - // returns 175 rows and includes `limit` of 50 in the API request, the - // response will contain `rowCount` of 175 but only 50 rows. - // - // To learn more about this pagination parameter, see - // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - int32 row_count = 4; - - // The quota state for this Analytics property including this request. This - // field doesn't work with account-level requests. - AccessQuota quota = 5; -} - -// 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 (for example, "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 Cloud 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 `ListFirebaseLinks` 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 GetSearchAds360Link RPC. -message GetSearchAds360LinkRequest { - // Required. The name of the SearchAds360Link to get. - // Example format: properties/1234/SearchAds360Link/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/SearchAds360Link" - } - ]; -} - -// Request message for ListSearchAds360Links RPC. -message ListSearchAds360LinksRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/SearchAds360Link" - } - ]; - - // 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 `ListSearchAds360Links` - // call. Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // `ListSearchAds360Links` must match the call that provided the - // page token. - string page_token = 3; -} - -// Response message for ListSearchAds360Links RPC. -message ListSearchAds360LinksResponse { - // List of SearchAds360Links. - repeated SearchAds360Link search_ads_360_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 CreateSearchAds360Link RPC. -message CreateSearchAds360LinkRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/SearchAds360Link" - } - ]; - - // Required. The SearchAds360Link to create. - SearchAds360Link search_ads_360_link = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for DeleteSearchAds360Link RPC. -message DeleteSearchAds360LinkRequest { - // Required. The name of the SearchAds360Link to delete. - // Example format: properties/1234/SearchAds360Links/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/SearchAds360Link" - } - ]; -} - -// Request message for UpdateSearchAds360Link RPC. -message UpdateSearchAds360LinkRequest { - // The SearchAds360Link to update - SearchAds360Link search_ads_360_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 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" - } - ]; -} - -// Request message for GetAudience RPC. -message GetAudienceRequest { - // Required. The name of the Audience to get. - // Example format: properties/1234/audiences/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Audience" - } - ]; -} - -// Request message for ListAudiences RPC. -message ListAudiencesRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/Audience" - } - ]; - - // 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 `ListAudiences` call. Provide this - // to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListAudiences` must - // match the call that provided the page token. - string page_token = 3; -} - -// Response message for ListAudiences RPC. -message ListAudiencesResponse { - // List of Audiences. - repeated Audience audiences = 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 CreateAudience RPC. -message CreateAudienceRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/Audience" - } - ]; - - // Required. The audience to create. - Audience audience = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for UpdateAudience RPC. -message UpdateAudienceRequest { - // Required. The audience to update. - // The audience's `name` field is used to identify the audience to be updated. - Audience audience = 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 ArchiveAudience RPC. -message ArchiveAudienceRequest { - // Required. Example format: properties/1234/audiences/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/Audience" - } - ]; -} - -// Request message for GetAttributionSettings RPC. -message GetAttributionSettingsRequest { - // Required. The name of the attribution settings to retrieve. - // Format: properties/{property}/attributionSettings - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/AttributionSettings" - } - ]; -} - -// Request message for UpdateAttributionSettings RPC -message UpdateAttributionSettingsRequest { - // Required. The attribution settings to update. - // The `name` field is used to identify the settings to be updated. - AttributionSettings attribution_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 GetAccessBinding RPC. -message GetAccessBindingRequest { - // Required. The name of the access binding to retrieve. - // Formats: - // - accounts/{account}/accessBindings/{accessBinding} - // - properties/{property}/accessBindings/{accessBinding} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/AccessBinding" - } - ]; -} - -// Request message for BatchGetAccessBindings RPC. -message BatchGetAccessBindingsRequest { - // Required. The account or property that owns the access bindings. The parent - // of all provided values for the 'names' field must match this field. - // Formats: - // - accounts/{account} - // - properties/{property} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/AccessBinding" - } - ]; - - // Required. The names of the access bindings to retrieve. - // A maximum of 1000 access bindings can be retrieved in a batch. - // Formats: - // - accounts/{account}/accessBindings/{accessBinding} - // - properties/{property}/accessBindings/{accessBinding} - repeated string names = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/AccessBinding" - } - ]; -} - -// Response message for BatchGetAccessBindings RPC. -message BatchGetAccessBindingsResponse { - // The requested access bindings. - repeated AccessBinding access_bindings = 1; -} - -// Request message for ListAccessBindings RPC. -message ListAccessBindingsRequest { - // Required. Formats: - // - accounts/{account} - // - properties/{property} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/AccessBinding" - } - ]; - - // The maximum number of access bindings to return. - // The service may return fewer than this value. - // If unspecified, at most 200 access bindings 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 `ListAccessBindings` call. - // Provide this to retrieve the subsequent page. - // When paginating, all other parameters provided to `ListAccessBindings` must - // match the call that provided the page token. - string page_token = 3; -} - -// Response message for ListAccessBindings RPC. -message ListAccessBindingsResponse { - // List of AccessBindings. These will be ordered stably, but in an arbitrary - // order. - repeated AccessBinding access_bindings = 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 CreateAccessBinding RPC. -message CreateAccessBindingRequest { - // Required. Formats: - // - accounts/{account} - // - properties/{property} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/AccessBinding" - } - ]; - - // Required. The access binding to create. - AccessBinding access_binding = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for BatchCreateAccessBindings RPC. -message BatchCreateAccessBindingsRequest { - // Required. The account or property that owns the access bindings. The parent - // field in the CreateAccessBindingRequest messages must either be empty or - // match this field. Formats: - // - accounts/{account} - // - properties/{property} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/AccessBinding" - } - ]; - - // Required. The requests specifying the access bindings to create. - // A maximum of 1000 access bindings can be created in a batch. - repeated CreateAccessBindingRequest requests = 3 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for BatchCreateAccessBindings RPC. -message BatchCreateAccessBindingsResponse { - // The access bindings created. - repeated AccessBinding access_bindings = 1; -} - -// Request message for UpdateAccessBinding RPC. -message UpdateAccessBindingRequest { - // Required. The access binding to update. - AccessBinding access_binding = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for BatchUpdateAccessBindings RPC. -message BatchUpdateAccessBindingsRequest { - // Required. The account or property that owns the access bindings. The parent - // of all provided AccessBinding in UpdateAccessBindingRequest messages must - // match this field. - // Formats: - // - accounts/{account} - // - properties/{property} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/AccessBinding" - } - ]; - - // Required. The requests specifying the access bindings to update. - // A maximum of 1000 access bindings can be updated in a batch. - repeated UpdateAccessBindingRequest requests = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for BatchUpdateAccessBindings RPC. -message BatchUpdateAccessBindingsResponse { - // The access bindings updated. - repeated AccessBinding access_bindings = 1; -} - -// Request message for DeleteAccessBinding RPC. -message DeleteAccessBindingRequest { - // Required. Formats: - // - accounts/{account}/accessBindings/{accessBinding} - // - properties/{property}/accessBindings/{accessBinding} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/AccessBinding" - } - ]; -} - -// Request message for BatchDeleteAccessBindings RPC. -message BatchDeleteAccessBindingsRequest { - // Required. The account or property that owns the access bindings. The parent - // of all provided values for the 'names' field in DeleteAccessBindingRequest - // messages must match this field. Formats: - // - accounts/{account} - // - properties/{property} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/AccessBinding" - } - ]; - - // Required. The requests specifying the access bindings to delete. - // A maximum of 1000 access bindings can be deleted in a batch. - repeated DeleteAccessBindingRequest requests = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for CreateExpandedDataSet RPC. -message CreateExpandedDataSetRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/ExpandedDataSet" - } - ]; - - // Required. The ExpandedDataSet to create. - ExpandedDataSet expanded_data_set = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for UpdateExpandedDataSet RPC. -message UpdateExpandedDataSetRequest { - // Required. The ExpandedDataSet to update. - // The resource's `name` field is used to identify the ExpandedDataSet to be - // updated. - ExpandedDataSet expanded_data_set = 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 DeleteExpandedDataSet RPC. -message DeleteExpandedDataSetRequest { - // Required. Example format: properties/1234/expandedDataSets/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/ExpandedDataSet" - } - ]; -} - -// Request message for GetExpandedDataSet RPC. -message GetExpandedDataSetRequest { - // Required. The name of the Audience to get. - // Example format: properties/1234/expandedDataSets/5678 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/ExpandedDataSet" - } - ]; -} - -// Request message for ListExpandedDataSets RPC. -message ListExpandedDataSetsRequest { - // Required. Example format: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/ExpandedDataSet" - } - ]; - - // 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 `ListExpandedDataSets` call. Provide - // this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListExpandedDataSet` - // must match the call that provided the page token. - string page_token = 3; -} - -// Response message for ListExpandedDataSets RPC. -message ListExpandedDataSetsResponse { - // List of ExpandedDataSet. These will be ordered stably, but in an arbitrary - // order. - repeated ExpandedDataSet expanded_data_sets = 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 for setting the opt out status for the automated GA4 setup process. -message SetAutomatedGa4ConfigurationOptOutRequest { - // Required. The UA property to set the opt out status. Note this request uses - // the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. - // Format: properties/{internalWebPropertyId} - // Example: properties/1234 - string property = 1 [(google.api.field_behavior) = REQUIRED]; - - // The status to set. - bool opt_out = 2; -} - -// Response message for setting the opt out status for the automated GA4 setup -// process. -message SetAutomatedGa4ConfigurationOptOutResponse {} - -// Request for fetching the opt out status for the automated GA4 setup process. -message FetchAutomatedGa4ConfigurationOptOutRequest { - // Required. The UA property to get the opt out status. Note this request uses - // the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. - // Format: properties/{internalWebPropertyId} - // Example: properties/1234 - string property = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for fetching the opt out status for the automated GA4 setup -// process. -message FetchAutomatedGa4ConfigurationOptOutResponse { - // The opt out status for the UA property. - bool opt_out = 1; -} - -// Request message for GetBigQueryLink RPC. -message GetBigQueryLinkRequest { - // Required. The name of the BigQuery link to lookup. - // Format: properties/{property_id}/bigQueryLinks/{bigquery_link_id} - // Example: properties/123/bigQueryLinks/456 - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/BigQueryLink" - } - ]; -} - -// Request message for ListBigQueryLinks RPC. -message ListBigQueryLinksRequest { - // Required. The name of the property to list BigQuery links under. - // Format: properties/{property_id} - // Example: properties/1234 - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "analyticsadmin.googleapis.com/BigQueryLink" - } - ]; - - // 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 `ListBigQueryLinks` call. - // Provide this to retrieve the subsequent page. - // When paginating, all other parameters provided to `ListBigQueryLinks` must - // match the call that provided the page token. - string page_token = 3; -} - -// Response message for ListBigQueryLinks RPC -message ListBigQueryLinksResponse { - // List of BigQueryLinks. - repeated BigQueryLink bigquery_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 GetEnhancedMeasurementSettings RPC. -message GetEnhancedMeasurementSettingsRequest { - // Required. The name of the settings to lookup. - // Format: - // properties/{property}/dataStreams/{data_stream}/enhancedMeasurementSettings - // Example: "properties/1000/dataStreams/2000/enhancedMeasurementSettings" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/EnhancedMeasurementSettings" - } - ]; -} - -// Request message for UpdateEnhancedMeasurementSettings RPC. -message UpdateEnhancedMeasurementSettingsRequest { - // Required. The settings to update. - // The `name` field is used to identify the settings to be updated. - EnhancedMeasurementSettings enhanced_measurement_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 CreateConnectedSiteTag RPC. -message CreateConnectedSiteTagRequest { - // The Universal Analytics property to create connected site tags for. - // This API does not support GA4 properties. - // Format: properties/{universalAnalyticsPropertyId} - // Example: properties/1234 - string property = 1; - - // Required. The tag to add to the Universal Analytics property - ConnectedSiteTag connected_site_tag = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for CreateConnectedSiteTag RPC. -message CreateConnectedSiteTagResponse {} - -// Request message for DeleteConnectedSiteTag RPC. -message DeleteConnectedSiteTagRequest { - // The Universal Analytics property to delete connected site tags for. - // This API does not support GA4 properties. - // Format: properties/{universalAnalyticsPropertyId} - // Example: properties/1234 - string property = 1; - - // Tag ID to forward events to. Also known as the Measurement ID, or the - // "G-ID" (For example: G-12345). - string tag_id = 2; -} - -// Request message for ListConnectedSiteTags RPC. -message ListConnectedSiteTagsRequest { - // The Universal Analytics property to fetch connected site tags for. - // This does not work on GA4 properties. A maximum of 20 connected site tags - // will be returned. - // Example Format: `properties/1234` - string property = 1; -} - -// Response message for ListConnectedSiteTags RPC. -message ListConnectedSiteTagsResponse { - // The site tags for the Universal Analytics property. A maximum of 20 - // connected site tags will be returned. - repeated ConnectedSiteTag connected_site_tags = 1; -} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/audience.proto b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/audience.proto deleted file mode 100644 index ccc78ebbf79..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/audience.proto +++ /dev/null @@ -1,419 +0,0 @@ -// Copyright 2023 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/duration.proto"; - -option go_package = "google.golang.org/genproto/googleapis/analytics/admin/v1alpha;admin"; -option java_multiple_files = true; -option java_outer_classname = "AudienceProto"; -option java_package = "com.google.analytics.admin.v1alpha"; - -// Specifies how to evaluate users for joining an Audience. -enum AudienceFilterScope { - // Scope is not specified. - AUDIENCE_FILTER_SCOPE_UNSPECIFIED = 0; - - // User joins the Audience if the filter condition is met within one - // event. - AUDIENCE_FILTER_SCOPE_WITHIN_SAME_EVENT = 1; - - // User joins the Audience if the filter condition is met within one - // session. - AUDIENCE_FILTER_SCOPE_WITHIN_SAME_SESSION = 2; - - // User joins the Audience if the filter condition is met by any event - // across any session. - AUDIENCE_FILTER_SCOPE_ACROSS_ALL_SESSIONS = 3; -} - -// A specific filter for a single dimension or metric. -message AudienceDimensionOrMetricFilter { - // A filter for a string-type dimension that matches a particular pattern. - message StringFilter { - // The match type for the string filter. - enum MatchType { - // Unspecified - MATCH_TYPE_UNSPECIFIED = 0; - - // Exact match of the string value. - EXACT = 1; - - // Begins with the string value. - BEGINS_WITH = 2; - - // Ends with the string value. - ENDS_WITH = 3; - - // Contains the string value. - CONTAINS = 4; - - // Full regular expression matches with the string value. - FULL_REGEXP = 5; - } - - // Required. The match type for the string filter. - MatchType match_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The string value to be matched against. - string value = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. If true, the match is case-sensitive. If false, the match is - // case-insensitive. - bool case_sensitive = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // A filter for a string dimension that matches a particular list of options. - message InListFilter { - // Required. The list of possible string values to match against. Must be - // non-empty. - repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. If true, the match is case-sensitive. If false, the match is - // case-insensitive. - bool case_sensitive = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // To represent a number. - message NumericValue { - // One of a numeric value. - oneof one_value { - // Integer value. - int64 int64_value = 1; - - // Double value. - double double_value = 2; - } - } - - // A filter for numeric or date values on a dimension or metric. - message NumericFilter { - // The operation applied to a numeric filter. - enum Operation { - // Unspecified. - OPERATION_UNSPECIFIED = 0; - - // Equal. - EQUAL = 1; - - // Less than. - LESS_THAN = 2; - - // Greater than. - GREATER_THAN = 4; - } - - // Required. The operation applied to a numeric filter. - Operation operation = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The numeric or date value to match against. - NumericValue value = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // A filter for numeric or date values between certain values on a dimension - // or metric. - message BetweenFilter { - // Required. Begins with this number, inclusive. - NumericValue from_value = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Ends with this number, inclusive. - NumericValue to_value = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // One of the above filters. - oneof one_filter { - // A filter for a string-type dimension that matches a particular pattern. - StringFilter string_filter = 2; - - // A filter for a string dimension that matches a particular list of - // options. - InListFilter in_list_filter = 3; - - // A filter for numeric or date values on a dimension or metric. - NumericFilter numeric_filter = 4; - - // A filter for numeric or date values between certain values on a dimension - // or metric. - BetweenFilter between_filter = 5; - } - - // Required. Immutable. The dimension name or metric name to filter. - string field_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. Indicates whether this filter needs dynamic evaluation or not. If - // set to true, users join the Audience if they ever met the condition (static - // evaluation). If unset or set to false, user evaluation for an Audience is - // dynamic; users are added to an Audience when they meet the conditions and - // then removed when they no longer meet them. - // - // This can only be set when Audience scope is ACROSS_ALL_SESSIONS. - bool at_any_point_in_time = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, specifies the time window for which to evaluate data in - // number of days. If not set, then audience data is evaluated against - // lifetime data (i.e., infinite time window). - // - // For example, if set to 1 day, only the current day's data is evaluated. The - // reference point is the current day when at_any_point_in_time is unset or - // false. - // - // It can only be set when Audience scope is ACROSS_ALL_SESSIONS and cannot be - // greater than 60 days. - int32 in_any_n_day_period = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// A filter that matches events of a single event name. If an event parameter -// is specified, only the subset of events that match both the single event name -// and the parameter filter expressions match this event filter. -message AudienceEventFilter { - // Required. Immutable. The name of the event to match against. - string event_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. If specified, this filter matches events that match both the - // single event name and the parameter filter expressions. AudienceEventFilter - // inside the parameter filter expression cannot be set (i.e., nested - // event filters are not supported). This should be a single and_group of - // dimension_or_metric_filter or not_expression; ANDs of ORs are not - // supported. Also, if it includes a filter for "eventCount", only that one - // will be considered; all the other filters will be ignored. - AudienceFilterExpression event_parameter_filter_expression = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A logical expression of Audience dimension, metric, or event filters. -message AudienceFilterExpression { - // The expression applied to a filter. - oneof expr { - // A list of expressions to be AND’ed together. It can only contain - // AudienceFilterExpressions with or_group. This must be set for the top - // level AudienceFilterExpression. - AudienceFilterExpressionList and_group = 1; - - // A list of expressions to OR’ed together. It cannot contain - // AudienceFilterExpressions with and_group or or_group. - AudienceFilterExpressionList or_group = 2; - - // A filter expression to be NOT'ed (i.e., inverted, complemented). It - // can only include a dimension_or_metric_filter. This cannot be set on the - // top level AudienceFilterExpression. - AudienceFilterExpression not_expression = 3; - - // A filter on a single dimension or metric. This cannot be set on the top - // level AudienceFilterExpression. - AudienceDimensionOrMetricFilter dimension_or_metric_filter = 4; - - // Creates a filter that matches a specific event. This cannot be set on the - // top level AudienceFilterExpression. - AudienceEventFilter event_filter = 5; - } -} - -// A list of Audience filter expressions. -message AudienceFilterExpressionList { - // A list of Audience filter expressions. - repeated AudienceFilterExpression filter_expressions = 1; -} - -// Defines a simple filter that a user must satisfy to be a member of the -// Audience. -message AudienceSimpleFilter { - // Required. Immutable. Specifies the scope for this filter. - AudienceFilterScope scope = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Required. Immutable. A logical expression of Audience dimension, metric, or - // event filters. - AudienceFilterExpression filter_expression = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; -} - -// Defines filters that must occur in a specific order for the user to be a -// member of the Audience. -message AudienceSequenceFilter { - // A condition that must occur in the specified step order for this user - // to match the sequence. - message AudienceSequenceStep { - // Required. Immutable. Specifies the scope for this step. - AudienceFilterScope scope = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. If true, the event satisfying this step must be the very next - // event after the event satisfying the last step. If unset or false, this - // step indirectly follows the prior step; for example, there may be - // events between the prior step and this step. It is ignored for the - // first step. - bool immediately_follows = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When set, this step must be satisfied within the - // constraint_duration of the previous step (i.e., t[i] - t[i-1] <= - // constraint_duration). If not set, there is no duration requirement (the - // duration is effectively unlimited). It is ignored for the first step. - google.protobuf.Duration constraint_duration = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. Immutable. A logical expression of Audience dimension, metric, - // or event filters in each step. - AudienceFilterExpression filter_expression = 4 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - } - - // Required. Immutable. Specifies the scope for this filter. - AudienceFilterScope scope = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. Defines the time period in which the whole sequence must occur. - google.protobuf.Duration sequence_maximum_duration = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. An ordered sequence of steps. A user must complete each step in - // order to join the sequence filter. - repeated AudienceSequenceStep sequence_steps = 3 - [(google.api.field_behavior) = REQUIRED]; -} - -// A clause for defining either a simple or sequence filter. A filter can be -// inclusive (i.e., users satisfying the filter clause are included in the -// Audience) or exclusive (i.e., users satisfying the filter clause are -// excluded from the Audience). -message AudienceFilterClause { - // Specifies whether this is an include or exclude filter clause. - enum AudienceClauseType { - // Unspecified clause type. - AUDIENCE_CLAUSE_TYPE_UNSPECIFIED = 0; - - // Users will be included in the Audience if the filter clause is met. - INCLUDE = 1; - - // Users will be excluded from the Audience if the filter clause is met. - EXCLUDE = 2; - } - - oneof filter { - // A simple filter that a user must satisfy to be a member of the Audience. - AudienceSimpleFilter simple_filter = 2; - - // Filters that must occur in a specific order for the user to be a member - // of the Audience. - AudienceSequenceFilter sequence_filter = 3; - } - - // Required. Specifies whether this is an include or exclude filter clause. - AudienceClauseType clause_type = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Specifies an event to log when a user joins the Audience. -message AudienceEventTrigger { - // Determines when to log the event. - enum LogCondition { - // Log condition is not specified. - LOG_CONDITION_UNSPECIFIED = 0; - - // The event should be logged only when a user is joined. - AUDIENCE_JOINED = 1; - - // The event should be logged whenever the Audience condition is met, even - // if the user is already a member of the Audience. - AUDIENCE_MEMBERSHIP_RENEWED = 2; - } - - // Required. The event name that will be logged. - string event_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. When to log the event. - LogCondition log_condition = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// A resource message representing a GA4 Audience. -message Audience { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/Audience" - pattern: "properties/{property}/audiences/{audience}" - }; - - // Specifies how long an exclusion lasts for users that meet the exclusion - // filter. - enum AudienceExclusionDurationMode { - // Not specified. - AUDIENCE_EXCLUSION_DURATION_MODE_UNSPECIFIED = 0; - - // Exclude users from the Audience during periods when they meet the - // filter clause. - EXCLUDE_TEMPORARILY = 1; - - // Exclude users from the Audience if they've ever met the filter clause. - EXCLUDE_PERMANENTLY = 2; - } - - // Output only. The resource name for this Audience resource. - // Format: properties/{propertyId}/audiences/{audienceId} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the Audience. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The description of the Audience. - string description = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. Immutable. The duration a user should stay in an Audience. It - // cannot be set to more than 540 days. - int32 membership_duration_days = 4 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Output only. It is automatically set by GA to false if this is an NPA - // Audience and is excluded from ads personalization. - bool ads_personalization_enabled = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Specifies an event to log when a user joins the Audience. If not - // set, no event is logged when a user joins the Audience. - AudienceEventTrigger event_trigger = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Immutable. Specifies how long an exclusion lasts for users that meet the - // exclusion filter. It is applied to all EXCLUDE filter clauses and is - // ignored when there is no EXCLUDE filter clause in the Audience. - AudienceExclusionDurationMode exclusion_duration_mode = 7 - [(google.api.field_behavior) = IMMUTABLE]; - - // Required. Immutable. Unordered list. Filter clauses that define the - // Audience. All clauses will be AND’ed together. - repeated AudienceFilterClause filter_clauses = 8 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = UNORDERED_LIST - ]; -} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/expanded_data_set.proto b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/expanded_data_set.proto deleted file mode 100644 index 5a6e606139b..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/expanded_data_set.proto +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2023 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"; - -option go_package = "google.golang.org/genproto/googleapis/analytics/admin/v1alpha;admin"; -option java_multiple_files = true; -option java_outer_classname = "ExpandedDataSetProto"; -option java_package = "com.google.analytics.admin.v1alpha"; - -// A specific filter for a single dimension -message ExpandedDataSetFilter { - // A filter for a string-type dimension that matches a particular pattern. - message StringFilter { - // The match type for the string filter. - enum MatchType { - // Unspecified - MATCH_TYPE_UNSPECIFIED = 0; - - // Exact match of the string value. - EXACT = 1; - - // Contains the string value. - CONTAINS = 2; - } - - // Required. The match type for the string filter. - MatchType match_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The string value to be matched against. - string value = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. If true, the match is case-sensitive. If false, the match is - // case-insensitive. - // Must be true when match_type is EXACT. - // Must be false when match_type is CONTAINS. - bool case_sensitive = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // A filter for a string dimension that matches a particular list of options. - message InListFilter { - // Required. The list of possible string values to match against. Must be - // non-empty. - repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. If true, the match is case-sensitive. If false, the match is - // case-insensitive. - // Must be true. - bool case_sensitive = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // One of the above filters. - oneof one_filter { - // A filter for a string-type dimension that matches a particular pattern. - StringFilter string_filter = 2; - - // A filter for a string dimension that matches a particular list of - // options. - InListFilter in_list_filter = 3; - } - - // Required. The dimension name to filter. - string field_name = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// A logical expression of EnhancedDataSet dimension filters. -message ExpandedDataSetFilterExpression { - // The expression applied to a filter. - oneof expr { - // A list of expressions to be AND’ed together. It must contain a - // ExpandedDataSetFilterExpression with either not_expression or - // dimension_filter. This must be set for the top level - // ExpandedDataSetFilterExpression. - ExpandedDataSetFilterExpressionList and_group = 1; - - // A filter expression to be NOT'ed (i.e., inverted, complemented). It - // must include a dimension_filter. This cannot be set on the - // top level ExpandedDataSetFilterExpression. - ExpandedDataSetFilterExpression not_expression = 2; - - // A filter on a single dimension. This cannot be set on the top - // level ExpandedDataSetFilterExpression. - ExpandedDataSetFilter filter = 3; - } -} - -// A list of ExpandedDataSet filter expressions. -message ExpandedDataSetFilterExpressionList { - // A list of ExpandedDataSet filter expressions. - repeated ExpandedDataSetFilterExpression filter_expressions = 1; -} - -// A resource message representing a GA4 ExpandedDataSet. -message ExpandedDataSet { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/ExpandedDataSet" - pattern: "properties/{property}/expandedDataSets/{expanded_data_set}" - }; - - // Output only. The resource name for this ExpandedDataSet resource. - // Format: properties/{property_id}/expandedDataSets/{expanded_data_set} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the ExpandedDataSet. - // Max 200 chars. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The description of the ExpandedDataSet. - // Max 50 chars. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Immutable. The list of dimensions included in the ExpandedDataSet. - // See the [API - // Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) - // for the list of dimension names. - repeated string dimension_names = 4 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The list of metrics included in the ExpandedDataSet. - // See the [API - // Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) - // for the list of dimension names. - repeated string metric_names = 5 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. A logical expression of ExpandedDataSet filters applied to - // dimension included in the ExpandedDataSet. This filter is used to reduce - // the number of rows and thus the change of encountering `other row`. - ExpandedDataSetFilterExpression dimension_filter_expression = 6 - [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. Time when expanded data set began (or will begin) collecing - // data. - google.protobuf.Timestamp data_collection_start_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto b/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto deleted file mode 100644 index b2f82cee4fc..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/protos/google/analytics/admin/v1alpha/resources.proto +++ /dev/null @@ -1,1555 +0,0 @@ -// Copyright 2023 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/expanded_data_set.proto"; -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; - - // SearchAds360Link resource - SEARCH_ADS_360_LINK = 16; - - // DataStream resource - DATA_STREAM = 18; - - // AttributionSettings resource - ATTRIBUTION_SETTINGS = 20; - - // ExpandedDataSet resource - EXPANDED_DATA_SET = 21; - - // ChannelGroup resource - CHANNEL_GROUP = 22; - - // EnhancedMeasurementSettings resource - ENHANCED_MEASUREMENT_SETTINGS = 24; -} - -// Status of the Google Signals settings. -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. -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; -} - -// Types of Property resources. -enum PropertyType { - // Unknown or unspecified property type - PROPERTY_TYPE_UNSPECIFIED = 0; - - // Ordinary GA4 property - PROPERTY_TYPE_ORDINARY = 1; - - // GA4 subproperty - PROPERTY_TYPE_SUBPROPERTY = 2; - - // GA4 rollup property - PROPERTY_TYPE_ROLLUP = 3; -} - -// 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]; - - // Immutable. The property type for this Property resource. When creating a - // property, if the type is "PROPERTY_TYPE_UNSPECIFIED", then - // "ORDINARY_PROPERTY" will be implied. "SUBPROPERTY" and "ROLLUP_PROPERTY" - // types cannot yet be created with the Google Analytics Admin API. - PropertyType property_type = 14 [(google.api.field_behavior) = IMMUTABLE]; - - // 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}, properties/{property} - // Example: "accounts/100", "properties/101" - 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; - - // The property's property type. - PropertyType property_type = 3; - - // Resource name of this property's logical parent. - // - // Note: The Property-Moving UI can be used to change the parent. - // Format: accounts/{account}, properties/{property} - // Example: "accounts/100", "properties/200" - string parent = 4; -} - -// 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}/dataStreams/{dataStream}/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 SearchAds360Link resource in change history. - SearchAds360Link search_ads_360_link = 16; - - // A snapshot of a DataStream resource in change history. - DataStream data_stream = 18; - - // A snapshot of AttributionSettings resource in change history. - AttributionSettings attribution_settings = 20; - - // A snapshot of an ExpandedDataSet resource in change history. - ExpandedDataSet expanded_data_set = 21; - - // A snapshot of a BigQuery link resource in change history. - BigQueryLink bigquery_link = 23; - - // A snapshot of EnhancedMeasurementSettings resource in change history. - EnhancedMeasurementSettings enhanced_measurement_settings = 24; - } - } - - // 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]; -} - -// A link between a GA4 property and a Search Ads 360 entity. -message SearchAds360Link { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/SearchAds360Link" - pattern: "properties/{property}/searchAds360Links/{search_ads_360_link}" - }; - - // Output only. The resource name for this SearchAds360Link resource. - // Format: properties/{propertyId}/searchAds360Links/{linkId} - // - // Note: linkId is not the Search Ads 360 advertiser ID - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. This field represents the Advertiser ID of the Search Ads 360 - // Advertiser. that has been linked. - string advertiser_id = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. Enables the import of campaign data from Search Ads 360 into the - // GA4 property. After link creation, this can only be updated from the Search - // Ads 360 product. - // If this field is not set on create, it will be defaulted to true. - google.protobuf.BoolValue campaign_data_sharing_enabled = 3 - [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. Enables the import of cost data from Search Ads 360 to 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 Search Ads 360 product. - // If this field is not set on create, it will be defaulted to true. - google.protobuf.BoolValue cost_data_sharing_enabled = 4 - [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The display name of the Search Ads 360 Advertiser. - // Allows users to easily identify the linked resource. - string advertiser_display_name = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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; - - // Enables export of site stats with this integration. - // If this field is not set on create, it will be defaulted to true. - google.protobuf.BoolValue site_stats_sharing_enabled = 7; -} - -// 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 with - // 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; -} - -// The attribution settings used for a given property. This is a singleton -// resource. -message AttributionSettings { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/AttributionSettings" - pattern: "properties/{property}/attributionSettings" - }; - - // How far back in time events should be considered for inclusion in a - // converting path which leads to the first install of an app or the first - // visit to a site. - enum AcquisitionConversionEventLookbackWindow { - // Lookback window size unspecified. - ACQUISITION_CONVERSION_EVENT_LOOKBACK_WINDOW_UNSPECIFIED = 0; - - // 7-day lookback window. - ACQUISITION_CONVERSION_EVENT_LOOKBACK_WINDOW_7_DAYS = 1; - - // 30-day lookback window. - ACQUISITION_CONVERSION_EVENT_LOOKBACK_WINDOW_30_DAYS = 2; - } - - // How far back in time events should be considered for inclusion in a - // converting path for all conversions other than first app install/first site - // visit. - enum OtherConversionEventLookbackWindow { - // Lookback window size unspecified. - OTHER_CONVERSION_EVENT_LOOKBACK_WINDOW_UNSPECIFIED = 0; - - // 30-day lookback window. - OTHER_CONVERSION_EVENT_LOOKBACK_WINDOW_30_DAYS = 1; - - // 60-day lookback window. - OTHER_CONVERSION_EVENT_LOOKBACK_WINDOW_60_DAYS = 2; - - // 90-day lookback window. - OTHER_CONVERSION_EVENT_LOOKBACK_WINDOW_90_DAYS = 3; - } - - // The reporting attribution model used to calculate conversion credit in this - // property's reports. - enum ReportingAttributionModel { - // Reporting attribution model unspecified. - REPORTING_ATTRIBUTION_MODEL_UNSPECIFIED = 0; - - // Data-driven attribution distributes credit for the conversion based on - // data for each conversion event. Each Data-driven model is specific to - // each advertiser and each conversion event. - CROSS_CHANNEL_DATA_DRIVEN = 1; - - // Ignores direct traffic and attributes 100% of the conversion value to the - // last channel that the customer clicked through (or engaged view through - // for YouTube) before converting. - CROSS_CHANNEL_LAST_CLICK = 2; - - // Gives all credit for the conversion to the first channel that a customer - // clicked (or engaged view through for YouTube) before converting. - CROSS_CHANNEL_FIRST_CLICK = 3; - - // Distributes the credit for the conversion equally across all the channels - // a customer clicked (or engaged view through for YouTube) before - // converting. - CROSS_CHANNEL_LINEAR = 4; - - // Attributes 40% credit to the first and last interaction, and the - // remaining 20% credit is distributed evenly to the middle interactions. - CROSS_CHANNEL_POSITION_BASED = 5; - - // Gives more credit to the touchpoints that happened closer in time to - // the conversion. - CROSS_CHANNEL_TIME_DECAY = 6; - - // Attributes 100% of the conversion value to the last Google Ads channel - // that the customer clicked through before converting. - ADS_PREFERRED_LAST_CLICK = 7; - } - - // Output only. Resource name of this attribution settings resource. - // Format: properties/{property_id}/attributionSettings - // Example: "properties/1000/attributionSettings" - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The lookback window configuration for acquisition conversion - // events. The default window size is 30 days. - AcquisitionConversionEventLookbackWindow - acquisition_conversion_event_lookback_window = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The lookback window for all other, non-acquisition conversion - // events. The default window size is 90 days. - OtherConversionEventLookbackWindow other_conversion_event_lookback_window = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The reporting attribution model used to calculate conversion - // credit in this property's reports. - // - // Changing the attribution model will apply to both historical and future - // data. These changes will be reflected in reports with conversion and - // revenue data. User and session data will be unaffected. - ReportingAttributionModel reporting_attribution_model = 4 - [(google.api.field_behavior) = REQUIRED]; -} - -// A binding of a user to a set of roles. -message AccessBinding { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/AccessBinding" - pattern: "accounts/{account}/accessBindings/{access_binding}" - pattern: "properties/{property}/accessBindings/{access_binding}" - }; - - // The target for which to set roles for. - oneof access_target { - // If set, the email address of the user to set roles for. - // Format: "someuser@gmail.com" - string user = 2; - } - - // Output only. Resource name of this binding. - // - // Format: accounts/{account}/accessBindings/{access_binding} or - // properties/{property}/accessBindings/{access_binding} - // - // Example: - // "accounts/100/accessBindings/200" - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // A list of roles for to grant to the parent resource. - // - // Valid values: - // predefinedRoles/viewer - // predefinedRoles/analyst - // predefinedRoles/editor - // predefinedRoles/admin - // predefinedRoles/no-cost-data - // predefinedRoles/no-revenue-data - // - // For users, if an empty list of roles is set, this AccessBinding will be - // deleted. - repeated string roles = 3; -} - -// A link between a GA4 Property and BigQuery project. -message BigQueryLink { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/BigQueryLink" - pattern: "properties/{property}/bigQueryLinks/{bigquery_link}" - }; - - // Output only. Resource name of this BigQuery link. - // Format: 'properties/{property_id}/bigQueryLinks/{bigquery_link_id}' - // Format: 'properties/1234/bigQueryLinks/abc567' - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The linked Google Cloud project. When creating a BigQueryLink, - // you may provide this resource name using either a project number or project - // ID. Once this resource has been created, the returned project will always - // have a project that contains a project number. - // Format: 'projects/{project number}' - // Example: 'projects/1234' - string project = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. Time when the link was created. - google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // If set true, enables daily data export to the linked Google Cloud project. - bool daily_export_enabled = 4; - - // If set true, enables streaming export to the linked Google Cloud project. - bool streaming_export_enabled = 5; - - // If set true, enables intraday export to the linked Google Cloud project. - bool intraday_export_enabled = 9; - - // If set true, exported data will include advertising identifiers for mobile - // app streams. - bool include_advertising_id = 6; - - // The list of streams under the parent property for which data will be - // exported. - // Format: properties/{property_id}/dataStreams/{stream_id} - // Example: ['properties/1000/dataStreams/2000'] - repeated string export_streams = 7; - - // The list of event names that will be excluded from exports. - repeated string excluded_events = 8; -} - -// Singleton resource under a WebDataStream, configuring measurement of -// additional site interactions and content. -message EnhancedMeasurementSettings { - option (google.api.resource) = { - type: "analyticsadmin.googleapis.com/EnhancedMeasurementSettings" - pattern: "properties/{property}/dataStreams/{data_stream}/enhancedMeasurementSettings" - }; - - // Output only. Resource name of the Enhanced Measurement Settings. - // Format: - // properties/{property_id}/dataStreams/{data_stream}/enhancedMeasurementSettings - // Example: "properties/1000/dataStreams/2000/enhancedMeasurementSettings" - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Indicates whether Enhanced Measurement Settings will be used to - // automatically measure interactions and content on this web stream. - // - // Changing this value does not affect the settings themselves, but determines - // whether they are respected. - bool stream_enabled = 2; - - // If enabled, capture scroll events each time a visitor gets to the bottom of - // a page. - bool scrolls_enabled = 3; - - // If enabled, capture an outbound click event each time a visitor clicks a - // link that leads them away from your domain. - bool outbound_clicks_enabled = 4; - - // If enabled, capture a view search results event each time a visitor - // performs a search on your site (based on a query parameter). - bool site_search_enabled = 5; - - // If enabled, capture video play, progress, and complete events as visitors - // view embedded videos on your site. - bool video_engagement_enabled = 6; - - // If enabled, capture a file download event each time a link is clicked with - // a common document, compressed file, application, video, or audio extension. - bool file_downloads_enabled = 7; - - // If enabled, capture a page view event each time the website changes the - // browser history state. - bool page_changes_enabled = 8; - - // If enabled, capture a form interaction event each time a visitor interacts - // with a form on your website. - // False by default. - bool form_interactions_enabled = 9; - - // Required. URL query parameters to interpret as site search parameters. - // Max length is 1024 characters. Must not be empty. - string search_query_parameter = 10 [(google.api.field_behavior) = REQUIRED]; - - // Additional URL query parameters. - // Max length is 1024 characters. - string uri_query_parameter = 11; -} - -// Configuration for a specific Connected Site Tag. -message ConnectedSiteTag { - // Required. User-provided display name for the connected site tag. Must be - // less than 256 characters. - string display_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. "Tag ID to forward events to. Also known as the Measurement ID, - // or the "G-ID" (For example: G-12345). - string tag_id = 2 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js deleted file mode 100644 index 98083278d13..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js deleted file mode 100644 index de70e74c894..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_audience.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_audience.js deleted file mode 100644 index cdcf17da58b..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_audience.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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_ArchiveAudience_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234/audiences/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callArchiveAudience() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.archiveAudience(request); - console.log(response); - } - - callArchiveAudience(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveAudience_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js deleted file mode 100644 index f87956f6a66..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js deleted file mode 100644 index b8e70cfca04..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.audit_user_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.audit_user_links.js deleted file mode 100644 index d52beedb093..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.audit_user_links.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_access_bindings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_access_bindings.js deleted file mode 100644 index b6cc750168a..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_access_bindings.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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_BatchCreateAccessBindings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account or property that owns the access bindings. The parent - * field in the CreateAccessBindingRequest messages must either be empty or - * match this field. Formats: - * - accounts/{account} - * - properties/{property} - */ - // const parent = 'abc123' - /** - * Required. The requests specifying the access bindings to create. - * A maximum of 1000 access bindings 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 callBatchCreateAccessBindings() { - // Construct request - const request = { - parent, - requests, - }; - - // Run request - const response = await adminClient.batchCreateAccessBindings(request); - console.log(response); - } - - callBatchCreateAccessBindings(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateAccessBindings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_user_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_user_links.js deleted file mode 100644 index 060696acf81..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_create_user_links.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_access_bindings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_access_bindings.js deleted file mode 100644 index 9a52a27a279..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_access_bindings.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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_BatchDeleteAccessBindings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account or property that owns the access bindings. The parent - * of all provided values for the 'names' field in DeleteAccessBindingRequest - * messages must match this field. Formats: - * - accounts/{account} - * - properties/{property} - */ - // const parent = 'abc123' - /** - * Required. The requests specifying the access bindings to delete. - * A maximum of 1000 access bindings can be deleted 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 callBatchDeleteAccessBindings() { - // Construct request - const request = { - parent, - requests, - }; - - // Run request - const response = await adminClient.batchDeleteAccessBindings(request); - console.log(response); - } - - callBatchDeleteAccessBindings(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteAccessBindings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_user_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_user_links.js deleted file mode 100644 index 07e4b169229..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_delete_user_links.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_access_bindings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_access_bindings.js deleted file mode 100644 index d161e86210b..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_access_bindings.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2023 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_BatchGetAccessBindings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account or property that owns the access bindings. The parent - * of all provided values for the 'names' field must match this field. - * Formats: - * - accounts/{account} - * - properties/{property} - */ - // const parent = 'abc123' - /** - * Required. The names of the access bindings to retrieve. - * A maximum of 1000 access bindings can be retrieved in a batch. - * Formats: - * - accounts/{account}/accessBindings/{accessBinding} - * - properties/{property}/accessBindings/{accessBinding} - */ - // const names = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callBatchGetAccessBindings() { - // Construct request - const request = { - parent, - names, - }; - - // Run request - const response = await adminClient.batchGetAccessBindings(request); - console.log(response); - } - - callBatchGetAccessBindings(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetAccessBindings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_user_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_user_links.js deleted file mode 100644 index dd2b0c2ff53..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_get_user_links.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_access_bindings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_access_bindings.js deleted file mode 100644 index 284b77a899a..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_access_bindings.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2023 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_BatchUpdateAccessBindings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account or property that owns the access bindings. The parent - * of all provided AccessBinding in UpdateAccessBindingRequest messages must - * match this field. - * Formats: - * - accounts/{account} - * - properties/{property} - */ - // const parent = 'abc123' - /** - * Required. The requests specifying the access bindings to update. - * A maximum of 1000 access bindings 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 callBatchUpdateAccessBindings() { - // Construct request - const request = { - parent, - requests, - }; - - // Run request - const response = await adminClient.batchUpdateAccessBindings(request); - console.log(response); - } - - callBatchUpdateAccessBindings(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateAccessBindings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_user_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_user_links.js deleted file mode 100644 index 5f67f5778e7..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.batch_update_user_links.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js deleted file mode 100644 index dbb143850c9..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_access_binding.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_access_binding.js deleted file mode 100644 index bd6831adac8..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_access_binding.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2023 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, accessBinding) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAccessBinding_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Formats: - * - accounts/{account} - * - properties/{property} - */ - // const parent = 'abc123' - /** - * Required. The access binding to create. - */ - // const accessBinding = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateAccessBinding() { - // Construct request - const request = { - parent, - accessBinding, - }; - - // Run request - const response = await adminClient.createAccessBinding(request); - console.log(response); - } - - callCreateAccessBinding(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAccessBinding_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_audience.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_audience.js deleted file mode 100644 index daeacc2aab2..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_audience.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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, audience) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAudience_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * Required. The audience to create. - */ - // const audience = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateAudience() { - // Construct request - const request = { - parent, - audience, - }; - - // Run request - const response = await adminClient.createAudience(request); - console.log(response); - } - - callCreateAudience(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAudience_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_connected_site_tag.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_connected_site_tag.js deleted file mode 100644 index ec3d16a77e1..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_connected_site_tag.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2023 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(connectedSiteTag) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConnectedSiteTag_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The Universal Analytics property to create connected site tags for. - * This API does not support GA4 properties. - * Format: properties/{universalAnalyticsPropertyId} - * Example: properties/1234 - */ - // const property = 'abc123' - /** - * Required. The tag to add to the Universal Analytics property - */ - // const connectedSiteTag = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateConnectedSiteTag() { - // Construct request - const request = { - connectedSiteTag, - }; - - // Run request - const response = await adminClient.createConnectedSiteTag(request); - console.log(response); - } - - callCreateConnectedSiteTag(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConnectedSiteTag_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js deleted file mode 100644 index f91a5a90008..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js deleted file mode 100644 index 7c8f9b12d3a..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js deleted file mode 100644 index a4d290d5085..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js deleted file mode 100644 index 6f35f883eeb..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js deleted file mode 100644 index 569aa1af1c5..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js deleted file mode 100644 index 8f825694bda..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_expanded_data_set.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_expanded_data_set.js deleted file mode 100644 index 998c7143212..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_expanded_data_set.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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, expandedDataSet) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateExpandedDataSet_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * Required. The ExpandedDataSet to create. - */ - // const expandedDataSet = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateExpandedDataSet() { - // Construct request - const request = { - parent, - expandedDataSet, - }; - - // Run request - const response = await adminClient.createExpandedDataSet(request); - console.log(response); - } - - callCreateExpandedDataSet(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateExpandedDataSet_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js deleted file mode 100644 index 6e3d476986e..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js deleted file mode 100644 index 4d03720a8a0..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js deleted file mode 100644 index f3c4fa76475..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_property.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_property.js deleted file mode 100644 index 8d9ad7c4175..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_property.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_search_ads360_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_search_ads360_link.js deleted file mode 100644 index 59a71dff161..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_search_ads360_link.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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, searchAds_360Link) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateSearchAds360Link_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234 - */ - // const parent = 'abc123' - /** - * Required. The SearchAds360Link to create. - */ - // const searchAds_360Link = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callCreateSearchAds360Link() { - // Construct request - const request = { - parent, - searchAds_360Link, - }; - - // Run request - const response = await adminClient.createSearchAds360Link(request); - console.log(response); - } - - callCreateSearchAds360Link(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateSearchAds360Link_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_user_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_user_link.js deleted file mode 100644 index 1aa08159cc2..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.create_user_link.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_access_binding.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_access_binding.js deleted file mode 100644 index 52a55931963..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_access_binding.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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_DeleteAccessBinding_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Formats: - * - accounts/{account}/accessBindings/{accessBinding} - * - properties/{property}/accessBindings/{accessBinding} - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callDeleteAccessBinding() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteAccessBinding(request); - console.log(response); - } - - callDeleteAccessBinding(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccessBinding_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_account.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_account.js deleted file mode 100644 index 867e1628b3b..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_account.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_connected_site_tag.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_connected_site_tag.js deleted file mode 100644 index cd6c4d71e8f..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_connected_site_tag.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2023 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_DeleteConnectedSiteTag_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The Universal Analytics property to delete connected site tags for. - * This API does not support GA4 properties. - * Format: properties/{universalAnalyticsPropertyId} - * Example: properties/1234 - */ - // const property = 'abc123' - /** - * Tag ID to forward events to. Also known as the Measurement ID, or the - * "G-ID" (For example: G-12345). - */ - // const tagId = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callDeleteConnectedSiteTag() { - // Construct request - const request = { - }; - - // Run request - const response = await adminClient.deleteConnectedSiteTag(request); - console.log(response); - } - - callDeleteConnectedSiteTag(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConnectedSiteTag_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js deleted file mode 100644 index 1820c4aea41..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js deleted file mode 100644 index aeb8b3748f0..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js deleted file mode 100644 index d778ebd08f5..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js deleted file mode 100644 index 362b62b42c5..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_expanded_data_set.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_expanded_data_set.js deleted file mode 100644 index b72569808b2..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_expanded_data_set.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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_DeleteExpandedDataSet_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Example format: properties/1234/expandedDataSets/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callDeleteExpandedDataSet() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteExpandedDataSet(request); - console.log(response); - } - - callDeleteExpandedDataSet(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteExpandedDataSet_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js deleted file mode 100644 index 19d8ee7af4c..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js deleted file mode 100644 index 104d055896c..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js deleted file mode 100644 index f336a0dfdc2..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_property.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_property.js deleted file mode 100644 index 3d90302d7c2..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_property.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_search_ads360_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_search_ads360_link.js deleted file mode 100644 index 35605a18326..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_search_ads360_link.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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_DeleteSearchAds360Link_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the SearchAds360Link to delete. - * Example format: properties/1234/SearchAds360Links/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callDeleteSearchAds360Link() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteSearchAds360Link(request); - console.log(response); - } - - callDeleteSearchAds360Link(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteSearchAds360Link_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_user_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_user_link.js deleted file mode 100644 index 6c875323a34..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.delete_user_link.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js deleted file mode 100644 index 60a7bff718c..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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_FetchAutomatedGa4ConfigurationOptOut_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The UA property to get the opt out status. Note this request uses - * the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. - * Format: properties/{internalWebPropertyId} - * Example: properties/1234 - */ - // const property = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callFetchAutomatedGa4ConfigurationOptOut() { - // Construct request - const request = { - property, - }; - - // Run request - const response = await adminClient.fetchAutomatedGa4ConfigurationOptOut(request); - console.log(response); - } - - callFetchAutomatedGa4ConfigurationOptOut(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_FetchAutomatedGa4ConfigurationOptOut_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_access_binding.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_access_binding.js deleted file mode 100644 index 31b46782f6d..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_access_binding.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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_GetAccessBinding_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the access binding to retrieve. - * Formats: - * - accounts/{account}/accessBindings/{accessBinding} - * - properties/{property}/accessBindings/{accessBinding} - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetAccessBinding() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getAccessBinding(request); - console.log(response); - } - - callGetAccessBinding(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccessBinding_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_account.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_account.js deleted file mode 100644 index 48934bcd2ca..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_account.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_attribution_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_attribution_settings.js deleted file mode 100644 index 9abec8f1fe2..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_attribution_settings.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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_GetAttributionSettings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the attribution settings to retrieve. - * Format: properties/{property}/attributionSettings - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetAttributionSettings() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getAttributionSettings(request); - console.log(response); - } - - callGetAttributionSettings(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAttributionSettings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_audience.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_audience.js deleted file mode 100644 index 4f67ea0074d..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_audience.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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_GetAudience_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the Audience to get. - * Example format: properties/1234/audiences/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetAudience() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getAudience(request); - console.log(response); - } - - callGetAudience(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAudience_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_big_query_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_big_query_link.js deleted file mode 100644 index 5564736ccf6..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_big_query_link.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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_GetBigQueryLink_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the BigQuery link to lookup. - * Format: properties/{property_id}/bigQueryLinks/{bigquery_link_id} - * Example: properties/123/bigQueryLinks/456 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetBigQueryLink() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getBigQueryLink(request); - console.log(response); - } - - callGetBigQueryLink(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetBigQueryLink_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js deleted file mode 100644 index e5f84fc9277..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js deleted file mode 100644 index 1f2e72e8754..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js deleted file mode 100644 index 9b3cd0878d3..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js deleted file mode 100644 index 23bd95b466a..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js deleted file mode 100644 index f00649b543f..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js deleted file mode 100644 index fe0067d6930..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js deleted file mode 100644 index bba9c0e7f77..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js deleted file mode 100644 index b9f1c986cc9..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_enhanced_measurement_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_enhanced_measurement_settings.js deleted file mode 100644 index 8d6711c21c0..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_enhanced_measurement_settings.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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_GetEnhancedMeasurementSettings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the settings to lookup. - * Format: - * properties/{property}/dataStreams/{data_stream}/enhancedMeasurementSettings - * Example: "properties/1000/dataStreams/2000/enhancedMeasurementSettings" - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetEnhancedMeasurementSettings() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getEnhancedMeasurementSettings(request); - console.log(response); - } - - callGetEnhancedMeasurementSettings(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetEnhancedMeasurementSettings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_expanded_data_set.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_expanded_data_set.js deleted file mode 100644 index 96f278f0ea4..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_expanded_data_set.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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_GetExpandedDataSet_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the Audience to get. - * Example format: properties/1234/expandedDataSets/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetExpandedDataSet() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getExpandedDataSet(request); - console.log(response); - } - - callGetExpandedDataSet(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetExpandedDataSet_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js deleted file mode 100644 index 59f5e3d0791..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js deleted file mode 100644 index d52d63e42b6..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js deleted file mode 100644 index 47699dbaeab..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_property.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_property.js deleted file mode 100644 index 404250f65ba..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_property.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_search_ads360_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_search_ads360_link.js deleted file mode 100644 index 289b4db508b..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_search_ads360_link.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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_GetSearchAds360Link_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the SearchAds360Link to get. - * Example format: properties/1234/SearchAds360Link/5678 - */ - // const name = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callGetSearchAds360Link() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getSearchAds360Link(request); - console.log(response); - } - - callGetSearchAds360Link(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetSearchAds360Link_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_user_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_user_link.js deleted file mode 100644 index 6c45e8fc0a6..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.get_user_link.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_access_bindings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_access_bindings.js deleted file mode 100644 index 42a759900f1..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_access_bindings.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2023 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_ListAccessBindings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Formats: - * - accounts/{account} - * - properties/{property} - */ - // const parent = 'abc123' - /** - * The maximum number of access bindings to return. - * The service may return fewer than this value. - * If unspecified, at most 200 access bindings 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 `ListAccessBindings` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccessBindings` 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 callListAccessBindings() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listAccessBindingsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAccessBindings(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccessBindings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js deleted file mode 100644 index 5b8c1884043..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_accounts.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_accounts.js deleted file mode 100644 index 9a784dda130..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_accounts.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_audiences.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_audiences.js deleted file mode 100644 index f8e33615a5c..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_audiences.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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_ListAudiences_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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 `ListAudiences` call. Provide this - * to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAudiences` 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 callListAudiences() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listAudiencesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAudiences(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAudiences_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_big_query_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_big_query_links.js deleted file mode 100644 index 54814082c7a..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_big_query_links.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2023 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_ListBigQueryLinks_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the property to list BigQuery links under. - * 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 `ListBigQueryLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListBigQueryLinks` 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 callListBigQueryLinks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listBigQueryLinksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListBigQueryLinks(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListBigQueryLinks_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_connected_site_tags.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_connected_site_tags.js deleted file mode 100644 index e7a4115d8a8..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_connected_site_tags.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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_ListConnectedSiteTags_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The Universal Analytics property to fetch connected site tags for. - * This does not work on GA4 properties. A maximum of 20 connected site tags - * will be returned. - * Example Format: `properties/1234` - */ - // const property = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callListConnectedSiteTags() { - // Construct request - const request = { - }; - - // Run request - const response = await adminClient.listConnectedSiteTags(request); - console.log(response); - } - - callListConnectedSiteTags(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConnectedSiteTags_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js deleted file mode 100644 index 70b2297f8a8..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js deleted file mode 100644 index a53a7e9da4f..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js deleted file mode 100644 index 2256aa9d2cb..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js deleted file mode 100644 index 2dbc06ef961..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js deleted file mode 100644 index a9c504f2629..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js deleted file mode 100644 index b137201eeb0..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_expanded_data_sets.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_expanded_data_sets.js deleted file mode 100644 index 3b0b6199b7c..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_expanded_data_sets.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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_ListExpandedDataSets_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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 `ListExpandedDataSets` call. Provide - * this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListExpandedDataSet` - * 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 callListExpandedDataSets() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listExpandedDataSetsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListExpandedDataSets(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListExpandedDataSets_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js deleted file mode 100644 index bb69c4e2ab4..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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 `ListFirebaseLinks` 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js deleted file mode 100644 index 4d3e44d82b6..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js deleted file mode 100644 index 7633be4e228..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_properties.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_properties.js deleted file mode 100644 index e74cc55d912..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_properties.js +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_search_ads360_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_search_ads360_links.js deleted file mode 100644 index 23d2973dc51..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_search_ads360_links.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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_ListSearchAds360Links_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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 `ListSearchAds360Links` - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `ListSearchAds360Links` 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 callListSearchAds360Links() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listSearchAds360LinksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSearchAds360Links(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListSearchAds360Links_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_user_links.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_user_links.js deleted file mode 100644 index 6587f55080b..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.list_user_links.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js deleted file mode 100644 index 4d91193354f..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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 Cloud 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.run_access_report.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.run_access_report.js deleted file mode 100644 index 101f8f1d967..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.run_access_report.js +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2023 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_RunAccessReport_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The Data Access Report supports requesting at the property level or account - * level. If requested at the account level, Data Access Reports include all - * access for all properties under that account. - * To request at the property level, entity should be for example - * 'properties/123' if "123" is your GA4 property ID. To request at the - * account level, entity should be for example 'accounts/1234' if "1234" is - * your GA4 Account ID. - */ - // const entity = 'abc123' - /** - * The dimensions requested and displayed in the response. Requests are - * allowed up to 9 dimensions. - */ - // const dimensions = 1234 - /** - * The metrics requested and displayed in the response. Requests are allowed - * up to 10 metrics. - */ - // const metrics = 1234 - /** - * Date ranges of access records to read. If multiple date ranges are - * requested, each response row will contain a zero based date range index. If - * two date ranges overlap, the access records for the overlapping days is - * included in the response rows for both date ranges. Requests are allowed up - * to 2 date ranges. - */ - // const dateRanges = 1234 - /** - * Dimension filters let you restrict report response to specific - * dimension values which match the filter. For example, filtering on access - * records of a single user. To learn more, see Fundamentals of Dimension - * Filters (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) - * for examples. Metrics cannot be used in this filter. - */ - // const dimensionFilter = {} - /** - * Metric filters allow you to restrict report response to specific metric - * values which match the filter. Metric filters are applied after aggregating - * the report's rows, similar to SQL having-clause. Dimensions cannot be used - * in this filter. - */ - // const metricFilter = {} - /** - * The row count of the start row. The first row is counted as row 0. If - * offset is unspecified, it is treated as 0. If offset is zero, then this - * method will return the first page of results with `limit` entries. - * To learn more about this pagination parameter, see - * Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - */ - // const offset = 1234 - /** - * The number of rows to return. If unspecified, 10,000 rows are returned. The - * API returns a maximum of 100,000 rows per request, no matter how many you - * ask for. `limit` must be positive. - * The API may return fewer rows than the requested `limit`, if there aren't - * as many remaining rows as the `limit`. For instance, there are fewer than - * 300 possible values for the dimension `country`, so when reporting on only - * `country`, you can't get more than 300 rows, even if you set `limit` to a - * higher value. - * To learn more about this pagination parameter, see - * Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - */ - // const limit = 1234 - /** - * This request's time zone if specified. If unspecified, the property's time - * zone is used. The request's time zone is used to interpret the start & end - * dates of the report. - * Formatted as strings from the IANA Time Zone database - * (https://www.iana.org/time-zones); for example "America/New_York" or - * "Asia/Tokyo". - */ - // const timeZone = 'abc123' - /** - * Specifies how rows are ordered in the response. - */ - // const orderBys = 1234 - /** - * Toggles whether to return the current state of this Analytics Property's - * quota. Quota is returned in AccessQuota (#AccessQuota). For account-level - * requests, this field must be false. - */ - // const returnEntityQuota = true - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callRunAccessReport() { - // Construct request - const request = { - }; - - // Run request - const response = await adminClient.runAccessReport(request); - console.log(response); - } - - callRunAccessReport(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_RunAccessReport_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js deleted file mode 100644 index 0e538c86e34..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.set_automated_ga4_configuration_opt_out.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.set_automated_ga4_configuration_opt_out.js deleted file mode 100644 index 273015d7154..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.set_automated_ga4_configuration_opt_out.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2023 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_SetAutomatedGa4ConfigurationOptOut_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The UA property to set the opt out status. Note this request uses - * the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. - * Format: properties/{internalWebPropertyId} - * Example: properties/1234 - */ - // const property = 'abc123' - /** - * The status to set. - */ - // const optOut = true - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callSetAutomatedGa4ConfigurationOptOut() { - // Construct request - const request = { - property, - }; - - // Run request - const response = await adminClient.setAutomatedGa4ConfigurationOptOut(request); - console.log(response); - } - - callSetAutomatedGa4ConfigurationOptOut(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_SetAutomatedGa4ConfigurationOptOut_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_access_binding.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_access_binding.js deleted file mode 100644 index 281f812a694..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_access_binding.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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(accessBinding) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccessBinding_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The access binding to update. - */ - // const accessBinding = {} - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; - - // Instantiates a client - const adminClient = new AnalyticsAdminServiceClient(); - - async function callUpdateAccessBinding() { - // Construct request - const request = { - accessBinding, - }; - - // Run request - const response = await adminClient.updateAccessBinding(request); - console.log(response); - } - - callUpdateAccessBinding(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccessBinding_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_account.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_account.js deleted file mode 100644 index c0f57011485..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_account.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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 (for example, "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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_attribution_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_attribution_settings.js deleted file mode 100644 index 45c242e4b9f..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_attribution_settings.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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(attributionSettings, updateMask) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAttributionSettings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The attribution settings to update. - * The `name` field is used to identify the settings to be updated. - */ - // const attributionSettings = {} - /** - * 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 callUpdateAttributionSettings() { - // Construct request - const request = { - attributionSettings, - updateMask, - }; - - // Run request - const response = await adminClient.updateAttributionSettings(request); - console.log(response); - } - - callUpdateAttributionSettings(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAttributionSettings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_audience.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_audience.js deleted file mode 100644 index 3022808b717..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_audience.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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(audience, updateMask) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAudience_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The audience to update. - * The audience's `name` field is used to identify the audience to be updated. - */ - // const audience = {} - /** - * 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 callUpdateAudience() { - // Construct request - const request = { - audience, - updateMask, - }; - - // Run request - const response = await adminClient.updateAudience(request); - console.log(response); - } - - callUpdateAudience(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAudience_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js deleted file mode 100644 index a3db5b174dd..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js deleted file mode 100644 index b67e5c63655..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js deleted file mode 100644 index e1cbc71aa94..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js deleted file mode 100644 index a5a31d7fd75..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js deleted file mode 100644 index 57aa18ab7e2..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_enhanced_measurement_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_enhanced_measurement_settings.js deleted file mode 100644 index 0e7c94435b3..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_enhanced_measurement_settings.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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(enhancedMeasurementSettings, updateMask) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateEnhancedMeasurementSettings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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 enhancedMeasurementSettings = {} - /** - * 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 callUpdateEnhancedMeasurementSettings() { - // Construct request - const request = { - enhancedMeasurementSettings, - updateMask, - }; - - // Run request - const response = await adminClient.updateEnhancedMeasurementSettings(request); - console.log(response); - } - - callUpdateEnhancedMeasurementSettings(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateEnhancedMeasurementSettings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_expanded_data_set.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_expanded_data_set.js deleted file mode 100644 index 29dd5a06ae2..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_expanded_data_set.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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(expandedDataSet, updateMask) { - // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateExpandedDataSet_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The ExpandedDataSet to update. - * The resource's `name` field is used to identify the ExpandedDataSet to be - * updated. - */ - // const expandedDataSet = {} - /** - * 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 callUpdateExpandedDataSet() { - // Construct request - const request = { - expandedDataSet, - updateMask, - }; - - // Run request - const response = await adminClient.updateExpandedDataSet(request); - console.log(response); - } - - callUpdateExpandedDataSet(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateExpandedDataSet_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js deleted file mode 100644 index a72639f1bdc..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js deleted file mode 100644 index b2d449e33d6..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js deleted file mode 100644 index df2a333c0c8..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_property.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_property.js deleted file mode 100644 index 9b5ca7d5f5e..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_property.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_search_ads360_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_search_ads360_link.js deleted file mode 100644 index b0d81ed5103..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_search_ads360_link.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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_UpdateSearchAds360Link_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The SearchAds360Link to update - */ - // const searchAds_360Link = {} - /** - * 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 callUpdateSearchAds360Link() { - // Construct request - const request = { - updateMask, - }; - - // Run request - const response = await adminClient.updateSearchAds360Link(request); - console.log(response); - } - - callUpdateSearchAds360Link(); - // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateSearchAds360Link_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_user_link.js b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_user_link.js deleted file mode 100644 index e7fc37a7f18..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/analytics_admin_service.update_user_link.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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/google-analytics-admin/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json b/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json deleted file mode 100644 index 17dbe2d1275..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json +++ /dev/null @@ -1,4695 +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": 55, - "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": 70, - "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": 55, - "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": 62, - "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": 57, - "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": 64, - "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": 55, - "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": 89, - "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": 54, - "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 a GA4 Property.", - "canonical": true, - "file": "analytics_admin_service.delete_property.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "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": 63, - "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": 53, - "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": 63, - "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": 69, - "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": 69, - "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": 63, - "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": 68, - "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": 53, - "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": 62, - "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": 53, - "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": 62, - "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": 59, - "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": 54, - "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": 70, - "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": 56, - "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": 58, - "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": 60, - "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": 53, - "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": 68, - "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": 55, - "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": 55, - "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": 70, - "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": 59, - "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": 55, - "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": 57, - "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 through 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": 64, - "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": 99, - "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": 54, - "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": 62, - "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": 59, - "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": 55, - "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": 55, - "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": 69, - "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": 54, - "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": 69, - "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": 58, - "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": 54, - "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": 59, - "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": 54, - "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": 70, - "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": 58, - "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": 54, - "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": 54, - "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": 54, - "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": 58, - "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": 59, - "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": 68, - "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": 54, - "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": 54, - "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": 58, - "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": 59, - "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": 68, - "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": 54, - "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": 54, - "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": 56, - "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": 62, - "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": 58, - "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": 54, - "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": 59, - "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": 68, - "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": 54, - "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" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAudience_async", - "title": "AnalyticsAdminService getAudience Sample", - "origin": "API_DEFINITION", - "description": " Lookup for a single Audience. Audiences created before 2020 may not be supported. Default audiences will not show filter definitions.", - "canonical": true, - "file": "analytics_admin_service.get_audience.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAudience", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAudience", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.Audience", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetAudience", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAudience", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAudiences_async", - "title": "AnalyticsAdminService listAudiences Sample", - "origin": "API_DEFINITION", - "description": " Lists Audiences on a property. Audiences created before 2020 may not be supported. Default audiences will not show filter definitions.", - "canonical": true, - "file": "analytics_admin_service.list_audiences.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAudiences", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAudiences", - "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.ListAudiencesResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListAudiences", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAudiences", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAudience_async", - "title": "AnalyticsAdminService createAudience Sample", - "origin": "API_DEFINITION", - "description": " Creates an Audience.", - "canonical": true, - "file": "analytics_admin_service.create_audience.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateAudience", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateAudience", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "audience", - "type": ".google.analytics.admin.v1alpha.Audience" - } - ], - "resultType": ".google.analytics.admin.v1alpha.Audience", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateAudience", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateAudience", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAudience_async", - "title": "AnalyticsAdminService updateAudience Sample", - "origin": "API_DEFINITION", - "description": " Updates an Audience on a property.", - "canonical": true, - "file": "analytics_admin_service.update_audience.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateAudience", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAudience", - "async": true, - "parameters": [ - { - "name": "audience", - "type": ".google.analytics.admin.v1alpha.Audience" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.Audience", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateAudience", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAudience", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveAudience_async", - "title": "AnalyticsAdminService archiveAudience Sample", - "origin": "API_DEFINITION", - "description": " Archives an Audience on a property.", - "canonical": true, - "file": "analytics_admin_service.archive_audience.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ArchiveAudience", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ArchiveAudience", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ArchiveAudience", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ArchiveAudience", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetSearchAds360Link_async", - "title": "AnalyticsAdminService getSearchAds360Link Sample", - "origin": "API_DEFINITION", - "description": " Look up a single SearchAds360Link", - "canonical": true, - "file": "analytics_admin_service.get_search_ads360_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSearchAds360Link", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetSearchAds360Link", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.SearchAds360Link", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetSearchAds360Link", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetSearchAds360Link", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListSearchAds360Links_async", - "title": "AnalyticsAdminService listSearchAds360Links Sample", - "origin": "API_DEFINITION", - "description": " Lists all SearchAds360Links on a property.", - "canonical": true, - "file": "analytics_admin_service.list_search_ads360_links.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSearchAds360Links", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListSearchAds360Links", - "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.ListSearchAds360LinksResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListSearchAds360Links", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListSearchAds360Links", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateSearchAds360Link_async", - "title": "AnalyticsAdminService createSearchAds360Link Sample", - "origin": "API_DEFINITION", - "description": " Creates a SearchAds360Link.", - "canonical": true, - "file": "analytics_admin_service.create_search_ads360_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSearchAds360Link", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateSearchAds360Link", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "search_ads_360_link", - "type": ".google.analytics.admin.v1alpha.SearchAds360Link" - } - ], - "resultType": ".google.analytics.admin.v1alpha.SearchAds360Link", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateSearchAds360Link", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateSearchAds360Link", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteSearchAds360Link_async", - "title": "AnalyticsAdminService deleteSearchAds360Link Sample", - "origin": "API_DEFINITION", - "description": " Deletes a SearchAds360Link on a property.", - "canonical": true, - "file": "analytics_admin_service.delete_search_ads360_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteSearchAds360Link", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteSearchAds360Link", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteSearchAds360Link", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteSearchAds360Link", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateSearchAds360Link_async", - "title": "AnalyticsAdminService updateSearchAds360Link Sample", - "origin": "API_DEFINITION", - "description": " Updates a SearchAds360Link on a property.", - "canonical": true, - "file": "analytics_admin_service.update_search_ads360_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSearchAds360Link", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateSearchAds360Link", - "async": true, - "parameters": [ - { - "name": "search_ads_360_link", - "type": ".google.analytics.admin.v1alpha.SearchAds360Link" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.SearchAds360Link", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateSearchAds360Link", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateSearchAds360Link", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAttributionSettings_async", - "title": "AnalyticsAdminService getAttributionSettings Sample", - "origin": "API_DEFINITION", - "description": " Lookup for a AttributionSettings singleton.", - "canonical": true, - "file": "analytics_admin_service.get_attribution_settings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAttributionSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAttributionSettings", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.AttributionSettings", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetAttributionSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAttributionSettings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAttributionSettings_async", - "title": "AnalyticsAdminService updateAttributionSettings Sample", - "origin": "API_DEFINITION", - "description": " Updates attribution settings on a property.", - "canonical": true, - "file": "analytics_admin_service.update_attribution_settings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateAttributionSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAttributionSettings", - "async": true, - "parameters": [ - { - "name": "attribution_settings", - "type": ".google.analytics.admin.v1alpha.AttributionSettings" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.AttributionSettings", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateAttributionSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAttributionSettings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_RunAccessReport_async", - "title": "AnalyticsAdminService runAccessReport Sample", - "origin": "API_DEFINITION", - "description": " Returns a customized report of data access records. The report provides records of each time a user reads Google Analytics reporting data. Access records are retained for up to 2 years. Data Access Reports can be requested for a property. The property must be in Google Analytics 360. This method is only available to Administrators. These data access records include GA4 UI Reporting, GA4 UI Explorations, GA4 Data API, and other products like Firebase & Admob that can retrieve data from Google Analytics through a linkage. These records don't include property configuration changes like adding a stream or changing a property's time zone. For configuration change history, see [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).", - "canonical": true, - "file": "analytics_admin_service.run_access_report.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 131, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunAccessReport", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.RunAccessReport", - "async": true, - "parameters": [ - { - "name": "entity", - "type": "TYPE_STRING" - }, - { - "name": "dimensions", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "metrics", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "date_ranges", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "dimension_filter", - "type": ".google.analytics.admin.v1alpha.AccessFilterExpression" - }, - { - "name": "metric_filter", - "type": ".google.analytics.admin.v1alpha.AccessFilterExpression" - }, - { - "name": "offset", - "type": "TYPE_INT64" - }, - { - "name": "limit", - "type": "TYPE_INT64" - }, - { - "name": "time_zone", - "type": "TYPE_STRING" - }, - { - "name": "order_bys", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "return_entity_quota", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.analytics.admin.v1alpha.RunAccessReportResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "RunAccessReport", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.RunAccessReport", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAccessBinding_async", - "title": "AnalyticsAdminService createAccessBinding Sample", - "origin": "API_DEFINITION", - "description": " Creates an access binding on an account or property.", - "canonical": true, - "file": "analytics_admin_service.create_access_binding.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateAccessBinding", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateAccessBinding", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "access_binding", - "type": ".google.analytics.admin.v1alpha.AccessBinding" - } - ], - "resultType": ".google.analytics.admin.v1alpha.AccessBinding", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateAccessBinding", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateAccessBinding", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccessBinding_async", - "title": "AnalyticsAdminService getAccessBinding Sample", - "origin": "API_DEFINITION", - "description": " Gets information about an access binding.", - "canonical": true, - "file": "analytics_admin_service.get_access_binding.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAccessBinding", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAccessBinding", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.AccessBinding", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetAccessBinding", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetAccessBinding", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccessBinding_async", - "title": "AnalyticsAdminService updateAccessBinding Sample", - "origin": "API_DEFINITION", - "description": " Updates an access binding on an account or property.", - "canonical": true, - "file": "analytics_admin_service.update_access_binding.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateAccessBinding", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAccessBinding", - "async": true, - "parameters": [ - { - "name": "access_binding", - "type": ".google.analytics.admin.v1alpha.AccessBinding" - } - ], - "resultType": ".google.analytics.admin.v1alpha.AccessBinding", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateAccessBinding", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateAccessBinding", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccessBinding_async", - "title": "AnalyticsAdminService deleteAccessBinding Sample", - "origin": "API_DEFINITION", - "description": " Deletes an access binding on an account or property.", - "canonical": true, - "file": "analytics_admin_service.delete_access_binding.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteAccessBinding", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteAccessBinding", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteAccessBinding", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteAccessBinding", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccessBindings_async", - "title": "AnalyticsAdminService listAccessBindings Sample", - "origin": "API_DEFINITION", - "description": " Lists all access bindings on an account or property.", - "canonical": true, - "file": "analytics_admin_service.list_access_bindings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAccessBindings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccessBindings", - "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.ListAccessBindingsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListAccessBindings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccessBindings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateAccessBindings_async", - "title": "AnalyticsAdminService batchCreateAccessBindings Sample", - "origin": "API_DEFINITION", - "description": " Creates information about multiple access bindings to an account or property. This method is transactional. If any AccessBinding cannot be created, none of the AccessBindings will be created.", - "canonical": true, - "file": "analytics_admin_service.batch_create_access_bindings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchCreateAccessBindings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchCreateAccessBindings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "requests", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.analytics.admin.v1alpha.BatchCreateAccessBindingsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "BatchCreateAccessBindings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchCreateAccessBindings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetAccessBindings_async", - "title": "AnalyticsAdminService batchGetAccessBindings Sample", - "origin": "API_DEFINITION", - "description": " Gets information about multiple access bindings to an account or property.", - "canonical": true, - "file": "analytics_admin_service.batch_get_access_bindings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchGetAccessBindings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchGetAccessBindings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "names", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.analytics.admin.v1alpha.BatchGetAccessBindingsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "BatchGetAccessBindings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchGetAccessBindings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateAccessBindings_async", - "title": "AnalyticsAdminService batchUpdateAccessBindings Sample", - "origin": "API_DEFINITION", - "description": " Updates information about multiple access bindings to an account or property.", - "canonical": true, - "file": "analytics_admin_service.batch_update_access_bindings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchUpdateAccessBindings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchUpdateAccessBindings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "requests", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.analytics.admin.v1alpha.BatchUpdateAccessBindingsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "BatchUpdateAccessBindings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchUpdateAccessBindings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteAccessBindings_async", - "title": "AnalyticsAdminService batchDeleteAccessBindings Sample", - "origin": "API_DEFINITION", - "description": " Deletes information about multiple users' links to an account or property.", - "canonical": true, - "file": "analytics_admin_service.batch_delete_access_bindings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchDeleteAccessBindings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchDeleteAccessBindings", - "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": "BatchDeleteAccessBindings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.BatchDeleteAccessBindings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetExpandedDataSet_async", - "title": "AnalyticsAdminService getExpandedDataSet Sample", - "origin": "API_DEFINITION", - "description": " Lookup for a single ExpandedDataSet.", - "canonical": true, - "file": "analytics_admin_service.get_expanded_data_set.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetExpandedDataSet", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetExpandedDataSet", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ExpandedDataSet", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetExpandedDataSet", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetExpandedDataSet", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListExpandedDataSets_async", - "title": "AnalyticsAdminService listExpandedDataSets Sample", - "origin": "API_DEFINITION", - "description": " Lists ExpandedDataSets on a property.", - "canonical": true, - "file": "analytics_admin_service.list_expanded_data_sets.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListExpandedDataSets", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListExpandedDataSets", - "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.ListExpandedDataSetsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListExpandedDataSets", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListExpandedDataSets", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateExpandedDataSet_async", - "title": "AnalyticsAdminService createExpandedDataSet Sample", - "origin": "API_DEFINITION", - "description": " Creates a ExpandedDataSet.", - "canonical": true, - "file": "analytics_admin_service.create_expanded_data_set.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateExpandedDataSet", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateExpandedDataSet", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "expanded_data_set", - "type": ".google.analytics.admin.v1alpha.ExpandedDataSet" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ExpandedDataSet", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateExpandedDataSet", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateExpandedDataSet", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateExpandedDataSet_async", - "title": "AnalyticsAdminService updateExpandedDataSet Sample", - "origin": "API_DEFINITION", - "description": " Updates a ExpandedDataSet on a property.", - "canonical": true, - "file": "analytics_admin_service.update_expanded_data_set.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateExpandedDataSet", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateExpandedDataSet", - "async": true, - "parameters": [ - { - "name": "expanded_data_set", - "type": ".google.analytics.admin.v1alpha.ExpandedDataSet" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ExpandedDataSet", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateExpandedDataSet", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateExpandedDataSet", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteExpandedDataSet_async", - "title": "AnalyticsAdminService deleteExpandedDataSet Sample", - "origin": "API_DEFINITION", - "description": " Deletes a ExpandedDataSet on a property.", - "canonical": true, - "file": "analytics_admin_service.delete_expanded_data_set.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteExpandedDataSet", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteExpandedDataSet", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteExpandedDataSet", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteExpandedDataSet", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_SetAutomatedGa4ConfigurationOptOut_async", - "title": "AnalyticsAdminService setAutomatedGa4ConfigurationOptOut Sample", - "origin": "API_DEFINITION", - "description": " Sets the opt out status for the automated GA4 setup process for a UA property. Note: this has no effect on GA4 property.", - "canonical": true, - "file": "analytics_admin_service.set_automated_ga4_configuration_opt_out.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetAutomatedGa4ConfigurationOptOut", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.SetAutomatedGa4ConfigurationOptOut", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "opt_out", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "SetAutomatedGa4ConfigurationOptOut", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.SetAutomatedGa4ConfigurationOptOut", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_FetchAutomatedGa4ConfigurationOptOut_async", - "title": "AnalyticsAdminService fetchAutomatedGa4ConfigurationOptOut Sample", - "origin": "API_DEFINITION", - "description": " Fetches the opt out status for the automated GA4 setup process for a UA property. Note: this has no effect on GA4 property.", - "canonical": true, - "file": "analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchAutomatedGa4ConfigurationOptOut", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.FetchAutomatedGa4ConfigurationOptOut", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "FetchAutomatedGa4ConfigurationOptOut", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.FetchAutomatedGa4ConfigurationOptOut", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetBigQueryLink_async", - "title": "AnalyticsAdminService getBigQueryLink Sample", - "origin": "API_DEFINITION", - "description": " Lookup for a single BigQuery Link.", - "canonical": true, - "file": "analytics_admin_service.get_big_query_link.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBigQueryLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetBigQueryLink", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.BigQueryLink", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetBigQueryLink", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetBigQueryLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListBigQueryLinks_async", - "title": "AnalyticsAdminService listBigQueryLinks Sample", - "origin": "API_DEFINITION", - "description": " Lists BigQuery Links on a property.", - "canonical": true, - "file": "analytics_admin_service.list_big_query_links.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBigQueryLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListBigQueryLinks", - "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.ListBigQueryLinksResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListBigQueryLinks", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListBigQueryLinks", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetEnhancedMeasurementSettings_async", - "title": "AnalyticsAdminService getEnhancedMeasurementSettings Sample", - "origin": "API_DEFINITION", - "description": " Returns the enhanced measurement settings for this data stream. Note that the stream must enable enhanced measurement for these settings to take effect.", - "canonical": true, - "file": "analytics_admin_service.get_enhanced_measurement_settings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetEnhancedMeasurementSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetEnhancedMeasurementSettings", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.EnhancedMeasurementSettings", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetEnhancedMeasurementSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetEnhancedMeasurementSettings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateEnhancedMeasurementSettings_async", - "title": "AnalyticsAdminService updateEnhancedMeasurementSettings Sample", - "origin": "API_DEFINITION", - "description": " Updates the enhanced measurement settings for this data stream. Note that the stream must enable enhanced measurement for these settings to take effect.", - "canonical": true, - "file": "analytics_admin_service.update_enhanced_measurement_settings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateEnhancedMeasurementSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateEnhancedMeasurementSettings", - "async": true, - "parameters": [ - { - "name": "enhanced_measurement_settings", - "type": ".google.analytics.admin.v1alpha.EnhancedMeasurementSettings" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1alpha.EnhancedMeasurementSettings", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateEnhancedMeasurementSettings", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.UpdateEnhancedMeasurementSettings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConnectedSiteTag_async", - "title": "AnalyticsAdminService createConnectedSiteTag Sample", - "origin": "API_DEFINITION", - "description": " Creates a connected site tag for a Universal Analytics property. You can create a maximum of 20 connected site tags per property. Note: This API cannot be used on GA4 properties.", - "canonical": true, - "file": "analytics_admin_service.create_connected_site_tag.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateConnectedSiteTag", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateConnectedSiteTag", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "connected_site_tag", - "type": ".google.analytics.admin.v1alpha.ConnectedSiteTag" - } - ], - "resultType": ".google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateConnectedSiteTag", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateConnectedSiteTag", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConnectedSiteTag_async", - "title": "AnalyticsAdminService deleteConnectedSiteTag Sample", - "origin": "API_DEFINITION", - "description": " Deletes a connected site tag for a Universal Analytics property. Note: this has no effect on GA4 properties.", - "canonical": true, - "file": "analytics_admin_service.delete_connected_site_tag.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteConnectedSiteTag", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteConnectedSiteTag", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "tag_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteConnectedSiteTag", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteConnectedSiteTag", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConnectedSiteTags_async", - "title": "AnalyticsAdminService listConnectedSiteTags Sample", - "origin": "API_DEFINITION", - "description": " Lists the connected site tags for a Universal Analytics property. A maximum of 20 connected site tags will be returned. Note: this has no effect on GA4 property.", - "canonical": true, - "file": "analytics_admin_service.list_connected_site_tags.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListConnectedSiteTags", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListConnectedSiteTags", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListConnectedSiteTags", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListConnectedSiteTags", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/src/index.ts b/owl-bot-staging/google-analytics-admin/v1alpha/src/index.ts deleted file mode 100644 index cda54573e98..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2023 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/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client.ts b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client.ts deleted file mode 100644 index af40766dcc4..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client.ts +++ /dev/null @@ -1,11750 +0,0 @@ -// Copyright 2023 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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -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}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AnalyticsAdminServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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}' - ), - accountAccessBindingPathTemplate: new this._gaxModule.PathTemplate( - 'accounts/{account}/accessBindings/{access_binding}' - ), - accountSummaryPathTemplate: new this._gaxModule.PathTemplate( - 'accountSummaries/{account_summary}' - ), - accountUserLinkPathTemplate: new this._gaxModule.PathTemplate( - 'accounts/{account}/userLinks/{user_link}' - ), - attributionSettingsPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/attributionSettings' - ), - audiencePathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/audiences/{audience}' - ), - bigQueryLinkPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/bigQueryLinks/{bigquery_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}' - ), - enhancedMeasurementSettingsPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/dataStreams/{data_stream}/enhancedMeasurementSettings' - ), - expandedDataSetPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/expandedDataSets/{expanded_data_set}' - ), - 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}' - ), - propertyAccessBindingPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/accessBindings/{access_binding}' - ), - propertyUserLinkPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/userLinks/{user_link}' - ), - searchAds360LinkPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/searchAds360Links/{search_ads_360_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'), - listAudiences: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'audiences'), - listSearchAds360Links: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'searchAds_360Links'), - listAccessBindings: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'accessBindings'), - listExpandedDataSets: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'expandedDataSets'), - listBigQueryLinks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'bigqueryLinks') - }; - - // 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 = this._gaxModule.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', 'getAudience', 'listAudiences', 'createAudience', 'updateAudience', 'archiveAudience', 'getSearchAds360Link', 'listSearchAds360Links', 'createSearchAds360Link', 'deleteSearchAds360Link', 'updateSearchAds360Link', 'getAttributionSettings', 'updateAttributionSettings', 'runAccessReport', 'createAccessBinding', 'getAccessBinding', 'updateAccessBinding', 'deleteAccessBinding', 'listAccessBindings', 'batchCreateAccessBindings', 'batchGetAccessBindings', 'batchUpdateAccessBindings', 'batchDeleteAccessBindings', 'getExpandedDataSet', 'listExpandedDataSets', 'createExpandedDataSet', 'updateExpandedDataSet', 'deleteExpandedDataSet', 'setAutomatedGa4ConfigurationOptOut', 'fetchAutomatedGa4ConfigurationOptOut', 'getBigQueryLink', 'listBigQueryLinks', 'getEnhancedMeasurementSettings', 'updateEnhancedMeasurementSettings', 'createConnectedSiteTag', 'deleteConnectedSiteTag', 'listConnectedSiteTags']; - 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._opts.fallback - ); - - 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 {@link google.analytics.admin.v1alpha.Account | 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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' - ] = this._gaxModule.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 (for example, "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 {@link google.analytics.admin.v1alpha.Account | 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' - ] = this._gaxModule.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 Cloud 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 {@link google.analytics.admin.v1alpha.ProvisionAccountTicketResponse | 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 {@link google.analytics.admin.v1alpha.Property | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.Property | 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 a 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 {@link google.analytics.admin.v1alpha.Property | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.Property | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.UserLink | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.BatchGetUserLinksResponse | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.UserLink | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.BatchCreateUserLinksResponse | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.UserLink | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.BatchUpdateUserLinksResponse | 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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.FirebaseLink | 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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.GlobalSiteTag | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.GoogleAdsLink | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.GoogleAdsLink | 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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DataSharingSettings | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.MeasurementProtocolSecret | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.MeasurementProtocolSecret | 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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.MeasurementProtocolSecret | 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' - ] = this._gaxModule.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 through 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 {@link google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionResponse | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.GoogleSignalsSettings | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.GoogleSignalsSettings | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.ConversionEvent | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.ConversionEvent | 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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink | 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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal | 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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalResponse | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomDimension | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomDimension | 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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomDimension | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomMetric | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomMetric | 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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomMetric | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DataRetentionSettings | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DataRetentionSettings | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DataStream | 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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DataStream | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DataStream | 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getDataStream(request, options, callback); - } -/** - * Lookup for a single Audience. - * Audiences created before 2020 may not be supported. - * Default audiences will not show filter definitions. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Audience to get. - * Example format: properties/1234/audiences/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 {@link google.analytics.admin.v1alpha.Audience | Audience}. - * 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_audience.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAudience_async - */ - getAudience( - request?: protos.google.analytics.admin.v1alpha.IGetAudienceRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.IGetAudienceRequest|undefined, {}|undefined - ]>; - getAudience( - request: protos.google.analytics.admin.v1alpha.IGetAudienceRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.IGetAudienceRequest|null|undefined, - {}|null|undefined>): void; - getAudience( - request: protos.google.analytics.admin.v1alpha.IGetAudienceRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.IGetAudienceRequest|null|undefined, - {}|null|undefined>): void; - getAudience( - request?: protos.google.analytics.admin.v1alpha.IGetAudienceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.IGetAudienceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.IGetAudienceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.IGetAudienceRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getAudience(request, options, callback); - } -/** - * Creates an Audience. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {google.analytics.admin.v1alpha.Audience} request.audience - * Required. The audience 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 {@link google.analytics.admin.v1alpha.Audience | Audience}. - * 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_audience.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAudience_async - */ - createAudience( - request?: protos.google.analytics.admin.v1alpha.ICreateAudienceRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.ICreateAudienceRequest|undefined, {}|undefined - ]>; - createAudience( - request: protos.google.analytics.admin.v1alpha.ICreateAudienceRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.ICreateAudienceRequest|null|undefined, - {}|null|undefined>): void; - createAudience( - request: protos.google.analytics.admin.v1alpha.ICreateAudienceRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.ICreateAudienceRequest|null|undefined, - {}|null|undefined>): void; - createAudience( - request?: protos.google.analytics.admin.v1alpha.ICreateAudienceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.ICreateAudienceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.ICreateAudienceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.ICreateAudienceRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createAudience(request, options, callback); - } -/** - * Updates an Audience on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.Audience} request.audience - * Required. The audience to update. - * The audience's `name` field is used to identify the audience 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 {@link google.analytics.admin.v1alpha.Audience | Audience}. - * 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_audience.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAudience_async - */ - updateAudience( - request?: protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest|undefined, {}|undefined - ]>; - updateAudience( - request: protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest|null|undefined, - {}|null|undefined>): void; - updateAudience( - request: protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest|null|undefined, - {}|null|undefined>): void; - updateAudience( - request?: protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAudience, - protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'audience.name': request.audience!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateAudience(request, options, callback); - } -/** - * Archives an Audience on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Example format: properties/1234/audiences/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 {@link google.protobuf.Empty | 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_audience.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveAudience_async - */ - archiveAudience( - request?: protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest|undefined, {}|undefined - ]>; - archiveAudience( - request: protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest|null|undefined, - {}|null|undefined>): void; - archiveAudience( - request: protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest|null|undefined, - {}|null|undefined>): void; - archiveAudience( - request?: protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.archiveAudience(request, options, callback); - } -/** - * Look up a single SearchAds360Link - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the SearchAds360Link to get. - * Example format: properties/1234/SearchAds360Link/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 {@link google.analytics.admin.v1alpha.SearchAds360Link | SearchAds360Link}. - * 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_search_ads360_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetSearchAds360Link_async - */ - getSearchAds360Link( - request?: protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest|undefined, {}|undefined - ]>; - getSearchAds360Link( - request: protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest|null|undefined, - {}|null|undefined>): void; - getSearchAds360Link( - request: protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest|null|undefined, - {}|null|undefined>): void; - getSearchAds360Link( - request?: protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getSearchAds360Link(request, options, callback); - } -/** - * Creates a SearchAds360Link. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {google.analytics.admin.v1alpha.SearchAds360Link} request.searchAds_360Link - * Required. The SearchAds360Link 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 {@link google.analytics.admin.v1alpha.SearchAds360Link | SearchAds360Link}. - * 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_search_ads360_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateSearchAds360Link_async - */ - createSearchAds360Link( - request?: protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest|undefined, {}|undefined - ]>; - createSearchAds360Link( - request: protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest|null|undefined, - {}|null|undefined>): void; - createSearchAds360Link( - request: protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest|null|undefined, - {}|null|undefined>): void; - createSearchAds360Link( - request?: protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createSearchAds360Link(request, options, callback); - } -/** - * Deletes a SearchAds360Link on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the SearchAds360Link to delete. - * Example format: properties/1234/SearchAds360Links/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 {@link google.protobuf.Empty | 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_search_ads360_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteSearchAds360Link_async - */ - deleteSearchAds360Link( - request?: protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest|undefined, {}|undefined - ]>; - deleteSearchAds360Link( - request: protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest|null|undefined, - {}|null|undefined>): void; - deleteSearchAds360Link( - request: protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest|null|undefined, - {}|null|undefined>): void; - deleteSearchAds360Link( - request?: protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteSearchAds360Link(request, options, callback); - } -/** - * Updates a SearchAds360Link on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.SearchAds360Link} request.searchAds_360Link - * The SearchAds360Link 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 {@link google.analytics.admin.v1alpha.SearchAds360Link | SearchAds360Link}. - * 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_search_ads360_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateSearchAds360Link_async - */ - updateSearchAds360Link( - request?: protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest|undefined, {}|undefined - ]>; - updateSearchAds360Link( - request: protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest|null|undefined, - {}|null|undefined>): void; - updateSearchAds360Link( - request: protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest|null|undefined, - {}|null|undefined>): void; - updateSearchAds360Link( - request?: protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.ISearchAds360Link, - protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'search_ads_360_link.name': request.searchAds_360Link!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateSearchAds360Link(request, options, callback); - } -/** - * Lookup for a AttributionSettings singleton. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the attribution settings to retrieve. - * Format: properties/{property}/attributionSettings - * @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 {@link google.analytics.admin.v1alpha.AttributionSettings | AttributionSettings}. - * 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_attribution_settings.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAttributionSettings_async - */ - getAttributionSettings( - request?: protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAttributionSettings, - protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest|undefined, {}|undefined - ]>; - getAttributionSettings( - request: protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAttributionSettings, - protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest|null|undefined, - {}|null|undefined>): void; - getAttributionSettings( - request: protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAttributionSettings, - protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest|null|undefined, - {}|null|undefined>): void; - getAttributionSettings( - request?: protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IAttributionSettings, - protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IAttributionSettings, - protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAttributionSettings, - protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getAttributionSettings(request, options, callback); - } -/** - * Updates attribution settings on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.AttributionSettings} request.attributionSettings - * Required. The attribution 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 {@link google.analytics.admin.v1alpha.AttributionSettings | AttributionSettings}. - * 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_attribution_settings.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAttributionSettings_async - */ - updateAttributionSettings( - request?: protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAttributionSettings, - protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest|undefined, {}|undefined - ]>; - updateAttributionSettings( - request: protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAttributionSettings, - protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest|null|undefined, - {}|null|undefined>): void; - updateAttributionSettings( - request: protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAttributionSettings, - protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest|null|undefined, - {}|null|undefined>): void; - updateAttributionSettings( - request?: protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IAttributionSettings, - protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IAttributionSettings, - protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAttributionSettings, - protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'attribution_settings.name': request.attributionSettings!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateAttributionSettings(request, options, callback); - } -/** - * Returns a customized report of data access records. The report provides - * records of each time a user reads Google Analytics reporting data. Access - * records are retained for up to 2 years. - * - * Data Access Reports can be requested for a property. The property must be - * in Google Analytics 360. This method is only available to Administrators. - * - * These data access records include GA4 UI Reporting, GA4 UI Explorations, - * GA4 Data API, and other products like Firebase & Admob that can retrieve - * data from Google Analytics through a linkage. These records don't include - * property configuration changes like adding a stream or changing a - * property's time zone. For configuration change history, see - * [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.entity - * The Data Access Report supports requesting at the property level or account - * level. If requested at the account level, Data Access Reports include all - * access for all properties under that account. - * - * To request at the property level, entity should be for example - * 'properties/123' if "123" is your GA4 property ID. To request at the - * account level, entity should be for example 'accounts/1234' if "1234" is - * your GA4 Account ID. - * @param {number[]} request.dimensions - * The dimensions requested and displayed in the response. Requests are - * allowed up to 9 dimensions. - * @param {number[]} request.metrics - * The metrics requested and displayed in the response. Requests are allowed - * up to 10 metrics. - * @param {number[]} request.dateRanges - * Date ranges of access records to read. If multiple date ranges are - * requested, each response row will contain a zero based date range index. If - * two date ranges overlap, the access records for the overlapping days is - * included in the response rows for both date ranges. Requests are allowed up - * to 2 date ranges. - * @param {google.analytics.admin.v1alpha.AccessFilterExpression} request.dimensionFilter - * Dimension filters let you restrict report response to specific - * dimension values which match the filter. For example, filtering on access - * records of a single user. To learn more, see [Fundamentals of Dimension - * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) - * for examples. Metrics cannot be used in this filter. - * @param {google.analytics.admin.v1alpha.AccessFilterExpression} request.metricFilter - * Metric filters allow you to restrict report response to specific metric - * values which match the filter. Metric filters are applied after aggregating - * the report's rows, similar to SQL having-clause. Dimensions cannot be used - * in this filter. - * @param {number} request.offset - * The row count of the start row. The first row is counted as row 0. If - * offset is unspecified, it is treated as 0. If offset is zero, then this - * method will return the first page of results with `limit` entries. - * - * To learn more about this pagination parameter, see - * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - * @param {number} request.limit - * The number of rows to return. If unspecified, 10,000 rows are returned. The - * API returns a maximum of 100,000 rows per request, no matter how many you - * ask for. `limit` must be positive. - * - * The API may return fewer rows than the requested `limit`, if there aren't - * as many remaining rows as the `limit`. For instance, there are fewer than - * 300 possible values for the dimension `country`, so when reporting on only - * `country`, you can't get more than 300 rows, even if you set `limit` to a - * higher value. - * - * To learn more about this pagination parameter, see - * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - * @param {string} request.timeZone - * This request's time zone if specified. If unspecified, the property's time - * zone is used. The request's time zone is used to interpret the start & end - * dates of the report. - * - * Formatted as strings from the IANA Time Zone database - * (https://www.iana.org/time-zones); for example "America/New_York" or - * "Asia/Tokyo". - * @param {number[]} request.orderBys - * Specifies how rows are ordered in the response. - * @param {boolean} request.returnEntityQuota - * Toggles whether to return the current state of this Analytics Property's - * quota. Quota is returned in [AccessQuota](#AccessQuota). For account-level - * requests, this field must be false. - * @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 {@link google.analytics.admin.v1alpha.RunAccessReportResponse | RunAccessReportResponse}. - * 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.run_access_report.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_RunAccessReport_async - */ - runAccessReport( - request?: protos.google.analytics.admin.v1alpha.IRunAccessReportRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IRunAccessReportResponse, - protos.google.analytics.admin.v1alpha.IRunAccessReportRequest|undefined, {}|undefined - ]>; - runAccessReport( - request: protos.google.analytics.admin.v1alpha.IRunAccessReportRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IRunAccessReportResponse, - protos.google.analytics.admin.v1alpha.IRunAccessReportRequest|null|undefined, - {}|null|undefined>): void; - runAccessReport( - request: protos.google.analytics.admin.v1alpha.IRunAccessReportRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IRunAccessReportResponse, - protos.google.analytics.admin.v1alpha.IRunAccessReportRequest|null|undefined, - {}|null|undefined>): void; - runAccessReport( - request?: protos.google.analytics.admin.v1alpha.IRunAccessReportRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IRunAccessReportResponse, - protos.google.analytics.admin.v1alpha.IRunAccessReportRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IRunAccessReportResponse, - protos.google.analytics.admin.v1alpha.IRunAccessReportRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IRunAccessReportResponse, - protos.google.analytics.admin.v1alpha.IRunAccessReportRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'entity': request.entity ?? '', - }); - this.initialize(); - return this.innerApiCalls.runAccessReport(request, options, callback); - } -/** - * Creates an access binding on an account or property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Formats: - * - accounts/{account} - * - properties/{property} - * @param {google.analytics.admin.v1alpha.AccessBinding} request.accessBinding - * Required. The access binding 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 {@link google.analytics.admin.v1alpha.AccessBinding | AccessBinding}. - * 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_access_binding.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAccessBinding_async - */ - createAccessBinding( - request?: protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest|undefined, {}|undefined - ]>; - createAccessBinding( - request: protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest|null|undefined, - {}|null|undefined>): void; - createAccessBinding( - request: protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest|null|undefined, - {}|null|undefined>): void; - createAccessBinding( - request?: protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createAccessBinding(request, options, callback); - } -/** - * Gets information about an access binding. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the access binding to retrieve. - * Formats: - * - accounts/{account}/accessBindings/{accessBinding} - * - properties/{property}/accessBindings/{accessBinding} - * @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 {@link google.analytics.admin.v1alpha.AccessBinding | AccessBinding}. - * 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_access_binding.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccessBinding_async - */ - getAccessBinding( - request?: protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest|undefined, {}|undefined - ]>; - getAccessBinding( - request: protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest|null|undefined, - {}|null|undefined>): void; - getAccessBinding( - request: protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest|null|undefined, - {}|null|undefined>): void; - getAccessBinding( - request?: protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getAccessBinding(request, options, callback); - } -/** - * Updates an access binding on an account or property. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.AccessBinding} request.accessBinding - * Required. The access binding 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 {@link google.analytics.admin.v1alpha.AccessBinding | AccessBinding}. - * 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_access_binding.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccessBinding_async - */ - updateAccessBinding( - request?: protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest|undefined, {}|undefined - ]>; - updateAccessBinding( - request: protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest|null|undefined, - {}|null|undefined>): void; - updateAccessBinding( - request: protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest|null|undefined, - {}|null|undefined>): void; - updateAccessBinding( - request?: protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccessBinding, - protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'access_binding.name': request.accessBinding!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateAccessBinding(request, options, callback); - } -/** - * Deletes an access binding on an account or property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Formats: - * - accounts/{account}/accessBindings/{accessBinding} - * - properties/{property}/accessBindings/{accessBinding} - * @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 {@link google.protobuf.Empty | 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_access_binding.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccessBinding_async - */ - deleteAccessBinding( - request?: protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest|undefined, {}|undefined - ]>; - deleteAccessBinding( - request: protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest|null|undefined, - {}|null|undefined>): void; - deleteAccessBinding( - request: protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest|null|undefined, - {}|null|undefined>): void; - deleteAccessBinding( - request?: protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteAccessBinding(request, options, callback); - } -/** - * Creates information about multiple access bindings to an account or - * property. - * - * This method is transactional. If any AccessBinding cannot be created, none - * of the AccessBindings will be created. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The account or property that owns the access bindings. The parent - * field in the CreateAccessBindingRequest messages must either be empty or - * match this field. Formats: - * - accounts/{account} - * - properties/{property} - * @param {number[]} request.requests - * Required. The requests specifying the access bindings to create. - * A maximum of 1000 access bindings 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 {@link google.analytics.admin.v1alpha.BatchCreateAccessBindingsResponse | BatchCreateAccessBindingsResponse}. - * 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_access_bindings.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateAccessBindings_async - */ - batchCreateAccessBindings( - request?: protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest|undefined, {}|undefined - ]>; - batchCreateAccessBindings( - request: protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest|null|undefined, - {}|null|undefined>): void; - batchCreateAccessBindings( - request: protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest|null|undefined, - {}|null|undefined>): void; - batchCreateAccessBindings( - request?: protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.batchCreateAccessBindings(request, options, callback); - } -/** - * Gets information about multiple access bindings 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 owns the access bindings. The parent - * of all provided values for the 'names' field must match this field. - * Formats: - * - accounts/{account} - * - properties/{property} - * @param {string[]} request.names - * Required. The names of the access bindings to retrieve. - * A maximum of 1000 access bindings can be retrieved in a batch. - * Formats: - * - accounts/{account}/accessBindings/{accessBinding} - * - properties/{property}/accessBindings/{accessBinding} - * @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 {@link google.analytics.admin.v1alpha.BatchGetAccessBindingsResponse | BatchGetAccessBindingsResponse}. - * 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_access_bindings.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetAccessBindings_async - */ - batchGetAccessBindings( - request?: protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest|undefined, {}|undefined - ]>; - batchGetAccessBindings( - request: protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest|null|undefined, - {}|null|undefined>): void; - batchGetAccessBindings( - request: protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest|null|undefined, - {}|null|undefined>): void; - batchGetAccessBindings( - request?: protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.batchGetAccessBindings(request, options, callback); - } -/** - * Updates information about multiple access bindings 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 owns the access bindings. The parent - * of all provided AccessBinding in UpdateAccessBindingRequest messages must - * match this field. - * Formats: - * - accounts/{account} - * - properties/{property} - * @param {number[]} request.requests - * Required. The requests specifying the access bindings to update. - * A maximum of 1000 access bindings 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 {@link google.analytics.admin.v1alpha.BatchUpdateAccessBindingsResponse | BatchUpdateAccessBindingsResponse}. - * 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_access_bindings.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateAccessBindings_async - */ - batchUpdateAccessBindings( - request?: protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest|undefined, {}|undefined - ]>; - batchUpdateAccessBindings( - request: protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest|null|undefined, - {}|null|undefined>): void; - batchUpdateAccessBindings( - request: protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest|null|undefined, - {}|null|undefined>): void; - batchUpdateAccessBindings( - request?: protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse, - protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.batchUpdateAccessBindings(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 owns the access bindings. The parent - * of all provided values for the 'names' field in DeleteAccessBindingRequest - * messages must match this field. Formats: - * - accounts/{account} - * - properties/{property} - * @param {number[]} request.requests - * Required. The requests specifying the access bindings to delete. - * A maximum of 1000 access bindings can be deleted 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 {@link google.protobuf.Empty | 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_access_bindings.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteAccessBindings_async - */ - batchDeleteAccessBindings( - request?: protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest|undefined, {}|undefined - ]>; - batchDeleteAccessBindings( - request: protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest|null|undefined, - {}|null|undefined>): void; - batchDeleteAccessBindings( - request: protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest|null|undefined, - {}|null|undefined>): void; - batchDeleteAccessBindings( - request?: protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.batchDeleteAccessBindings(request, options, callback); - } -/** - * Lookup for a single ExpandedDataSet. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Audience to get. - * Example format: properties/1234/expandedDataSets/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 {@link google.analytics.admin.v1alpha.ExpandedDataSet | ExpandedDataSet}. - * 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_expanded_data_set.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetExpandedDataSet_async - */ - getExpandedDataSet( - request?: protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest|undefined, {}|undefined - ]>; - getExpandedDataSet( - request: protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest|null|undefined, - {}|null|undefined>): void; - getExpandedDataSet( - request: protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest|null|undefined, - {}|null|undefined>): void; - getExpandedDataSet( - request?: protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getExpandedDataSet(request, options, callback); - } -/** - * Creates a ExpandedDataSet. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Example format: properties/1234 - * @param {google.analytics.admin.v1alpha.ExpandedDataSet} request.expandedDataSet - * Required. The ExpandedDataSet 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 {@link google.analytics.admin.v1alpha.ExpandedDataSet | ExpandedDataSet}. - * 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_expanded_data_set.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateExpandedDataSet_async - */ - createExpandedDataSet( - request?: protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest|undefined, {}|undefined - ]>; - createExpandedDataSet( - request: protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest|null|undefined, - {}|null|undefined>): void; - createExpandedDataSet( - request: protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest|null|undefined, - {}|null|undefined>): void; - createExpandedDataSet( - request?: protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createExpandedDataSet(request, options, callback); - } -/** - * Updates a ExpandedDataSet on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.ExpandedDataSet} request.expandedDataSet - * Required. The ExpandedDataSet to update. - * The resource's `name` field is used to identify the ExpandedDataSet 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 {@link google.analytics.admin.v1alpha.ExpandedDataSet | ExpandedDataSet}. - * 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_expanded_data_set.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateExpandedDataSet_async - */ - updateExpandedDataSet( - request?: protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest|undefined, {}|undefined - ]>; - updateExpandedDataSet( - request: protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest|null|undefined, - {}|null|undefined>): void; - updateExpandedDataSet( - request: protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest|null|undefined, - {}|null|undefined>): void; - updateExpandedDataSet( - request?: protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IExpandedDataSet, - protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'expanded_data_set.name': request.expandedDataSet!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateExpandedDataSet(request, options, callback); - } -/** - * Deletes a ExpandedDataSet on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Example format: properties/1234/expandedDataSets/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 {@link google.protobuf.Empty | 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_expanded_data_set.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteExpandedDataSet_async - */ - deleteExpandedDataSet( - request?: protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest|undefined, {}|undefined - ]>; - deleteExpandedDataSet( - request: protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest|null|undefined, - {}|null|undefined>): void; - deleteExpandedDataSet( - request: protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest|null|undefined, - {}|null|undefined>): void; - deleteExpandedDataSet( - request?: protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteExpandedDataSet(request, options, callback); - } -/** - * Sets the opt out status for the automated GA4 setup process for a UA - * property. - * Note: this has no effect on GA4 property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * Required. The UA property to set the opt out status. Note this request uses - * the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. - * Format: properties/{internalWebPropertyId} - * Example: properties/1234 - * @param {boolean} request.optOut - * The status to set. - * @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 {@link google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse | SetAutomatedGa4ConfigurationOptOutResponse}. - * 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.set_automated_ga4_configuration_opt_out.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_SetAutomatedGa4ConfigurationOptOut_async - */ - setAutomatedGa4ConfigurationOptOut( - request?: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|undefined, {}|undefined - ]>; - setAutomatedGa4ConfigurationOptOut( - request: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>): void; - setAutomatedGa4ConfigurationOptOut( - request: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>): void; - setAutomatedGa4ConfigurationOptOut( - request?: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|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.setAutomatedGa4ConfigurationOptOut(request, options, callback); - } -/** - * Fetches the opt out status for the automated GA4 setup process for a UA - * property. - * Note: this has no effect on GA4 property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * Required. The UA property to get the opt out status. Note this request uses - * the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. - * Format: properties/{internalWebPropertyId} - * Example: properties/1234 - * @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 {@link google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse | FetchAutomatedGa4ConfigurationOptOutResponse}. - * 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.fetch_automated_ga4_configuration_opt_out.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_FetchAutomatedGa4ConfigurationOptOut_async - */ - fetchAutomatedGa4ConfigurationOptOut( - request?: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|undefined, {}|undefined - ]>; - fetchAutomatedGa4ConfigurationOptOut( - request: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>): void; - fetchAutomatedGa4ConfigurationOptOut( - request: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>): void; - fetchAutomatedGa4ConfigurationOptOut( - request?: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|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.fetchAutomatedGa4ConfigurationOptOut(request, options, callback); - } -/** - * Lookup for a single BigQuery Link. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the BigQuery link to lookup. - * Format: properties/{property_id}/bigQueryLinks/{bigquery_link_id} - * Example: properties/123/bigQueryLinks/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 {@link google.analytics.admin.v1alpha.BigQueryLink | BigQueryLink}. - * 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_big_query_link.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetBigQueryLink_async - */ - getBigQueryLink( - request?: protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IBigQueryLink, - protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest|undefined, {}|undefined - ]>; - getBigQueryLink( - request: protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IBigQueryLink, - protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest|null|undefined, - {}|null|undefined>): void; - getBigQueryLink( - request: protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IBigQueryLink, - protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest|null|undefined, - {}|null|undefined>): void; - getBigQueryLink( - request?: protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IBigQueryLink, - protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IBigQueryLink, - protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IBigQueryLink, - protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getBigQueryLink(request, options, callback); - } -/** - * Returns the enhanced measurement settings for this data stream. - * Note that the stream must enable enhanced measurement for these settings to - * take effect. - * - * @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}/dataStreams/{data_stream}/enhancedMeasurementSettings - * Example: "properties/1000/dataStreams/2000/enhancedMeasurementSettings" - * @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 {@link google.analytics.admin.v1alpha.EnhancedMeasurementSettings | EnhancedMeasurementSettings}. - * 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_enhanced_measurement_settings.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetEnhancedMeasurementSettings_async - */ - getEnhancedMeasurementSettings( - request?: protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, - protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest|undefined, {}|undefined - ]>; - getEnhancedMeasurementSettings( - request: protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, - protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest|null|undefined, - {}|null|undefined>): void; - getEnhancedMeasurementSettings( - request: protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, - protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest|null|undefined, - {}|null|undefined>): void; - getEnhancedMeasurementSettings( - request?: protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, - protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, - protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, - protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getEnhancedMeasurementSettings(request, options, callback); - } -/** - * Updates the enhanced measurement settings for this data stream. - * Note that the stream must enable enhanced measurement for these settings to - * take effect. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.analytics.admin.v1alpha.EnhancedMeasurementSettings} request.enhancedMeasurementSettings - * 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 {@link google.analytics.admin.v1alpha.EnhancedMeasurementSettings | EnhancedMeasurementSettings}. - * 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_enhanced_measurement_settings.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateEnhancedMeasurementSettings_async - */ - updateEnhancedMeasurementSettings( - request?: protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, - protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest|undefined, {}|undefined - ]>; - updateEnhancedMeasurementSettings( - request: protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, - protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest|null|undefined, - {}|null|undefined>): void; - updateEnhancedMeasurementSettings( - request: protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, - protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest|null|undefined, - {}|null|undefined>): void; - updateEnhancedMeasurementSettings( - request?: protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, - protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, - protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, - protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'enhanced_measurement_settings.name': request.enhancedMeasurementSettings!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateEnhancedMeasurementSettings(request, options, callback); - } -/** - * Creates a connected site tag for a Universal Analytics property. You can - * create a maximum of 20 connected site tags per property. - * Note: This API cannot be used on GA4 properties. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * The Universal Analytics property to create connected site tags for. - * This API does not support GA4 properties. - * Format: properties/{universalAnalyticsPropertyId} - * Example: properties/1234 - * @param {google.analytics.admin.v1alpha.ConnectedSiteTag} request.connectedSiteTag - * Required. The tag to add to the Universal Analytics 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 {@link google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse | CreateConnectedSiteTagResponse}. - * 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_connected_site_tag.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConnectedSiteTag_async - */ - createConnectedSiteTag( - request?: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|undefined, {}|undefined - ]>; - createConnectedSiteTag( - request: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|null|undefined, - {}|null|undefined>): void; - createConnectedSiteTag( - request: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|null|undefined, - {}|null|undefined>): void; - createConnectedSiteTag( - request?: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|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.createConnectedSiteTag(request, options, callback); - } -/** - * Deletes a connected site tag for a Universal Analytics property. - * Note: this has no effect on GA4 properties. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * The Universal Analytics property to delete connected site tags for. - * This API does not support GA4 properties. - * Format: properties/{universalAnalyticsPropertyId} - * Example: properties/1234 - * @param {string} request.tagId - * Tag ID to forward events to. Also known as the Measurement ID, or the - * "G-ID" (For example: G-12345). - * @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 {@link google.protobuf.Empty | 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_connected_site_tag.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConnectedSiteTag_async - */ - deleteConnectedSiteTag( - request?: protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|undefined, {}|undefined - ]>; - deleteConnectedSiteTag( - request: protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|null|undefined, - {}|null|undefined>): void; - deleteConnectedSiteTag( - request: protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|null|undefined, - {}|null|undefined>): void; - deleteConnectedSiteTag( - request?: protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|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.deleteConnectedSiteTag(request, options, callback); - } -/** - * Lists the connected site tags for a Universal Analytics property. A maximum - * of 20 connected site tags will be returned. Note: this has no effect on GA4 - * property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * The Universal Analytics property to fetch connected site tags for. - * This does not work on GA4 properties. A maximum of 20 connected site tags - * will be returned. - * Example Format: `properties/1234` - * @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 {@link google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse | ListConnectedSiteTagsResponse}. - * 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.list_connected_site_tags.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConnectedSiteTags_async - */ - listConnectedSiteTags( - request?: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|undefined, {}|undefined - ]>; - listConnectedSiteTags( - request: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|null|undefined, - {}|null|undefined>): void; - listConnectedSiteTags( - request: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|null|undefined, - {}|null|undefined>): void; - listConnectedSiteTags( - request?: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|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.listConnectedSiteTags(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 {@link google.analytics.admin.v1alpha.Account | 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 {@link google.analytics.admin.v1alpha.Account | 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 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 - * {@link google.analytics.admin.v1alpha.Account | 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 {}, - 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 {@link google.analytics.admin.v1alpha.AccountSummary | 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 {@link google.analytics.admin.v1alpha.AccountSummary | 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 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 - * {@link google.analytics.admin.v1alpha.AccountSummary | 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 {}, - 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 {@link google.analytics.admin.v1alpha.Property | 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 {@link google.analytics.admin.v1alpha.Property | 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 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 - * {@link google.analytics.admin.v1alpha.Property | 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 {}, - 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 {@link google.analytics.admin.v1alpha.UserLink | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.UserLink | 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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1alpha.UserLink | 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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1alpha.AuditUserLink | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.AuditUserLink | 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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1alpha.AuditUserLink | 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' - ] = this._gaxModule.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 {}, - 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 `ListFirebaseLinks` 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 {@link google.analytics.admin.v1alpha.FirebaseLink | 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' - ] = this._gaxModule.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 `ListFirebaseLinks` 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 {@link google.analytics.admin.v1alpha.FirebaseLink | 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' - ] = this._gaxModule.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 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 `ListFirebaseLinks` 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 - * {@link google.analytics.admin.v1alpha.FirebaseLink | 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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1alpha.GoogleAdsLink | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.GoogleAdsLink | 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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1alpha.GoogleAdsLink | 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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1alpha.MeasurementProtocolSecret | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.MeasurementProtocolSecret | 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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1alpha.MeasurementProtocolSecret | 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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1alpha.ChangeHistoryEvent | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.ChangeHistoryEvent | 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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1alpha.ChangeHistoryEvent | 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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1alpha.ConversionEvent | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.ConversionEvent | 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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1alpha.ConversionEvent | 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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink | 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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink | 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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal | 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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal | 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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1alpha.CustomDimension | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomDimension | 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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1alpha.CustomDimension | 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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1alpha.CustomMetric | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.CustomMetric | 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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1alpha.CustomMetric | 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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1alpha.DataStream | 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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1alpha.DataStream | 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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1alpha.DataStream | 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Audiences on a property. - * Audiences created before 2020 may not be supported. - * Default audiences will not show filter definitions. - * - * @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 `ListAudiences` call. Provide this - * to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAudiences` 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 {@link google.analytics.admin.v1alpha.Audience | Audience}. - * 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 `listAudiencesAsync()` - * 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. - */ - listAudiences( - request?: protos.google.analytics.admin.v1alpha.IListAudiencesRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAudience[], - protos.google.analytics.admin.v1alpha.IListAudiencesRequest|null, - protos.google.analytics.admin.v1alpha.IListAudiencesResponse - ]>; - listAudiences( - request: protos.google.analytics.admin.v1alpha.IListAudiencesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAudiencesRequest, - protos.google.analytics.admin.v1alpha.IListAudiencesResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAudience>): void; - listAudiences( - request: protos.google.analytics.admin.v1alpha.IListAudiencesRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAudiencesRequest, - protos.google.analytics.admin.v1alpha.IListAudiencesResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAudience>): void; - listAudiences( - request?: protos.google.analytics.admin.v1alpha.IListAudiencesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAudiencesRequest, - protos.google.analytics.admin.v1alpha.IListAudiencesResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAudience>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAudiencesRequest, - protos.google.analytics.admin.v1alpha.IListAudiencesResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAudience>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAudience[], - protos.google.analytics.admin.v1alpha.IListAudiencesRequest|null, - protos.google.analytics.admin.v1alpha.IListAudiencesResponse - ]>|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listAudiences(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 `ListAudiences` call. Provide this - * to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAudiences` 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 {@link google.analytics.admin.v1alpha.Audience | Audience} 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 `listAudiencesAsync()` - * 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. - */ - listAudiencesStream( - request?: protos.google.analytics.admin.v1alpha.IListAudiencesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAudiences']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAudiences.createStream( - this.innerApiCalls.listAudiences as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAudiences`, 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 `ListAudiences` call. Provide this - * to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAudiences` 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 - * {@link google.analytics.admin.v1alpha.Audience | Audience}. 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_audiences.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAudiences_async - */ - listAudiencesAsync( - request?: protos.google.analytics.admin.v1alpha.IListAudiencesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAudiences']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAudiences.asyncIterate( - this.innerApiCalls['listAudiences'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all SearchAds360Links 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 `ListSearchAds360Links` - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListSearchAds360Links` 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 {@link google.analytics.admin.v1alpha.SearchAds360Link | SearchAds360Link}. - * 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 `listSearchAds360LinksAsync()` - * 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. - */ - listSearchAds360Links( - request?: protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ISearchAds360Link[], - protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest|null, - protos.google.analytics.admin.v1alpha.IListSearchAds360LinksResponse - ]>; - listSearchAds360Links( - request: protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, - protos.google.analytics.admin.v1alpha.IListSearchAds360LinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.ISearchAds360Link>): void; - listSearchAds360Links( - request: protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, - protos.google.analytics.admin.v1alpha.IListSearchAds360LinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.ISearchAds360Link>): void; - listSearchAds360Links( - request?: protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, - protos.google.analytics.admin.v1alpha.IListSearchAds360LinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.ISearchAds360Link>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, - protos.google.analytics.admin.v1alpha.IListSearchAds360LinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.ISearchAds360Link>): - Promise<[ - protos.google.analytics.admin.v1alpha.ISearchAds360Link[], - protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest|null, - protos.google.analytics.admin.v1alpha.IListSearchAds360LinksResponse - ]>|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listSearchAds360Links(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 `ListSearchAds360Links` - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListSearchAds360Links` 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 {@link google.analytics.admin.v1alpha.SearchAds360Link | SearchAds360Link} 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 `listSearchAds360LinksAsync()` - * 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. - */ - listSearchAds360LinksStream( - request?: protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSearchAds360Links']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSearchAds360Links.createStream( - this.innerApiCalls.listSearchAds360Links as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSearchAds360Links`, 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 `ListSearchAds360Links` - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListSearchAds360Links` 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 - * {@link google.analytics.admin.v1alpha.SearchAds360Link | SearchAds360Link}. 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_search_ads360_links.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListSearchAds360Links_async - */ - listSearchAds360LinksAsync( - request?: protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSearchAds360Links']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSearchAds360Links.asyncIterate( - this.innerApiCalls['listSearchAds360Links'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all access bindings on an account or property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Formats: - * - accounts/{account} - * - properties/{property} - * @param {number} request.pageSize - * The maximum number of access bindings to return. - * The service may return fewer than this value. - * If unspecified, at most 200 access bindings 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 `ListAccessBindings` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccessBindings` 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 {@link google.analytics.admin.v1alpha.AccessBinding | AccessBinding}. - * 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 `listAccessBindingsAsync()` - * 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. - */ - listAccessBindings( - request?: protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccessBinding[], - protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest|null, - protos.google.analytics.admin.v1alpha.IListAccessBindingsResponse - ]>; - listAccessBindings( - request: protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, - protos.google.analytics.admin.v1alpha.IListAccessBindingsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAccessBinding>): void; - listAccessBindings( - request: protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, - protos.google.analytics.admin.v1alpha.IListAccessBindingsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAccessBinding>): void; - listAccessBindings( - request?: protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, - protos.google.analytics.admin.v1alpha.IListAccessBindingsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAccessBinding>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, - protos.google.analytics.admin.v1alpha.IListAccessBindingsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IAccessBinding>): - Promise<[ - protos.google.analytics.admin.v1alpha.IAccessBinding[], - protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest|null, - protos.google.analytics.admin.v1alpha.IListAccessBindingsResponse - ]>|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listAccessBindings(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. Formats: - * - accounts/{account} - * - properties/{property} - * @param {number} request.pageSize - * The maximum number of access bindings to return. - * The service may return fewer than this value. - * If unspecified, at most 200 access bindings 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 `ListAccessBindings` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccessBindings` 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 {@link google.analytics.admin.v1alpha.AccessBinding | AccessBinding} 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 `listAccessBindingsAsync()` - * 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. - */ - listAccessBindingsStream( - request?: protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAccessBindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAccessBindings.createStream( - this.innerApiCalls.listAccessBindings as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAccessBindings`, 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. Formats: - * - accounts/{account} - * - properties/{property} - * @param {number} request.pageSize - * The maximum number of access bindings to return. - * The service may return fewer than this value. - * If unspecified, at most 200 access bindings 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 `ListAccessBindings` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccessBindings` 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 - * {@link google.analytics.admin.v1alpha.AccessBinding | AccessBinding}. 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_access_bindings.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccessBindings_async - */ - listAccessBindingsAsync( - request?: protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAccessBindings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAccessBindings.asyncIterate( - this.innerApiCalls['listAccessBindings'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists ExpandedDataSets 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 `ListExpandedDataSets` call. Provide - * this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListExpandedDataSet` - * 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 {@link google.analytics.admin.v1alpha.ExpandedDataSet | ExpandedDataSet}. - * 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 `listExpandedDataSetsAsync()` - * 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. - */ - listExpandedDataSets( - request?: protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IExpandedDataSet[], - protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest|null, - protos.google.analytics.admin.v1alpha.IListExpandedDataSetsResponse - ]>; - listExpandedDataSets( - request: protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, - protos.google.analytics.admin.v1alpha.IListExpandedDataSetsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IExpandedDataSet>): void; - listExpandedDataSets( - request: protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, - protos.google.analytics.admin.v1alpha.IListExpandedDataSetsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IExpandedDataSet>): void; - listExpandedDataSets( - request?: protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, - protos.google.analytics.admin.v1alpha.IListExpandedDataSetsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IExpandedDataSet>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, - protos.google.analytics.admin.v1alpha.IListExpandedDataSetsResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IExpandedDataSet>): - Promise<[ - protos.google.analytics.admin.v1alpha.IExpandedDataSet[], - protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest|null, - protos.google.analytics.admin.v1alpha.IListExpandedDataSetsResponse - ]>|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listExpandedDataSets(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 `ListExpandedDataSets` call. Provide - * this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListExpandedDataSet` - * 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 {@link google.analytics.admin.v1alpha.ExpandedDataSet | ExpandedDataSet} 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 `listExpandedDataSetsAsync()` - * 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. - */ - listExpandedDataSetsStream( - request?: protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listExpandedDataSets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listExpandedDataSets.createStream( - this.innerApiCalls.listExpandedDataSets as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listExpandedDataSets`, 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 `ListExpandedDataSets` call. Provide - * this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListExpandedDataSet` - * 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 - * {@link google.analytics.admin.v1alpha.ExpandedDataSet | ExpandedDataSet}. 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_expanded_data_sets.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListExpandedDataSets_async - */ - listExpandedDataSetsAsync( - request?: protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listExpandedDataSets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listExpandedDataSets.asyncIterate( - this.innerApiCalls['listExpandedDataSets'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists BigQuery Links on a property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the property to list BigQuery links under. - * 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 `ListBigQueryLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListBigQueryLinks` 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 {@link google.analytics.admin.v1alpha.BigQueryLink | BigQueryLink}. - * 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 `listBigQueryLinksAsync()` - * 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. - */ - listBigQueryLinks( - request?: protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IBigQueryLink[], - protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest|null, - protos.google.analytics.admin.v1alpha.IListBigQueryLinksResponse - ]>; - listBigQueryLinks( - request: protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, - protos.google.analytics.admin.v1alpha.IListBigQueryLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IBigQueryLink>): void; - listBigQueryLinks( - request: protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, - protos.google.analytics.admin.v1alpha.IListBigQueryLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IBigQueryLink>): void; - listBigQueryLinks( - request?: protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, - protos.google.analytics.admin.v1alpha.IListBigQueryLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IBigQueryLink>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, - protos.google.analytics.admin.v1alpha.IListBigQueryLinksResponse|null|undefined, - protos.google.analytics.admin.v1alpha.IBigQueryLink>): - Promise<[ - protos.google.analytics.admin.v1alpha.IBigQueryLink[], - protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest|null, - protos.google.analytics.admin.v1alpha.IListBigQueryLinksResponse - ]>|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listBigQueryLinks(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 name of the property to list BigQuery links under. - * 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 `ListBigQueryLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListBigQueryLinks` 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 {@link google.analytics.admin.v1alpha.BigQueryLink | BigQueryLink} 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 `listBigQueryLinksAsync()` - * 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. - */ - listBigQueryLinksStream( - request?: protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBigQueryLinks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listBigQueryLinks.createStream( - this.innerApiCalls.listBigQueryLinks as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBigQueryLinks`, 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 name of the property to list BigQuery links under. - * 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 `ListBigQueryLinks` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListBigQueryLinks` 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 - * {@link google.analytics.admin.v1alpha.BigQueryLink | BigQueryLink}. 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_big_query_links.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListBigQueryLinks_async - */ - listBigQueryLinksAsync( - request?: protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBigQueryLinks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listBigQueryLinks.asyncIterate( - this.innerApiCalls['listBigQueryLinks'] as GaxCall, - request as {}, - 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 accountAccessBinding resource name string. - * - * @param {string} account - * @param {string} access_binding - * @returns {string} Resource name string. - */ - accountAccessBindingPath(account:string,accessBinding:string) { - return this.pathTemplates.accountAccessBindingPathTemplate.render({ - account: account, - access_binding: accessBinding, - }); - } - - /** - * Parse the account from AccountAccessBinding resource. - * - * @param {string} accountAccessBindingName - * A fully-qualified path representing account_access_binding resource. - * @returns {string} A string representing the account. - */ - matchAccountFromAccountAccessBindingName(accountAccessBindingName: string) { - return this.pathTemplates.accountAccessBindingPathTemplate.match(accountAccessBindingName).account; - } - - /** - * Parse the access_binding from AccountAccessBinding resource. - * - * @param {string} accountAccessBindingName - * A fully-qualified path representing account_access_binding resource. - * @returns {string} A string representing the access_binding. - */ - matchAccessBindingFromAccountAccessBindingName(accountAccessBindingName: string) { - return this.pathTemplates.accountAccessBindingPathTemplate.match(accountAccessBindingName).access_binding; - } - - /** - * 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 attributionSettings resource name string. - * - * @param {string} property - * @returns {string} Resource name string. - */ - attributionSettingsPath(property:string) { - return this.pathTemplates.attributionSettingsPathTemplate.render({ - property: property, - }); - } - - /** - * Parse the property from AttributionSettings resource. - * - * @param {string} attributionSettingsName - * A fully-qualified path representing AttributionSettings resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromAttributionSettingsName(attributionSettingsName: string) { - return this.pathTemplates.attributionSettingsPathTemplate.match(attributionSettingsName).property; - } - - /** - * Return a fully-qualified audience resource name string. - * - * @param {string} property - * @param {string} audience - * @returns {string} Resource name string. - */ - audiencePath(property:string,audience:string) { - return this.pathTemplates.audiencePathTemplate.render({ - property: property, - audience: audience, - }); - } - - /** - * Parse the property from Audience resource. - * - * @param {string} audienceName - * A fully-qualified path representing Audience resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromAudienceName(audienceName: string) { - return this.pathTemplates.audiencePathTemplate.match(audienceName).property; - } - - /** - * Parse the audience from Audience resource. - * - * @param {string} audienceName - * A fully-qualified path representing Audience resource. - * @returns {string} A string representing the audience. - */ - matchAudienceFromAudienceName(audienceName: string) { - return this.pathTemplates.audiencePathTemplate.match(audienceName).audience; - } - - /** - * Return a fully-qualified bigQueryLink resource name string. - * - * @param {string} property - * @param {string} bigquery_link - * @returns {string} Resource name string. - */ - bigQueryLinkPath(property:string,bigqueryLink:string) { - return this.pathTemplates.bigQueryLinkPathTemplate.render({ - property: property, - bigquery_link: bigqueryLink, - }); - } - - /** - * Parse the property from BigQueryLink resource. - * - * @param {string} bigQueryLinkName - * A fully-qualified path representing BigQueryLink resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromBigQueryLinkName(bigQueryLinkName: string) { - return this.pathTemplates.bigQueryLinkPathTemplate.match(bigQueryLinkName).property; - } - - /** - * Parse the bigquery_link from BigQueryLink resource. - * - * @param {string} bigQueryLinkName - * A fully-qualified path representing BigQueryLink resource. - * @returns {string} A string representing the bigquery_link. - */ - matchBigqueryLinkFromBigQueryLinkName(bigQueryLinkName: string) { - return this.pathTemplates.bigQueryLinkPathTemplate.match(bigQueryLinkName).bigquery_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 enhancedMeasurementSettings resource name string. - * - * @param {string} property - * @param {string} data_stream - * @returns {string} Resource name string. - */ - enhancedMeasurementSettingsPath(property:string,dataStream:string) { - return this.pathTemplates.enhancedMeasurementSettingsPathTemplate.render({ - property: property, - data_stream: dataStream, - }); - } - - /** - * Parse the property from EnhancedMeasurementSettings resource. - * - * @param {string} enhancedMeasurementSettingsName - * A fully-qualified path representing EnhancedMeasurementSettings resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromEnhancedMeasurementSettingsName(enhancedMeasurementSettingsName: string) { - return this.pathTemplates.enhancedMeasurementSettingsPathTemplate.match(enhancedMeasurementSettingsName).property; - } - - /** - * Parse the data_stream from EnhancedMeasurementSettings resource. - * - * @param {string} enhancedMeasurementSettingsName - * A fully-qualified path representing EnhancedMeasurementSettings resource. - * @returns {string} A string representing the data_stream. - */ - matchDataStreamFromEnhancedMeasurementSettingsName(enhancedMeasurementSettingsName: string) { - return this.pathTemplates.enhancedMeasurementSettingsPathTemplate.match(enhancedMeasurementSettingsName).data_stream; - } - - /** - * Return a fully-qualified expandedDataSet resource name string. - * - * @param {string} property - * @param {string} expanded_data_set - * @returns {string} Resource name string. - */ - expandedDataSetPath(property:string,expandedDataSet:string) { - return this.pathTemplates.expandedDataSetPathTemplate.render({ - property: property, - expanded_data_set: expandedDataSet, - }); - } - - /** - * Parse the property from ExpandedDataSet resource. - * - * @param {string} expandedDataSetName - * A fully-qualified path representing ExpandedDataSet resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromExpandedDataSetName(expandedDataSetName: string) { - return this.pathTemplates.expandedDataSetPathTemplate.match(expandedDataSetName).property; - } - - /** - * Parse the expanded_data_set from ExpandedDataSet resource. - * - * @param {string} expandedDataSetName - * A fully-qualified path representing ExpandedDataSet resource. - * @returns {string} A string representing the expanded_data_set. - */ - matchExpandedDataSetFromExpandedDataSetName(expandedDataSetName: string) { - return this.pathTemplates.expandedDataSetPathTemplate.match(expandedDataSetName).expanded_data_set; - } - - /** - * 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 propertyAccessBinding resource name string. - * - * @param {string} property - * @param {string} access_binding - * @returns {string} Resource name string. - */ - propertyAccessBindingPath(property:string,accessBinding:string) { - return this.pathTemplates.propertyAccessBindingPathTemplate.render({ - property: property, - access_binding: accessBinding, - }); - } - - /** - * Parse the property from PropertyAccessBinding resource. - * - * @param {string} propertyAccessBindingName - * A fully-qualified path representing property_access_binding resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromPropertyAccessBindingName(propertyAccessBindingName: string) { - return this.pathTemplates.propertyAccessBindingPathTemplate.match(propertyAccessBindingName).property; - } - - /** - * Parse the access_binding from PropertyAccessBinding resource. - * - * @param {string} propertyAccessBindingName - * A fully-qualified path representing property_access_binding resource. - * @returns {string} A string representing the access_binding. - */ - matchAccessBindingFromPropertyAccessBindingName(propertyAccessBindingName: string) { - return this.pathTemplates.propertyAccessBindingPathTemplate.match(propertyAccessBindingName).access_binding; - } - - /** - * 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; - } - - /** - * Return a fully-qualified searchAds360Link resource name string. - * - * @param {string} property - * @returns {string} Resource name string. - */ - searchAds360LinkPath(property:string) { - return this.pathTemplates.searchAds360LinkPathTemplate.render({ - property: property, - }); - } - - /** - * Parse the property from SearchAds360Link resource. - * - * @param {string} searchAds360LinkName - * A fully-qualified path representing SearchAds360Link resource. - * @returns {string} A string representing the property. - */ - matchPropertyFromSearchAds360LinkName(searchAds360LinkName: string) { - return this.pathTemplates.searchAds360LinkPathTemplate.match(searchAds360LinkName).property; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.analyticsAdminServiceStub && !this._terminated) { - return this.analyticsAdminServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client_config.json b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client_config.json deleted file mode 100644 index ae7a81cd69a..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_client_config.json +++ /dev/null @@ -1,574 +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": "non_idempotent", - "retry_params_name": "default" - }, - "ListAccounts": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteAccount": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateAccount": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ProvisionAccountTicket": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListAccountSummaries": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetProperty": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListProperties": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateProperty": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteProperty": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateProperty": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetUserLink": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchGetUserLinks": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListUserLinks": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "AuditUserLinks": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateUserLink": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchCreateUserLinks": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateUserLink": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchUpdateUserLinks": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteUserLink": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchDeleteUserLinks": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateFirebaseLink": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteFirebaseLink": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListFirebaseLinks": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetGlobalSiteTag": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateGoogleAdsLink": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateGoogleAdsLink": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteGoogleAdsLink": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListGoogleAdsLinks": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "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" - }, - "GetAudience": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListAudiences": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateAudience": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateAudience": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ArchiveAudience": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetSearchAds360Link": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListSearchAds360Links": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateSearchAds360Link": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteSearchAds360Link": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateSearchAds360Link": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetAttributionSettings": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateAttributionSettings": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "RunAccessReport": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateAccessBinding": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetAccessBinding": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateAccessBinding": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteAccessBinding": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListAccessBindings": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "BatchCreateAccessBindings": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "BatchGetAccessBindings": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "BatchUpdateAccessBindings": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "BatchDeleteAccessBindings": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetExpandedDataSet": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListExpandedDataSets": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateExpandedDataSet": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "UpdateExpandedDataSet": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteExpandedDataSet": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "SetAutomatedGa4ConfigurationOptOut": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "FetchAutomatedGa4ConfigurationOptOut": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetBigQueryLink": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListBigQueryLinks": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetEnhancedMeasurementSettings": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateEnhancedMeasurementSettings": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateConnectedSiteTag": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteConnectedSiteTag": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListConnectedSiteTags": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - } - } - } - } -} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_proto_list.json b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_proto_list.json deleted file mode 100644 index 084ed5872e1..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/analytics_admin_service_proto_list.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "../../protos/google/analytics/admin/v1alpha/access_report.proto", - "../../protos/google/analytics/admin/v1alpha/analytics_admin.proto", - "../../protos/google/analytics/admin/v1alpha/audience.proto", - "../../protos/google/analytics/admin/v1alpha/expanded_data_set.proto", - "../../protos/google/analytics/admin/v1alpha/resources.proto" -] diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/gapic_metadata.json b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/gapic_metadata.json deleted file mode 100644 index 866a4731b05..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/gapic_metadata.json +++ /dev/null @@ -1,1173 +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" - ] - }, - "GetAudience": { - "methods": [ - "getAudience" - ] - }, - "CreateAudience": { - "methods": [ - "createAudience" - ] - }, - "UpdateAudience": { - "methods": [ - "updateAudience" - ] - }, - "ArchiveAudience": { - "methods": [ - "archiveAudience" - ] - }, - "GetSearchAds360Link": { - "methods": [ - "getSearchAds360Link" - ] - }, - "CreateSearchAds360Link": { - "methods": [ - "createSearchAds360Link" - ] - }, - "DeleteSearchAds360Link": { - "methods": [ - "deleteSearchAds360Link" - ] - }, - "UpdateSearchAds360Link": { - "methods": [ - "updateSearchAds360Link" - ] - }, - "GetAttributionSettings": { - "methods": [ - "getAttributionSettings" - ] - }, - "UpdateAttributionSettings": { - "methods": [ - "updateAttributionSettings" - ] - }, - "RunAccessReport": { - "methods": [ - "runAccessReport" - ] - }, - "CreateAccessBinding": { - "methods": [ - "createAccessBinding" - ] - }, - "GetAccessBinding": { - "methods": [ - "getAccessBinding" - ] - }, - "UpdateAccessBinding": { - "methods": [ - "updateAccessBinding" - ] - }, - "DeleteAccessBinding": { - "methods": [ - "deleteAccessBinding" - ] - }, - "BatchCreateAccessBindings": { - "methods": [ - "batchCreateAccessBindings" - ] - }, - "BatchGetAccessBindings": { - "methods": [ - "batchGetAccessBindings" - ] - }, - "BatchUpdateAccessBindings": { - "methods": [ - "batchUpdateAccessBindings" - ] - }, - "BatchDeleteAccessBindings": { - "methods": [ - "batchDeleteAccessBindings" - ] - }, - "GetExpandedDataSet": { - "methods": [ - "getExpandedDataSet" - ] - }, - "CreateExpandedDataSet": { - "methods": [ - "createExpandedDataSet" - ] - }, - "UpdateExpandedDataSet": { - "methods": [ - "updateExpandedDataSet" - ] - }, - "DeleteExpandedDataSet": { - "methods": [ - "deleteExpandedDataSet" - ] - }, - "SetAutomatedGa4ConfigurationOptOut": { - "methods": [ - "setAutomatedGa4ConfigurationOptOut" - ] - }, - "FetchAutomatedGa4ConfigurationOptOut": { - "methods": [ - "fetchAutomatedGa4ConfigurationOptOut" - ] - }, - "GetBigQueryLink": { - "methods": [ - "getBigQueryLink" - ] - }, - "GetEnhancedMeasurementSettings": { - "methods": [ - "getEnhancedMeasurementSettings" - ] - }, - "UpdateEnhancedMeasurementSettings": { - "methods": [ - "updateEnhancedMeasurementSettings" - ] - }, - "CreateConnectedSiteTag": { - "methods": [ - "createConnectedSiteTag" - ] - }, - "DeleteConnectedSiteTag": { - "methods": [ - "deleteConnectedSiteTag" - ] - }, - "ListConnectedSiteTags": { - "methods": [ - "listConnectedSiteTags" - ] - }, - "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" - ] - }, - "ListAudiences": { - "methods": [ - "listAudiences", - "listAudiencesStream", - "listAudiencesAsync" - ] - }, - "ListSearchAds360Links": { - "methods": [ - "listSearchAds360Links", - "listSearchAds360LinksStream", - "listSearchAds360LinksAsync" - ] - }, - "ListAccessBindings": { - "methods": [ - "listAccessBindings", - "listAccessBindingsStream", - "listAccessBindingsAsync" - ] - }, - "ListExpandedDataSets": { - "methods": [ - "listExpandedDataSets", - "listExpandedDataSetsStream", - "listExpandedDataSetsAsync" - ] - }, - "ListBigQueryLinks": { - "methods": [ - "listBigQueryLinks", - "listBigQueryLinksStream", - "listBigQueryLinksAsync" - ] - } - } - }, - "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" - ] - }, - "GetAudience": { - "methods": [ - "getAudience" - ] - }, - "CreateAudience": { - "methods": [ - "createAudience" - ] - }, - "UpdateAudience": { - "methods": [ - "updateAudience" - ] - }, - "ArchiveAudience": { - "methods": [ - "archiveAudience" - ] - }, - "GetSearchAds360Link": { - "methods": [ - "getSearchAds360Link" - ] - }, - "CreateSearchAds360Link": { - "methods": [ - "createSearchAds360Link" - ] - }, - "DeleteSearchAds360Link": { - "methods": [ - "deleteSearchAds360Link" - ] - }, - "UpdateSearchAds360Link": { - "methods": [ - "updateSearchAds360Link" - ] - }, - "GetAttributionSettings": { - "methods": [ - "getAttributionSettings" - ] - }, - "UpdateAttributionSettings": { - "methods": [ - "updateAttributionSettings" - ] - }, - "RunAccessReport": { - "methods": [ - "runAccessReport" - ] - }, - "CreateAccessBinding": { - "methods": [ - "createAccessBinding" - ] - }, - "GetAccessBinding": { - "methods": [ - "getAccessBinding" - ] - }, - "UpdateAccessBinding": { - "methods": [ - "updateAccessBinding" - ] - }, - "DeleteAccessBinding": { - "methods": [ - "deleteAccessBinding" - ] - }, - "BatchCreateAccessBindings": { - "methods": [ - "batchCreateAccessBindings" - ] - }, - "BatchGetAccessBindings": { - "methods": [ - "batchGetAccessBindings" - ] - }, - "BatchUpdateAccessBindings": { - "methods": [ - "batchUpdateAccessBindings" - ] - }, - "BatchDeleteAccessBindings": { - "methods": [ - "batchDeleteAccessBindings" - ] - }, - "GetExpandedDataSet": { - "methods": [ - "getExpandedDataSet" - ] - }, - "CreateExpandedDataSet": { - "methods": [ - "createExpandedDataSet" - ] - }, - "UpdateExpandedDataSet": { - "methods": [ - "updateExpandedDataSet" - ] - }, - "DeleteExpandedDataSet": { - "methods": [ - "deleteExpandedDataSet" - ] - }, - "SetAutomatedGa4ConfigurationOptOut": { - "methods": [ - "setAutomatedGa4ConfigurationOptOut" - ] - }, - "FetchAutomatedGa4ConfigurationOptOut": { - "methods": [ - "fetchAutomatedGa4ConfigurationOptOut" - ] - }, - "GetBigQueryLink": { - "methods": [ - "getBigQueryLink" - ] - }, - "GetEnhancedMeasurementSettings": { - "methods": [ - "getEnhancedMeasurementSettings" - ] - }, - "UpdateEnhancedMeasurementSettings": { - "methods": [ - "updateEnhancedMeasurementSettings" - ] - }, - "CreateConnectedSiteTag": { - "methods": [ - "createConnectedSiteTag" - ] - }, - "DeleteConnectedSiteTag": { - "methods": [ - "deleteConnectedSiteTag" - ] - }, - "ListConnectedSiteTags": { - "methods": [ - "listConnectedSiteTags" - ] - }, - "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" - ] - }, - "ListAudiences": { - "methods": [ - "listAudiences", - "listAudiencesStream", - "listAudiencesAsync" - ] - }, - "ListSearchAds360Links": { - "methods": [ - "listSearchAds360Links", - "listSearchAds360LinksStream", - "listSearchAds360LinksAsync" - ] - }, - "ListAccessBindings": { - "methods": [ - "listAccessBindings", - "listAccessBindingsStream", - "listAccessBindingsAsync" - ] - }, - "ListExpandedDataSets": { - "methods": [ - "listExpandedDataSets", - "listExpandedDataSetsStream", - "listExpandedDataSetsAsync" - ] - }, - "ListBigQueryLinks": { - "methods": [ - "listBigQueryLinks", - "listBigQueryLinksStream", - "listBigQueryLinksAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/index.ts b/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/index.ts deleted file mode 100644 index f0f311d4088..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/src/v1alpha/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2023 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/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.js deleted file mode 100644 index de87e1ff6d4..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2023 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/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 5c5cf34906e..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2023 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/google-analytics-admin/v1alpha/system-test/install.ts b/owl-bot-staging/google-analytics-admin/v1alpha/system-test/install.ts deleted file mode 100644 index c8f81b25a86..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 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/google-analytics-admin/v1alpha/test/gapic_analytics_admin_service_v1alpha.ts b/owl-bot-staging/google-analytics-admin/v1alpha/test/gapic_analytics_admin_service_v1alpha.ts deleted file mode 100644 index 2a9cf178cf4..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1alpha/test/gapic_analytics_admin_service_v1alpha.ts +++ /dev/null @@ -1,15039 +0,0 @@ -// Copyright 2023 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'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAccount(request), expectedError); - const actualRequest = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccountRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAccount = stubSimpleCall(expectedResponse); - const [response] = await client.deleteAccount(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteAccount(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccountRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccountRequest', ['account', 'name']); - request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccountRequest', ['account', 'name']); - request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccountRequest', ['account', 'name']); - request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateAccount(request), expectedError); - const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccountRequest', ['account', 'name']); - request.account.name = defaultValue1; - 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 expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ProvisionAccountTicketResponse() - ); - client.innerApiCalls.provisionAccountTicket = stubSimpleCall(expectedResponse); - const [response] = await client.provisionAccountTicket(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - 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 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); - }); - - 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 expectedError = new Error('expected'); - client.innerApiCalls.provisionAccountTicket = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.provisionAccountTicket(request), expectedError); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetPropertyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetPropertyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetPropertyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getProperty = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getProperty(request), expectedError); - const actualRequest = (client.innerApiCalls.getProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetPropertyRequest', ['name']); - request.name = defaultValue1; - 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 expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.Property() - ); - client.innerApiCalls.createProperty = stubSimpleCall(expectedResponse); - const [response] = await client.createProperty(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - 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 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); - }); - - 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 expectedError = new Error('expected'); - client.innerApiCalls.createProperty = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createProperty(request), expectedError); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeletePropertyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeletePropertyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeletePropertyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteProperty = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteProperty(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeletePropertyRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdatePropertyRequest', ['property', 'name']); - request.property.name = defaultValue1; - const expectedHeaderRequestParams = `property.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdatePropertyRequest', ['property', 'name']); - request.property.name = defaultValue1; - const expectedHeaderRequestParams = `property.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdatePropertyRequest', ['property', 'name']); - request.property.name = defaultValue1; - const expectedHeaderRequestParams = `property.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateProperty = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateProperty(request), expectedError); - const actualRequest = (client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdatePropertyRequest', ['property', 'name']); - request.property.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetUserLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getUserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetUserLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getUserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetUserLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getUserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getUserLink(request), expectedError); - const actualRequest = (client.innerApiCalls.getUserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetUserLinkRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchGetUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchGetUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchGetUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchGetUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchGetUserLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchGetUserLinks(request), expectedError); - const actualRequest = (client.innerApiCalls.batchGetUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchGetUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetUserLinksRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateUserLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createUserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateUserLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createUserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateUserLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createUserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createUserLink(request), expectedError); - const actualRequest = (client.innerApiCalls.createUserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateUserLinkRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchCreateUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchCreateUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateUserLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateUserLinks(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateUserLinksRequest', ['parent']); - request.parent = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateUserLinkRequest', ['userLink', 'name']); - request.userLink.name = defaultValue1; - const expectedHeaderRequestParams = `user_link.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateUserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateUserLinkRequest', ['userLink', 'name']); - request.userLink.name = defaultValue1; - const expectedHeaderRequestParams = `user_link.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateUserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateUserLinkRequest', ['userLink', 'name']); - request.userLink.name = defaultValue1; - const expectedHeaderRequestParams = `user_link.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateUserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateUserLink(request), expectedError); - const actualRequest = (client.innerApiCalls.updateUserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateUserLinkRequest', ['userLink', 'name']); - request.userLink.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchUpdateUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchUpdateUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchUpdateUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchUpdateUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchUpdateUserLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchUpdateUserLinks(request), expectedError); - const actualRequest = (client.innerApiCalls.batchUpdateUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchUpdateUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateUserLinksRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteUserLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteUserLink = stubSimpleCall(expectedResponse); - const [response] = await client.deleteUserLink(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteUserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteUserLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteUserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteUserLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteUserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteUserLink(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteUserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteUserLinkRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.batchDeleteUserLinks = stubSimpleCall(expectedResponse); - const [response] = await client.batchDeleteUserLinks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchDeleteUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchDeleteUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchDeleteUserLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchDeleteUserLinks(request), expectedError); - const actualRequest = (client.innerApiCalls.batchDeleteUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteUserLinksRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createFirebaseLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createFirebaseLink(request), expectedError); - const actualRequest = (client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateFirebaseLinkRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteFirebaseLink = stubSimpleCall(expectedResponse); - const [response] = await client.deleteFirebaseLink(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFirebaseLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteFirebaseLink(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteFirebaseLinkRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getGlobalSiteTag as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getGlobalSiteTag as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getGlobalSiteTag as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getGlobalSiteTag as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getGlobalSiteTag = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getGlobalSiteTag(request), expectedError); - const actualRequest = (client.innerApiCalls.getGlobalSiteTag as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getGlobalSiteTag as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGlobalSiteTagRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createGoogleAdsLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createGoogleAdsLink(request), expectedError); - const actualRequest = (client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateGoogleAdsLinkRequest', ['parent']); - request.parent = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); - request.googleAdsLink.name = defaultValue1; - const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); - request.googleAdsLink.name = defaultValue1; - const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); - request.googleAdsLink.name = defaultValue1; - const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateGoogleAdsLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateGoogleAdsLink(request), expectedError); - const actualRequest = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); - request.googleAdsLink.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCall(expectedResponse); - const [response] = await client.deleteGoogleAdsLink(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteGoogleAdsLink(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteGoogleAdsLinkRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataSharingSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataSharingSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataSharingSettingsRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getMeasurementProtocolSecret(request), expectedError); - const actualRequest = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createMeasurementProtocolSecret(request), expectedError); - const actualRequest = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateMeasurementProtocolSecretRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCall(expectedResponse); - const [response] = await client.deleteMeasurementProtocolSecret(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteMeasurementProtocolSecret(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); - request.measurementProtocolSecret.name = defaultValue1; - const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); - request.measurementProtocolSecret.name = defaultValue1; - const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); - request.measurementProtocolSecret.name = defaultValue1; - const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateMeasurementProtocolSecret(request), expectedError); - const actualRequest = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); - request.measurementProtocolSecret.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest', ['property']); - request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest', ['property']); - request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest', ['property']); - request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.acknowledgeUserDataCollection(request), expectedError); - const actualRequest = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionRequest', ['property']); - request.property = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getGoogleSignalsSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getGoogleSignalsSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getGoogleSignalsSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getGoogleSignalsSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getGoogleSignalsSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getGoogleSignalsSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.getGoogleSignalsSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getGoogleSignalsSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetGoogleSignalsSettingsRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest', ['googleSignalsSettings', 'name']); - request.googleSignalsSettings.name = defaultValue1; - const expectedHeaderRequestParams = `google_signals_settings.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest', ['googleSignalsSettings', 'name']); - request.googleSignalsSettings.name = defaultValue1; - const expectedHeaderRequestParams = `google_signals_settings.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest', ['googleSignalsSettings', 'name']); - request.googleSignalsSettings.name = defaultValue1; - const expectedHeaderRequestParams = `google_signals_settings.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateGoogleSignalsSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateGoogleSignalsSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleSignalsSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateGoogleSignalsSettingsRequest', ['googleSignalsSettings', 'name']); - request.googleSignalsSettings.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateConversionEventRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateConversionEventRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateConversionEventRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createConversionEvent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createConversionEvent(request), expectedError); - const actualRequest = (client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateConversionEventRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetConversionEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetConversionEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetConversionEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getConversionEvent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getConversionEvent(request), expectedError); - const actualRequest = (client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetConversionEventRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteConversionEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteConversionEvent = stubSimpleCall(expectedResponse); - const [response] = await client.deleteConversionEvent(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteConversionEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteConversionEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteConversionEvent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteConversionEvent(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteConversionEventRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDisplayVideo360AdvertiserLink(request), expectedError); - const actualRequest = (client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDisplayVideo360AdvertiserLink(request), expectedError); - const actualRequest = (client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDisplayVideo360AdvertiserLink = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDisplayVideo360AdvertiserLink(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDisplayVideo360AdvertiserLink(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest', ['displayVideo_360AdvertiserLink', 'name']); - request.displayVideo_360AdvertiserLink.name = defaultValue1; - const expectedHeaderRequestParams = `display_video_360_advertiser_link.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest', ['displayVideo_360AdvertiserLink', 'name']); - request.displayVideo_360AdvertiserLink.name = defaultValue1; - const expectedHeaderRequestParams = `display_video_360_advertiser_link.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest', ['displayVideo_360AdvertiserLink', 'name']); - request.displayVideo_360AdvertiserLink.name = defaultValue1; - const expectedHeaderRequestParams = `display_video_360_advertiser_link.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDisplayVideo360AdvertiserLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDisplayVideo360AdvertiserLink(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDisplayVideo360AdvertiserLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDisplayVideo360AdvertiserLinkRequest', ['displayVideo_360AdvertiserLink', 'name']); - request.displayVideo_360AdvertiserLink.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDisplayVideo360AdvertiserLinkProposal(request), expectedError); - const actualRequest = (client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDisplayVideo360AdvertiserLinkProposal(request), expectedError); - const actualRequest = (client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDisplayVideo360AdvertiserLinkProposalRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDisplayVideo360AdvertiserLinkProposal(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDisplayVideo360AdvertiserLinkProposal(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.approveDisplayVideo360AdvertiserLinkProposal(request), expectedError); - const actualRequest = (client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelDisplayVideo360AdvertiserLinkProposal(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CancelDisplayVideo360AdvertiserLinkProposalRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomDimensionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomDimensionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomDimensionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCustomDimension = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCustomDimension(request), expectedError); - const actualRequest = (client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomDimensionRequest', ['parent']); - request.parent = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest', ['customDimension', 'name']); - request.customDimension.name = defaultValue1; - const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest', ['customDimension', 'name']); - request.customDimension.name = defaultValue1; - const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest', ['customDimension', 'name']); - request.customDimension.name = defaultValue1; - const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCustomDimension = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateCustomDimension(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomDimensionRequest', ['customDimension', 'name']); - request.customDimension.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.archiveCustomDimension = stubSimpleCall(expectedResponse); - const [response] = await client.archiveCustomDimension(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.archiveCustomDimension = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.archiveCustomDimension(request), expectedError); - const actualRequest = (client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomDimensionRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomDimensionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomDimensionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomDimensionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCustomDimension = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCustomDimension(request), expectedError); - const actualRequest = (client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomDimensionRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomMetricRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomMetricRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomMetricRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCustomMetric = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCustomMetric(request), expectedError); - const actualRequest = (client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateCustomMetricRequest', ['parent']); - request.parent = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomMetricRequest', ['customMetric', 'name']); - request.customMetric.name = defaultValue1; - const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomMetricRequest', ['customMetric', 'name']); - request.customMetric.name = defaultValue1; - const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomMetricRequest', ['customMetric', 'name']); - request.customMetric.name = defaultValue1; - const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCustomMetric = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateCustomMetric(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateCustomMetricRequest', ['customMetric', 'name']); - request.customMetric.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.archiveCustomMetric = stubSimpleCall(expectedResponse); - const [response] = await client.archiveCustomMetric(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.archiveCustomMetric = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.archiveCustomMetric(request), expectedError); - const actualRequest = (client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveCustomMetricRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomMetricRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomMetricRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomMetricRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCustomMetric = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCustomMetric(request), expectedError); - const actualRequest = (client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetCustomMetricRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataRetentionSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataRetentionSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataRetentionSettingsRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); - request.dataRetentionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); - request.dataRetentionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); - request.dataRetentionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataRetentionSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDataRetentionSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); - request.dataRetentionSettings.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDataStreamRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDataStreamRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDataStreamRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataStream = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDataStream(request), expectedError); - const actualRequest = (client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateDataStreamRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDataStreamRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDataStream = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDataStream(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDataStreamRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDataStreamRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataStream = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDataStream(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteDataStreamRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataStreamRequest', ['dataStream', 'name']); - request.dataStream.name = defaultValue1; - const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataStreamRequest', ['dataStream', 'name']); - request.dataStream.name = defaultValue1; - const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataStreamRequest', ['dataStream', 'name']); - request.dataStream.name = defaultValue1; - const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataStream = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDataStream(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateDataStreamRequest', ['dataStream', 'name']); - request.dataStream.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataStreamRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataStreamRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataStreamRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataStream = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataStream(request), expectedError); - const actualRequest = (client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetDataStreamRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDataStream(request), expectedError); - }); - }); - - describe('getAudience', () => { - it('invokes getAudience 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.GetAudienceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAudienceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.Audience() - ); - client.innerApiCalls.getAudience = stubSimpleCall(expectedResponse); - const [response] = await client.getAudience(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAudience as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAudience as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAudience 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.GetAudienceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAudienceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.Audience() - ); - client.innerApiCalls.getAudience = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAudience( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAudience|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAudience as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAudience as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAudience 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.GetAudienceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAudienceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAudience = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAudience(request), expectedError); - const actualRequest = (client.innerApiCalls.getAudience as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAudience as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAudience 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.GetAudienceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAudienceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getAudience(request), expectedError); - }); - }); - - describe('createAudience', () => { - it('invokes createAudience 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.CreateAudienceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAudienceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.Audience() - ); - client.innerApiCalls.createAudience = stubSimpleCall(expectedResponse); - const [response] = await client.createAudience(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAudience as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAudience as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAudience 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.CreateAudienceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAudienceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.Audience() - ); - client.innerApiCalls.createAudience = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createAudience( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAudience|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAudience as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAudience as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAudience 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.CreateAudienceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAudienceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createAudience = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createAudience(request), expectedError); - const actualRequest = (client.innerApiCalls.createAudience as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAudience as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAudience 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.CreateAudienceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAudienceRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createAudience(request), expectedError); - }); - }); - - describe('updateAudience', () => { - it('invokes updateAudience 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.UpdateAudienceRequest() - ); - request.audience ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAudienceRequest', ['audience', 'name']); - request.audience.name = defaultValue1; - const expectedHeaderRequestParams = `audience.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.Audience() - ); - client.innerApiCalls.updateAudience = stubSimpleCall(expectedResponse); - const [response] = await client.updateAudience(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAudience as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAudience as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAudience 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.UpdateAudienceRequest() - ); - request.audience ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAudienceRequest', ['audience', 'name']); - request.audience.name = defaultValue1; - const expectedHeaderRequestParams = `audience.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.Audience() - ); - client.innerApiCalls.updateAudience = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateAudience( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAudience|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAudience as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAudience as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAudience 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.UpdateAudienceRequest() - ); - request.audience ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAudienceRequest', ['audience', 'name']); - request.audience.name = defaultValue1; - const expectedHeaderRequestParams = `audience.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAudience = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateAudience(request), expectedError); - const actualRequest = (client.innerApiCalls.updateAudience as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAudience as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAudience 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.UpdateAudienceRequest() - ); - request.audience ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAudienceRequest', ['audience', 'name']); - request.audience.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateAudience(request), expectedError); - }); - }); - - describe('archiveAudience', () => { - it('invokes archiveAudience 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.ArchiveAudienceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveAudienceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.archiveAudience = stubSimpleCall(expectedResponse); - const [response] = await client.archiveAudience(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.archiveAudience as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveAudience as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes archiveAudience 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.ArchiveAudienceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveAudienceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.archiveAudience = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.archiveAudience( - 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); - const actualRequest = (client.innerApiCalls.archiveAudience as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveAudience as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes archiveAudience 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.ArchiveAudienceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveAudienceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.archiveAudience = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.archiveAudience(request), expectedError); - const actualRequest = (client.innerApiCalls.archiveAudience as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveAudience as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes archiveAudience 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.ArchiveAudienceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ArchiveAudienceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.archiveAudience(request), expectedError); - }); - }); - - describe('getSearchAds360Link', () => { - it('invokes getSearchAds360Link 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.GetSearchAds360LinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetSearchAds360LinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.SearchAds360Link() - ); - client.innerApiCalls.getSearchAds360Link = stubSimpleCall(expectedResponse); - const [response] = await client.getSearchAds360Link(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSearchAds360Link as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSearchAds360Link as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSearchAds360Link 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.GetSearchAds360LinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetSearchAds360LinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.SearchAds360Link() - ); - client.innerApiCalls.getSearchAds360Link = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSearchAds360Link( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ISearchAds360Link|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSearchAds360Link as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSearchAds360Link as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSearchAds360Link 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.GetSearchAds360LinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetSearchAds360LinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSearchAds360Link = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSearchAds360Link(request), expectedError); - const actualRequest = (client.innerApiCalls.getSearchAds360Link as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSearchAds360Link as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSearchAds360Link 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.GetSearchAds360LinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetSearchAds360LinkRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getSearchAds360Link(request), expectedError); - }); - }); - - describe('createSearchAds360Link', () => { - it('invokes createSearchAds360Link 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.CreateSearchAds360LinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateSearchAds360LinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.SearchAds360Link() - ); - client.innerApiCalls.createSearchAds360Link = stubSimpleCall(expectedResponse); - const [response] = await client.createSearchAds360Link(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSearchAds360Link as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSearchAds360Link as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSearchAds360Link 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.CreateSearchAds360LinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateSearchAds360LinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.SearchAds360Link() - ); - client.innerApiCalls.createSearchAds360Link = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSearchAds360Link( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ISearchAds360Link|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSearchAds360Link as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSearchAds360Link as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSearchAds360Link 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.CreateSearchAds360LinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateSearchAds360LinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSearchAds360Link = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createSearchAds360Link(request), expectedError); - const actualRequest = (client.innerApiCalls.createSearchAds360Link as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSearchAds360Link as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSearchAds360Link 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.CreateSearchAds360LinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateSearchAds360LinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createSearchAds360Link(request), expectedError); - }); - }); - - describe('deleteSearchAds360Link', () => { - it('invokes deleteSearchAds360Link 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.DeleteSearchAds360LinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteSearchAds360LinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSearchAds360Link = stubSimpleCall(expectedResponse); - const [response] = await client.deleteSearchAds360Link(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSearchAds360Link as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSearchAds360Link as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSearchAds360Link 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.DeleteSearchAds360LinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteSearchAds360LinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSearchAds360Link = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSearchAds360Link( - 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); - const actualRequest = (client.innerApiCalls.deleteSearchAds360Link as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSearchAds360Link as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSearchAds360Link 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.DeleteSearchAds360LinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteSearchAds360LinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSearchAds360Link = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteSearchAds360Link(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSearchAds360Link as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSearchAds360Link as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSearchAds360Link 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.DeleteSearchAds360LinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteSearchAds360LinkRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteSearchAds360Link(request), expectedError); - }); - }); - - describe('updateSearchAds360Link', () => { - it('invokes updateSearchAds360Link 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.UpdateSearchAds360LinkRequest() - ); - request.searchAds_360Link ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateSearchAds360LinkRequest', ['searchAds_360Link', 'name']); - request.searchAds_360Link.name = defaultValue1; - const expectedHeaderRequestParams = `search_ads_360_link.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.SearchAds360Link() - ); - client.innerApiCalls.updateSearchAds360Link = stubSimpleCall(expectedResponse); - const [response] = await client.updateSearchAds360Link(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSearchAds360Link as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSearchAds360Link as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSearchAds360Link 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.UpdateSearchAds360LinkRequest() - ); - request.searchAds_360Link ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateSearchAds360LinkRequest', ['searchAds_360Link', 'name']); - request.searchAds_360Link.name = defaultValue1; - const expectedHeaderRequestParams = `search_ads_360_link.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.SearchAds360Link() - ); - client.innerApiCalls.updateSearchAds360Link = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSearchAds360Link( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ISearchAds360Link|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSearchAds360Link as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSearchAds360Link as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSearchAds360Link 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.UpdateSearchAds360LinkRequest() - ); - request.searchAds_360Link ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateSearchAds360LinkRequest', ['searchAds_360Link', 'name']); - request.searchAds_360Link.name = defaultValue1; - const expectedHeaderRequestParams = `search_ads_360_link.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSearchAds360Link = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateSearchAds360Link(request), expectedError); - const actualRequest = (client.innerApiCalls.updateSearchAds360Link as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSearchAds360Link as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSearchAds360Link 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.UpdateSearchAds360LinkRequest() - ); - request.searchAds_360Link ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateSearchAds360LinkRequest', ['searchAds_360Link', 'name']); - request.searchAds_360Link.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateSearchAds360Link(request), expectedError); - }); - }); - - describe('getAttributionSettings', () => { - it('invokes getAttributionSettings 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.GetAttributionSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAttributionSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.AttributionSettings() - ); - client.innerApiCalls.getAttributionSettings = stubSimpleCall(expectedResponse); - const [response] = await client.getAttributionSettings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAttributionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAttributionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAttributionSettings 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.GetAttributionSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAttributionSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.AttributionSettings() - ); - client.innerApiCalls.getAttributionSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAttributionSettings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAttributionSettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAttributionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAttributionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAttributionSettings 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.GetAttributionSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAttributionSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAttributionSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAttributionSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.getAttributionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAttributionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAttributionSettings 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.GetAttributionSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAttributionSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getAttributionSettings(request), expectedError); - }); - }); - - describe('updateAttributionSettings', () => { - it('invokes updateAttributionSettings 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.UpdateAttributionSettingsRequest() - ); - request.attributionSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAttributionSettingsRequest', ['attributionSettings', 'name']); - request.attributionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `attribution_settings.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.AttributionSettings() - ); - client.innerApiCalls.updateAttributionSettings = stubSimpleCall(expectedResponse); - const [response] = await client.updateAttributionSettings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAttributionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAttributionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAttributionSettings 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.UpdateAttributionSettingsRequest() - ); - request.attributionSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAttributionSettingsRequest', ['attributionSettings', 'name']); - request.attributionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `attribution_settings.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.AttributionSettings() - ); - client.innerApiCalls.updateAttributionSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateAttributionSettings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAttributionSettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAttributionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAttributionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAttributionSettings 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.UpdateAttributionSettingsRequest() - ); - request.attributionSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAttributionSettingsRequest', ['attributionSettings', 'name']); - request.attributionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `attribution_settings.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAttributionSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateAttributionSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.updateAttributionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAttributionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAttributionSettings 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.UpdateAttributionSettingsRequest() - ); - request.attributionSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAttributionSettingsRequest', ['attributionSettings', 'name']); - request.attributionSettings.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateAttributionSettings(request), expectedError); - }); - }); - - describe('runAccessReport', () => { - it('invokes runAccessReport 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.RunAccessReportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.RunAccessReportRequest', ['entity']); - request.entity = defaultValue1; - const expectedHeaderRequestParams = `entity=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.RunAccessReportResponse() - ); - client.innerApiCalls.runAccessReport = stubSimpleCall(expectedResponse); - const [response] = await client.runAccessReport(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runAccessReport as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runAccessReport as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runAccessReport 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.RunAccessReportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.RunAccessReportRequest', ['entity']); - request.entity = defaultValue1; - const expectedHeaderRequestParams = `entity=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.RunAccessReportResponse() - ); - client.innerApiCalls.runAccessReport = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runAccessReport( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IRunAccessReportResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runAccessReport as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runAccessReport as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runAccessReport 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.RunAccessReportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.RunAccessReportRequest', ['entity']); - request.entity = defaultValue1; - const expectedHeaderRequestParams = `entity=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.runAccessReport = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.runAccessReport(request), expectedError); - const actualRequest = (client.innerApiCalls.runAccessReport as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runAccessReport as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runAccessReport 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.RunAccessReportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.RunAccessReportRequest', ['entity']); - request.entity = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.runAccessReport(request), expectedError); - }); - }); - - describe('createAccessBinding', () => { - it('invokes createAccessBinding 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.CreateAccessBindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAccessBindingRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.AccessBinding() - ); - client.innerApiCalls.createAccessBinding = stubSimpleCall(expectedResponse); - const [response] = await client.createAccessBinding(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAccessBinding as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAccessBinding as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAccessBinding 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.CreateAccessBindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAccessBindingRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.AccessBinding() - ); - client.innerApiCalls.createAccessBinding = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createAccessBinding( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccessBinding|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAccessBinding as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAccessBinding as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAccessBinding 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.CreateAccessBindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAccessBindingRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createAccessBinding = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createAccessBinding(request), expectedError); - const actualRequest = (client.innerApiCalls.createAccessBinding as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAccessBinding as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAccessBinding 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.CreateAccessBindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateAccessBindingRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createAccessBinding(request), expectedError); - }); - }); - - describe('getAccessBinding', () => { - it('invokes getAccessBinding 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.GetAccessBindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccessBindingRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.AccessBinding() - ); - client.innerApiCalls.getAccessBinding = stubSimpleCall(expectedResponse); - const [response] = await client.getAccessBinding(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAccessBinding as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccessBinding as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAccessBinding 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.GetAccessBindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccessBindingRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.AccessBinding() - ); - client.innerApiCalls.getAccessBinding = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAccessBinding( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccessBinding|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAccessBinding as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccessBinding as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAccessBinding 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.GetAccessBindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccessBindingRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAccessBinding = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAccessBinding(request), expectedError); - const actualRequest = (client.innerApiCalls.getAccessBinding as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccessBinding as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAccessBinding 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.GetAccessBindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetAccessBindingRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getAccessBinding(request), expectedError); - }); - }); - - describe('updateAccessBinding', () => { - it('invokes updateAccessBinding 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.UpdateAccessBindingRequest() - ); - request.accessBinding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccessBindingRequest', ['accessBinding', 'name']); - request.accessBinding.name = defaultValue1; - const expectedHeaderRequestParams = `access_binding.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.AccessBinding() - ); - client.innerApiCalls.updateAccessBinding = stubSimpleCall(expectedResponse); - const [response] = await client.updateAccessBinding(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAccessBinding as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccessBinding as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAccessBinding 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.UpdateAccessBindingRequest() - ); - request.accessBinding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccessBindingRequest', ['accessBinding', 'name']); - request.accessBinding.name = defaultValue1; - const expectedHeaderRequestParams = `access_binding.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.AccessBinding() - ); - client.innerApiCalls.updateAccessBinding = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateAccessBinding( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccessBinding|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAccessBinding as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccessBinding as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAccessBinding 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.UpdateAccessBindingRequest() - ); - request.accessBinding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccessBindingRequest', ['accessBinding', 'name']); - request.accessBinding.name = defaultValue1; - const expectedHeaderRequestParams = `access_binding.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAccessBinding = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateAccessBinding(request), expectedError); - const actualRequest = (client.innerApiCalls.updateAccessBinding as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccessBinding as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAccessBinding 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.UpdateAccessBindingRequest() - ); - request.accessBinding ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateAccessBindingRequest', ['accessBinding', 'name']); - request.accessBinding.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateAccessBinding(request), expectedError); - }); - }); - - describe('deleteAccessBinding', () => { - it('invokes deleteAccessBinding 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.DeleteAccessBindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccessBindingRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAccessBinding = stubSimpleCall(expectedResponse); - const [response] = await client.deleteAccessBinding(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAccessBinding as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAccessBinding as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAccessBinding 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.DeleteAccessBindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccessBindingRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAccessBinding = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteAccessBinding( - 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); - const actualRequest = (client.innerApiCalls.deleteAccessBinding as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAccessBinding as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAccessBinding 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.DeleteAccessBindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccessBindingRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAccessBinding = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteAccessBinding(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteAccessBinding as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAccessBinding as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAccessBinding 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.DeleteAccessBindingRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteAccessBindingRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteAccessBinding(request), expectedError); - }); - }); - - describe('batchCreateAccessBindings', () => { - it('invokes batchCreateAccessBindings 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.BatchCreateAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.BatchCreateAccessBindingsResponse() - ); - client.innerApiCalls.batchCreateAccessBindings = stubSimpleCall(expectedResponse); - const [response] = await client.batchCreateAccessBindings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateAccessBindings 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.BatchCreateAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.BatchCreateAccessBindingsResponse() - ); - client.innerApiCalls.batchCreateAccessBindings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateAccessBindings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateAccessBindings 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.BatchCreateAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateAccessBindings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateAccessBindings(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateAccessBindings 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.BatchCreateAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchCreateAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchCreateAccessBindings(request), expectedError); - }); - }); - - describe('batchGetAccessBindings', () => { - it('invokes batchGetAccessBindings 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.BatchGetAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.BatchGetAccessBindingsResponse() - ); - client.innerApiCalls.batchGetAccessBindings = stubSimpleCall(expectedResponse); - const [response] = await client.batchGetAccessBindings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchGetAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchGetAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchGetAccessBindings 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.BatchGetAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.BatchGetAccessBindingsResponse() - ); - client.innerApiCalls.batchGetAccessBindings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchGetAccessBindings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchGetAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchGetAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchGetAccessBindings 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.BatchGetAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchGetAccessBindings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchGetAccessBindings(request), expectedError); - const actualRequest = (client.innerApiCalls.batchGetAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchGetAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchGetAccessBindings 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.BatchGetAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchGetAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchGetAccessBindings(request), expectedError); - }); - }); - - describe('batchUpdateAccessBindings', () => { - it('invokes batchUpdateAccessBindings 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.BatchUpdateAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.BatchUpdateAccessBindingsResponse() - ); - client.innerApiCalls.batchUpdateAccessBindings = stubSimpleCall(expectedResponse); - const [response] = await client.batchUpdateAccessBindings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchUpdateAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchUpdateAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchUpdateAccessBindings 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.BatchUpdateAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.BatchUpdateAccessBindingsResponse() - ); - client.innerApiCalls.batchUpdateAccessBindings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchUpdateAccessBindings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchUpdateAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchUpdateAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchUpdateAccessBindings 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.BatchUpdateAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchUpdateAccessBindings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchUpdateAccessBindings(request), expectedError); - const actualRequest = (client.innerApiCalls.batchUpdateAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchUpdateAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchUpdateAccessBindings 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.BatchUpdateAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchUpdateAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchUpdateAccessBindings(request), expectedError); - }); - }); - - describe('batchDeleteAccessBindings', () => { - it('invokes batchDeleteAccessBindings 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.BatchDeleteAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.batchDeleteAccessBindings = stubSimpleCall(expectedResponse); - const [response] = await client.batchDeleteAccessBindings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchDeleteAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchDeleteAccessBindings 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.BatchDeleteAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.batchDeleteAccessBindings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchDeleteAccessBindings( - 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); - const actualRequest = (client.innerApiCalls.batchDeleteAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchDeleteAccessBindings 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.BatchDeleteAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchDeleteAccessBindings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchDeleteAccessBindings(request), expectedError); - const actualRequest = (client.innerApiCalls.batchDeleteAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchDeleteAccessBindings 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.BatchDeleteAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.BatchDeleteAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchDeleteAccessBindings(request), expectedError); - }); - }); - - describe('getExpandedDataSet', () => { - it('invokes getExpandedDataSet 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.GetExpandedDataSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetExpandedDataSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ExpandedDataSet() - ); - client.innerApiCalls.getExpandedDataSet = stubSimpleCall(expectedResponse); - const [response] = await client.getExpandedDataSet(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getExpandedDataSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExpandedDataSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExpandedDataSet 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.GetExpandedDataSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetExpandedDataSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ExpandedDataSet() - ); - client.innerApiCalls.getExpandedDataSet = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getExpandedDataSet( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IExpandedDataSet|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getExpandedDataSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExpandedDataSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExpandedDataSet 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.GetExpandedDataSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetExpandedDataSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getExpandedDataSet = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getExpandedDataSet(request), expectedError); - const actualRequest = (client.innerApiCalls.getExpandedDataSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExpandedDataSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExpandedDataSet 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.GetExpandedDataSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetExpandedDataSetRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getExpandedDataSet(request), expectedError); - }); - }); - - describe('createExpandedDataSet', () => { - it('invokes createExpandedDataSet 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.CreateExpandedDataSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateExpandedDataSetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ExpandedDataSet() - ); - client.innerApiCalls.createExpandedDataSet = stubSimpleCall(expectedResponse); - const [response] = await client.createExpandedDataSet(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createExpandedDataSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExpandedDataSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createExpandedDataSet 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.CreateExpandedDataSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateExpandedDataSetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ExpandedDataSet() - ); - client.innerApiCalls.createExpandedDataSet = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createExpandedDataSet( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IExpandedDataSet|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createExpandedDataSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExpandedDataSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createExpandedDataSet 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.CreateExpandedDataSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateExpandedDataSetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createExpandedDataSet = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createExpandedDataSet(request), expectedError); - const actualRequest = (client.innerApiCalls.createExpandedDataSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExpandedDataSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createExpandedDataSet 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.CreateExpandedDataSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.CreateExpandedDataSetRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createExpandedDataSet(request), expectedError); - }); - }); - - describe('updateExpandedDataSet', () => { - it('invokes updateExpandedDataSet 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.UpdateExpandedDataSetRequest() - ); - request.expandedDataSet ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateExpandedDataSetRequest', ['expandedDataSet', 'name']); - request.expandedDataSet.name = defaultValue1; - const expectedHeaderRequestParams = `expanded_data_set.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ExpandedDataSet() - ); - client.innerApiCalls.updateExpandedDataSet = stubSimpleCall(expectedResponse); - const [response] = await client.updateExpandedDataSet(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateExpandedDataSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExpandedDataSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateExpandedDataSet 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.UpdateExpandedDataSetRequest() - ); - request.expandedDataSet ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateExpandedDataSetRequest', ['expandedDataSet', 'name']); - request.expandedDataSet.name = defaultValue1; - const expectedHeaderRequestParams = `expanded_data_set.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ExpandedDataSet() - ); - client.innerApiCalls.updateExpandedDataSet = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateExpandedDataSet( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IExpandedDataSet|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateExpandedDataSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExpandedDataSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateExpandedDataSet 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.UpdateExpandedDataSetRequest() - ); - request.expandedDataSet ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateExpandedDataSetRequest', ['expandedDataSet', 'name']); - request.expandedDataSet.name = defaultValue1; - const expectedHeaderRequestParams = `expanded_data_set.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateExpandedDataSet = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateExpandedDataSet(request), expectedError); - const actualRequest = (client.innerApiCalls.updateExpandedDataSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExpandedDataSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateExpandedDataSet 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.UpdateExpandedDataSetRequest() - ); - request.expandedDataSet ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateExpandedDataSetRequest', ['expandedDataSet', 'name']); - request.expandedDataSet.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateExpandedDataSet(request), expectedError); - }); - }); - - describe('deleteExpandedDataSet', () => { - it('invokes deleteExpandedDataSet 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.DeleteExpandedDataSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteExpandedDataSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteExpandedDataSet = stubSimpleCall(expectedResponse); - const [response] = await client.deleteExpandedDataSet(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteExpandedDataSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExpandedDataSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExpandedDataSet 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.DeleteExpandedDataSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteExpandedDataSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteExpandedDataSet = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteExpandedDataSet( - 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); - const actualRequest = (client.innerApiCalls.deleteExpandedDataSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExpandedDataSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExpandedDataSet 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.DeleteExpandedDataSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteExpandedDataSetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExpandedDataSet = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteExpandedDataSet(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteExpandedDataSet as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExpandedDataSet as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExpandedDataSet 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.DeleteExpandedDataSetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.DeleteExpandedDataSetRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteExpandedDataSet(request), expectedError); - }); - }); - - describe('setAutomatedGa4ConfigurationOptOut', () => { - it('invokes setAutomatedGa4ConfigurationOptOut 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.SetAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse() - ); - client.innerApiCalls.setAutomatedGa4ConfigurationOptOut = stubSimpleCall(expectedResponse); - const [response] = await client.setAutomatedGa4ConfigurationOptOut(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes setAutomatedGa4ConfigurationOptOut 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.SetAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse() - ); - client.innerApiCalls.setAutomatedGa4ConfigurationOptOut = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setAutomatedGa4ConfigurationOptOut( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes setAutomatedGa4ConfigurationOptOut 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.SetAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.setAutomatedGa4ConfigurationOptOut = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setAutomatedGa4ConfigurationOptOut(request), expectedError); - }); - - it('invokes setAutomatedGa4ConfigurationOptOut 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.SetAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setAutomatedGa4ConfigurationOptOut(request), expectedError); - }); - }); - - describe('fetchAutomatedGa4ConfigurationOptOut', () => { - it('invokes fetchAutomatedGa4ConfigurationOptOut 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.FetchAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse() - ); - client.innerApiCalls.fetchAutomatedGa4ConfigurationOptOut = stubSimpleCall(expectedResponse); - const [response] = await client.fetchAutomatedGa4ConfigurationOptOut(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes fetchAutomatedGa4ConfigurationOptOut 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.FetchAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse() - ); - client.innerApiCalls.fetchAutomatedGa4ConfigurationOptOut = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchAutomatedGa4ConfigurationOptOut( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes fetchAutomatedGa4ConfigurationOptOut 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.FetchAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.fetchAutomatedGa4ConfigurationOptOut = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchAutomatedGa4ConfigurationOptOut(request), expectedError); - }); - - it('invokes fetchAutomatedGa4ConfigurationOptOut 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.FetchAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.fetchAutomatedGa4ConfigurationOptOut(request), expectedError); - }); - }); - - describe('getBigQueryLink', () => { - it('invokes getBigQueryLink 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.GetBigQueryLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetBigQueryLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.BigQueryLink() - ); - client.innerApiCalls.getBigQueryLink = stubSimpleCall(expectedResponse); - const [response] = await client.getBigQueryLink(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBigQueryLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBigQueryLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBigQueryLink 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.GetBigQueryLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetBigQueryLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.BigQueryLink() - ); - client.innerApiCalls.getBigQueryLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBigQueryLink( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBigQueryLink|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBigQueryLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBigQueryLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBigQueryLink 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.GetBigQueryLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetBigQueryLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBigQueryLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBigQueryLink(request), expectedError); - const actualRequest = (client.innerApiCalls.getBigQueryLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBigQueryLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBigQueryLink 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.GetBigQueryLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetBigQueryLinkRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getBigQueryLink(request), expectedError); - }); - }); - - describe('getEnhancedMeasurementSettings', () => { - it('invokes getEnhancedMeasurementSettings 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.GetEnhancedMeasurementSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.EnhancedMeasurementSettings() - ); - client.innerApiCalls.getEnhancedMeasurementSettings = stubSimpleCall(expectedResponse); - const [response] = await client.getEnhancedMeasurementSettings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEnhancedMeasurementSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEnhancedMeasurementSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEnhancedMeasurementSettings 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.GetEnhancedMeasurementSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.EnhancedMeasurementSettings() - ); - client.innerApiCalls.getEnhancedMeasurementSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getEnhancedMeasurementSettings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEnhancedMeasurementSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEnhancedMeasurementSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEnhancedMeasurementSettings 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.GetEnhancedMeasurementSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getEnhancedMeasurementSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEnhancedMeasurementSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.getEnhancedMeasurementSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEnhancedMeasurementSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEnhancedMeasurementSettings 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.GetEnhancedMeasurementSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getEnhancedMeasurementSettings(request), expectedError); - }); - }); - - describe('updateEnhancedMeasurementSettings', () => { - it('invokes updateEnhancedMeasurementSettings 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.UpdateEnhancedMeasurementSettingsRequest() - ); - request.enhancedMeasurementSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest', ['enhancedMeasurementSettings', 'name']); - request.enhancedMeasurementSettings.name = defaultValue1; - const expectedHeaderRequestParams = `enhanced_measurement_settings.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.EnhancedMeasurementSettings() - ); - client.innerApiCalls.updateEnhancedMeasurementSettings = stubSimpleCall(expectedResponse); - const [response] = await client.updateEnhancedMeasurementSettings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateEnhancedMeasurementSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEnhancedMeasurementSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEnhancedMeasurementSettings 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.UpdateEnhancedMeasurementSettingsRequest() - ); - request.enhancedMeasurementSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest', ['enhancedMeasurementSettings', 'name']); - request.enhancedMeasurementSettings.name = defaultValue1; - const expectedHeaderRequestParams = `enhanced_measurement_settings.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.EnhancedMeasurementSettings() - ); - client.innerApiCalls.updateEnhancedMeasurementSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateEnhancedMeasurementSettings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateEnhancedMeasurementSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEnhancedMeasurementSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEnhancedMeasurementSettings 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.UpdateEnhancedMeasurementSettingsRequest() - ); - request.enhancedMeasurementSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest', ['enhancedMeasurementSettings', 'name']); - request.enhancedMeasurementSettings.name = defaultValue1; - const expectedHeaderRequestParams = `enhanced_measurement_settings.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEnhancedMeasurementSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateEnhancedMeasurementSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.updateEnhancedMeasurementSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEnhancedMeasurementSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEnhancedMeasurementSettings 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.UpdateEnhancedMeasurementSettingsRequest() - ); - request.enhancedMeasurementSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest', ['enhancedMeasurementSettings', 'name']); - request.enhancedMeasurementSettings.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateEnhancedMeasurementSettings(request), expectedError); - }); - }); - - describe('createConnectedSiteTag', () => { - it('invokes createConnectedSiteTag 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.CreateConnectedSiteTagRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse() - ); - client.innerApiCalls.createConnectedSiteTag = stubSimpleCall(expectedResponse); - const [response] = await client.createConnectedSiteTag(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes createConnectedSiteTag 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.CreateConnectedSiteTagRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse() - ); - client.innerApiCalls.createConnectedSiteTag = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createConnectedSiteTag( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes createConnectedSiteTag 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.CreateConnectedSiteTagRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.createConnectedSiteTag = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createConnectedSiteTag(request), expectedError); - }); - - it('invokes createConnectedSiteTag 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.CreateConnectedSiteTagRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createConnectedSiteTag(request), expectedError); - }); - }); - - describe('deleteConnectedSiteTag', () => { - it('invokes deleteConnectedSiteTag 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.DeleteConnectedSiteTagRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteConnectedSiteTag = stubSimpleCall(expectedResponse); - const [response] = await client.deleteConnectedSiteTag(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes deleteConnectedSiteTag 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.DeleteConnectedSiteTagRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteConnectedSiteTag = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteConnectedSiteTag( - 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); - }); - - it('invokes deleteConnectedSiteTag 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.DeleteConnectedSiteTagRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.deleteConnectedSiteTag = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteConnectedSiteTag(request), expectedError); - }); - - it('invokes deleteConnectedSiteTag 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.DeleteConnectedSiteTagRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteConnectedSiteTag(request), expectedError); - }); - }); - - describe('listConnectedSiteTags', () => { - it('invokes listConnectedSiteTags 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.ListConnectedSiteTagsRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse() - ); - client.innerApiCalls.listConnectedSiteTags = stubSimpleCall(expectedResponse); - const [response] = await client.listConnectedSiteTags(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes listConnectedSiteTags 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.ListConnectedSiteTagsRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse() - ); - client.innerApiCalls.listConnectedSiteTags = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listConnectedSiteTags( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes listConnectedSiteTags 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.ListConnectedSiteTagsRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.listConnectedSiteTags = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listConnectedSiteTags(request), expectedError); - }); - - it('invokes listConnectedSiteTags 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.ListConnectedSiteTagsRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listConnectedSiteTags(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 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); - }); - - 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 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); - }); - - 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 expectedError = new Error('expected'); - client.innerApiCalls.listAccounts = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAccounts(request), expectedError); - }); - - 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 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); - }); - - 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 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); - }); - - 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 expectedError = new Error('expected'); - client.innerApiCalls.listAccountSummaries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAccountSummaries(request), expectedError); - }); - - 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 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); - }); - - 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 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); - }); - - 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 expectedError = new Error('expected'); - client.innerApiCalls.listProperties = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listProperties(request), expectedError); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listUserLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listUserLinks(request), expectedError); - const actualRequest = (client.innerApiCalls.listUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listUserLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listUserLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listUserLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listUserLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.AuditUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.auditUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.auditUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.AuditUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.auditUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.auditUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.AuditUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.auditUserLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.auditUserLinks(request), expectedError); - const actualRequest = (client.innerApiCalls.auditUserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.auditUserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.AuditUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.auditUserLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.AuditUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.auditUserLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.AuditUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.auditUserLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.AuditUserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.auditUserLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListFirebaseLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListFirebaseLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListFirebaseLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listFirebaseLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listFirebaseLinks(request), expectedError); - const actualRequest = (client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListFirebaseLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFirebaseLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListFirebaseLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFirebaseLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListFirebaseLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListFirebaseLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listGoogleAdsLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listGoogleAdsLinks(request), expectedError); - const actualRequest = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListGoogleAdsLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listMeasurementProtocolSecrets(request), expectedError); - const actualRequest = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListMeasurementProtocolSecretsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest', ['account']); - request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest', ['account']); - request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest', ['account']); - request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchChangeHistoryEvents(request), expectedError); - const actualRequest = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest', ['account']); - request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; - 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( - (client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest', ['account']); - request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; - 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( - (client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest', ['account']); - request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; - 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( - (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.SearchChangeHistoryEventsRequest', ['account']); - request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; - 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( - (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListConversionEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListConversionEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListConversionEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listConversionEvents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listConversionEvents(request), expectedError); - const actualRequest = (client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListConversionEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listConversionEvents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListConversionEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listConversionEvents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListConversionEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListConversionEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDisplayVideo360AdvertiserLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDisplayVideo360AdvertiserLinks(request), expectedError); - const actualRequest = (client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDisplayVideo360AdvertiserLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDisplayVideo360AdvertiserLinkProposals(request), expectedError); - const actualRequest = (client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDisplayVideo360AdvertiserLinkProposalsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomDimensionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomDimensionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomDimensionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCustomDimensions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listCustomDimensions(request), expectedError); - const actualRequest = (client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomDimensionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomDimensions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomDimensionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomDimensions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomDimensionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomDimensionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomMetricsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomMetricsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomMetricsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCustomMetrics = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listCustomMetrics(request), expectedError); - const actualRequest = (client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomMetricsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomMetrics.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomMetricsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomMetrics.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomMetricsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListCustomMetricsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDataStreamsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDataStreamsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDataStreamsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDataStreams = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDataStreams(request), expectedError); - const actualRequest = (client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDataStreamsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataStreams.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDataStreamsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataStreams.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDataStreamsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListDataStreamsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listAudiences', () => { - it('invokes listAudiences 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.ListAudiencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAudiencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), - ]; - client.innerApiCalls.listAudiences = stubSimpleCall(expectedResponse); - const [response] = await client.listAudiences(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAudiences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAudiences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAudiences 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.ListAudiencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAudiencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), - ]; - client.innerApiCalls.listAudiences = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAudiences( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAudience[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAudiences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAudiences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAudiences 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.ListAudiencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAudiencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAudiences = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAudiences(request), expectedError); - const actualRequest = (client.innerApiCalls.listAudiences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAudiences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAudiencesStream 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.ListAudiencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAudiencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), - ]; - client.descriptors.page.listAudiences.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAudiencesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.Audience[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.Audience) => { - 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.listAudiences.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAudiences, request)); - assert( - (client.descriptors.page.listAudiences.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAudiencesStream 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.ListAudiencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAudiencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAudiences.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAudiencesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.Audience[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.Audience) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAudiences.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAudiences, request)); - assert( - (client.descriptors.page.listAudiences.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAudiences 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.ListAudiencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAudiencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.Audience()), - ]; - client.descriptors.page.listAudiences.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IAudience[] = []; - const iterable = client.listAudiencesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAudiences.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAudiences.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAudiences 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.ListAudiencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAudiencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAudiences.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAudiencesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IAudience[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAudiences.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAudiences.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSearchAds360Links', () => { - it('invokes listSearchAds360Links 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.ListSearchAds360LinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListSearchAds360LinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), - ]; - client.innerApiCalls.listSearchAds360Links = stubSimpleCall(expectedResponse); - const [response] = await client.listSearchAds360Links(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSearchAds360Links as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSearchAds360Links as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSearchAds360Links 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.ListSearchAds360LinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListSearchAds360LinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), - ]; - client.innerApiCalls.listSearchAds360Links = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSearchAds360Links( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ISearchAds360Link[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSearchAds360Links as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSearchAds360Links as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSearchAds360Links 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.ListSearchAds360LinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListSearchAds360LinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSearchAds360Links = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSearchAds360Links(request), expectedError); - const actualRequest = (client.innerApiCalls.listSearchAds360Links as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSearchAds360Links as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSearchAds360LinksStream 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.ListSearchAds360LinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListSearchAds360LinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), - ]; - client.descriptors.page.listSearchAds360Links.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSearchAds360LinksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.SearchAds360Link[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.SearchAds360Link) => { - 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.listSearchAds360Links.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSearchAds360Links, request)); - assert( - (client.descriptors.page.listSearchAds360Links.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSearchAds360LinksStream 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.ListSearchAds360LinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListSearchAds360LinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSearchAds360Links.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSearchAds360LinksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.SearchAds360Link[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.SearchAds360Link) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSearchAds360Links.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSearchAds360Links, request)); - assert( - (client.descriptors.page.listSearchAds360Links.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSearchAds360Links 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.ListSearchAds360LinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListSearchAds360LinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.SearchAds360Link()), - ]; - client.descriptors.page.listSearchAds360Links.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.ISearchAds360Link[] = []; - const iterable = client.listSearchAds360LinksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSearchAds360Links.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSearchAds360Links.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSearchAds360Links 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.ListSearchAds360LinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListSearchAds360LinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSearchAds360Links.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSearchAds360LinksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.ISearchAds360Link[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSearchAds360Links.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSearchAds360Links.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listAccessBindings', () => { - it('invokes listAccessBindings 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.ListAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), - ]; - client.innerApiCalls.listAccessBindings = stubSimpleCall(expectedResponse); - const [response] = await client.listAccessBindings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAccessBindings 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.ListAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), - ]; - client.innerApiCalls.listAccessBindings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAccessBindings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IAccessBinding[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAccessBindings 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.ListAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAccessBindings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAccessBindings(request), expectedError); - const actualRequest = (client.innerApiCalls.listAccessBindings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAccessBindings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAccessBindingsStream 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.ListAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), - ]; - client.descriptors.page.listAccessBindings.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAccessBindingsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.AccessBinding[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.AccessBinding) => { - 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.listAccessBindings.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAccessBindings, request)); - assert( - (client.descriptors.page.listAccessBindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAccessBindingsStream 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.ListAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAccessBindings.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAccessBindingsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.AccessBinding[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.AccessBinding) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAccessBindings.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAccessBindings, request)); - assert( - (client.descriptors.page.listAccessBindings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAccessBindings 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.ListAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.AccessBinding()), - ]; - client.descriptors.page.listAccessBindings.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IAccessBinding[] = []; - const iterable = client.listAccessBindingsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAccessBindings.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAccessBindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAccessBindings 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.ListAccessBindingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListAccessBindingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAccessBindings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAccessBindingsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IAccessBinding[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAccessBindings.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAccessBindings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listExpandedDataSets', () => { - it('invokes listExpandedDataSets 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.ListExpandedDataSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListExpandedDataSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), - ]; - client.innerApiCalls.listExpandedDataSets = stubSimpleCall(expectedResponse); - const [response] = await client.listExpandedDataSets(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listExpandedDataSets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExpandedDataSets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExpandedDataSets 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.ListExpandedDataSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListExpandedDataSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), - ]; - client.innerApiCalls.listExpandedDataSets = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listExpandedDataSets( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IExpandedDataSet[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listExpandedDataSets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExpandedDataSets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExpandedDataSets 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.ListExpandedDataSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListExpandedDataSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listExpandedDataSets = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listExpandedDataSets(request), expectedError); - const actualRequest = (client.innerApiCalls.listExpandedDataSets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExpandedDataSets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExpandedDataSetsStream 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.ListExpandedDataSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListExpandedDataSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), - ]; - client.descriptors.page.listExpandedDataSets.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listExpandedDataSetsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.ExpandedDataSet[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.ExpandedDataSet) => { - 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.listExpandedDataSets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExpandedDataSets, request)); - assert( - (client.descriptors.page.listExpandedDataSets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listExpandedDataSetsStream 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.ListExpandedDataSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListExpandedDataSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listExpandedDataSets.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listExpandedDataSetsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.ExpandedDataSet[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.ExpandedDataSet) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listExpandedDataSets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExpandedDataSets, request)); - assert( - (client.descriptors.page.listExpandedDataSets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listExpandedDataSets 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.ListExpandedDataSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListExpandedDataSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.ExpandedDataSet()), - ]; - client.descriptors.page.listExpandedDataSets.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IExpandedDataSet[] = []; - const iterable = client.listExpandedDataSetsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listExpandedDataSets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listExpandedDataSets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listExpandedDataSets 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.ListExpandedDataSetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListExpandedDataSetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listExpandedDataSets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listExpandedDataSetsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IExpandedDataSet[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listExpandedDataSets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listExpandedDataSets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBigQueryLinks', () => { - it('invokes listBigQueryLinks 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.ListBigQueryLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListBigQueryLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), - ]; - client.innerApiCalls.listBigQueryLinks = stubSimpleCall(expectedResponse); - const [response] = await client.listBigQueryLinks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBigQueryLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBigQueryLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBigQueryLinks 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.ListBigQueryLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListBigQueryLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), - ]; - client.innerApiCalls.listBigQueryLinks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBigQueryLinks( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IBigQueryLink[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBigQueryLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBigQueryLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBigQueryLinks 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.ListBigQueryLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListBigQueryLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBigQueryLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBigQueryLinks(request), expectedError); - const actualRequest = (client.innerApiCalls.listBigQueryLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBigQueryLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBigQueryLinksStream 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.ListBigQueryLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListBigQueryLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), - ]; - client.descriptors.page.listBigQueryLinks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBigQueryLinksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.BigQueryLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.BigQueryLink) => { - 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.listBigQueryLinks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBigQueryLinks, request)); - assert( - (client.descriptors.page.listBigQueryLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBigQueryLinksStream 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.ListBigQueryLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListBigQueryLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listBigQueryLinks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBigQueryLinksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.analytics.admin.v1alpha.BigQueryLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1alpha.BigQueryLink) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBigQueryLinks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBigQueryLinks, request)); - assert( - (client.descriptors.page.listBigQueryLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBigQueryLinks 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.ListBigQueryLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListBigQueryLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), - generateSampleMessage(new protos.google.analytics.admin.v1alpha.BigQueryLink()), - ]; - client.descriptors.page.listBigQueryLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1alpha.IBigQueryLink[] = []; - const iterable = client.listBigQueryLinksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBigQueryLinks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBigQueryLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBigQueryLinks 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.ListBigQueryLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1alpha.ListBigQueryLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listBigQueryLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBigQueryLinksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.analytics.admin.v1alpha.IBigQueryLink[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBigQueryLinks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBigQueryLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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('accountAccessBinding', () => { - const fakePath = "/rendered/path/accountAccessBinding"; - const expectedParameters = { - account: "accountValue", - access_binding: "accessBindingValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.accountAccessBindingPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.accountAccessBindingPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('accountAccessBindingPath', () => { - const result = client.accountAccessBindingPath("accountValue", "accessBindingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.accountAccessBindingPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchAccountFromAccountAccessBindingName', () => { - const result = client.matchAccountFromAccountAccessBindingName(fakePath); - assert.strictEqual(result, "accountValue"); - assert((client.pathTemplates.accountAccessBindingPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAccessBindingFromAccountAccessBindingName', () => { - const result = client.matchAccessBindingFromAccountAccessBindingName(fakePath); - assert.strictEqual(result, "accessBindingValue"); - assert((client.pathTemplates.accountAccessBindingPathTemplate.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('attributionSettings', () => { - const fakePath = "/rendered/path/attributionSettings"; - const expectedParameters = { - property: "propertyValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributionSettingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributionSettingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributionSettingsPath', () => { - const result = client.attributionSettingsPath("propertyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributionSettingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromAttributionSettingsName', () => { - const result = client.matchPropertyFromAttributionSettingsName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.attributionSettingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('audience', () => { - const fakePath = "/rendered/path/audience"; - const expectedParameters = { - property: "propertyValue", - audience: "audienceValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.audiencePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.audiencePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('audiencePath', () => { - const result = client.audiencePath("propertyValue", "audienceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.audiencePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromAudienceName', () => { - const result = client.matchPropertyFromAudienceName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.audiencePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAudienceFromAudienceName', () => { - const result = client.matchAudienceFromAudienceName(fakePath); - assert.strictEqual(result, "audienceValue"); - assert((client.pathTemplates.audiencePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('bigQueryLink', () => { - const fakePath = "/rendered/path/bigQueryLink"; - const expectedParameters = { - property: "propertyValue", - bigquery_link: "bigqueryLinkValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.bigQueryLinkPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.bigQueryLinkPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('bigQueryLinkPath', () => { - const result = client.bigQueryLinkPath("propertyValue", "bigqueryLinkValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.bigQueryLinkPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromBigQueryLinkName', () => { - const result = client.matchPropertyFromBigQueryLinkName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.bigQueryLinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBigqueryLinkFromBigQueryLinkName', () => { - const result = client.matchBigqueryLinkFromBigQueryLinkName(fakePath); - assert.strictEqual(result, "bigqueryLinkValue"); - assert((client.pathTemplates.bigQueryLinkPathTemplate.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('enhancedMeasurementSettings', () => { - const fakePath = "/rendered/path/enhancedMeasurementSettings"; - 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.enhancedMeasurementSettingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.enhancedMeasurementSettingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('enhancedMeasurementSettingsPath', () => { - const result = client.enhancedMeasurementSettingsPath("propertyValue", "dataStreamValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.enhancedMeasurementSettingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromEnhancedMeasurementSettingsName', () => { - const result = client.matchPropertyFromEnhancedMeasurementSettingsName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.enhancedMeasurementSettingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataStreamFromEnhancedMeasurementSettingsName', () => { - const result = client.matchDataStreamFromEnhancedMeasurementSettingsName(fakePath); - assert.strictEqual(result, "dataStreamValue"); - assert((client.pathTemplates.enhancedMeasurementSettingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('expandedDataSet', () => { - const fakePath = "/rendered/path/expandedDataSet"; - const expectedParameters = { - property: "propertyValue", - expanded_data_set: "expandedDataSetValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.expandedDataSetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.expandedDataSetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('expandedDataSetPath', () => { - const result = client.expandedDataSetPath("propertyValue", "expandedDataSetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.expandedDataSetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromExpandedDataSetName', () => { - const result = client.matchPropertyFromExpandedDataSetName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.expandedDataSetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExpandedDataSetFromExpandedDataSetName', () => { - const result = client.matchExpandedDataSetFromExpandedDataSetName(fakePath); - assert.strictEqual(result, "expandedDataSetValue"); - assert((client.pathTemplates.expandedDataSetPathTemplate.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('propertyAccessBinding', () => { - const fakePath = "/rendered/path/propertyAccessBinding"; - const expectedParameters = { - property: "propertyValue", - access_binding: "accessBindingValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.propertyAccessBindingPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.propertyAccessBindingPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('propertyAccessBindingPath', () => { - const result = client.propertyAccessBindingPath("propertyValue", "accessBindingValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.propertyAccessBindingPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromPropertyAccessBindingName', () => { - const result = client.matchPropertyFromPropertyAccessBindingName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.propertyAccessBindingPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAccessBindingFromPropertyAccessBindingName', () => { - const result = client.matchAccessBindingFromPropertyAccessBindingName(fakePath); - assert.strictEqual(result, "accessBindingValue"); - assert((client.pathTemplates.propertyAccessBindingPathTemplate.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)); - }); - }); - - describe('searchAds360Link', () => { - const fakePath = "/rendered/path/searchAds360Link"; - const expectedParameters = { - property: "propertyValue", - }; - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.searchAds360LinkPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.searchAds360LinkPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('searchAds360LinkPath', () => { - const result = client.searchAds360LinkPath("propertyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.searchAds360LinkPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchPropertyFromSearchAds360LinkName', () => { - const result = client.matchPropertyFromSearchAds360LinkName(fakePath); - assert.strictEqual(result, "propertyValue"); - assert((client.pathTemplates.searchAds360LinkPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-analytics-admin/v1alpha/tsconfig.json b/owl-bot-staging/google-analytics-admin/v1alpha/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-analytics-admin/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/google-analytics-admin/v1alpha/webpack.config.js b/owl-bot-staging/google-analytics-admin/v1alpha/webpack.config.js deleted file mode 100644 index 0e336a8bddc..00000000000 --- a/owl-bot-staging/google-analytics-admin/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/owl-bot-staging/google-analytics-admin/v1beta/.eslintignore b/owl-bot-staging/google-analytics-admin/v1beta/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-analytics-admin/v1beta/.eslintrc.json b/owl-bot-staging/google-analytics-admin/v1beta/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/.gitignore b/owl-bot-staging/google-analytics-admin/v1beta/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-analytics-admin/v1beta/.jsdoc.js b/owl-bot-staging/google-analytics-admin/v1beta/.jsdoc.js deleted file mode 100644 index 9f742f6cf16..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 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 2023 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/admin', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-analytics-admin/v1beta/.mocharc.js b/owl-bot-staging/google-analytics-admin/v1beta/.mocharc.js deleted file mode 100644 index 1a38f257db7..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 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/google-analytics-admin/v1beta/.prettierrc.js b/owl-bot-staging/google-analytics-admin/v1beta/.prettierrc.js deleted file mode 100644 index 55639e70f9e..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 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/google-analytics-admin/v1beta/README.md b/owl-bot-staging/google-analytics-admin/v1beta/README.md deleted file mode 100644 index 5d45b74ed37..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/README.md +++ /dev/null @@ -1 +0,0 @@ -Admin: Nodejs Client diff --git a/owl-bot-staging/google-analytics-admin/v1beta/linkinator.config.json b/owl-bot-staging/google-analytics-admin/v1beta/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/package.json b/owl-bot-staging/google-analytics-admin/v1beta/package.json deleted file mode 100644 index 747d61e7329..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/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/ && minifyProtoJson", - "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.5.7" - }, - "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^4.0.0", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", - "mocha": "^10.2.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^15.0.1", - "ts-loader": "^8.4.0", - "typescript": "^4.8.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/analytics_admin.proto b/owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/analytics_admin.proto deleted file mode 100644 index b8ecfe20e3c..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/analytics_admin.proto +++ /dev/null @@ -1,1517 +0,0 @@ -// Copyright 2023 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.v1beta; - -import "google/analytics/admin/v1beta/access_report.proto"; -import "google/analytics/admin/v1beta/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/v1beta;admin"; -option java_multiple_files = true; -option java_outer_classname = "AnalyticsAdminProto"; -option java_package = "com.google.analytics.admin.v1beta"; - -// 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.readonly"; - - // Lookup for a single Account. - rpc GetAccount(GetAccountRequest) returns (Account) { - option (google.api.http) = { - get: "/v1beta/{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: "/v1beta/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: "/v1beta/{name=accounts/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates an account. - rpc UpdateAccount(UpdateAccountRequest) returns (Account) { - option (google.api.http) = { - patch: "/v1beta/{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: "/v1beta/accounts:provisionAccountTicket" - body: "*" - }; - } - - // Returns summaries of all accounts accessible by the caller. - rpc ListAccountSummaries(ListAccountSummariesRequest) - returns (ListAccountSummariesResponse) { - option (google.api.http) = { - get: "/v1beta/accountSummaries" - }; - } - - // Lookup for a single "GA4" Property. - rpc GetProperty(GetPropertyRequest) returns (Property) { - option (google.api.http) = { - get: "/v1beta/{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: "/v1beta/properties" - }; - } - - // Creates an "GA4" property with the specified location and attributes. - rpc CreateProperty(CreatePropertyRequest) returns (Property) { - option (google.api.http) = { - post: "/v1beta/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 a GA4 Property. - rpc DeleteProperty(DeletePropertyRequest) returns (Property) { - option (google.api.http) = { - delete: "/v1beta/{name=properties/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a property. - rpc UpdateProperty(UpdatePropertyRequest) returns (Property) { - option (google.api.http) = { - patch: "/v1beta/{property.name=properties/*}" - body: "property" - }; - option (google.api.method_signature) = "property,update_mask"; - } - - // Creates a FirebaseLink. - // - // Properties can have at most one FirebaseLink. - rpc CreateFirebaseLink(CreateFirebaseLinkRequest) returns (FirebaseLink) { - option (google.api.http) = { - post: "/v1beta/{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: "/v1beta/{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: "/v1beta/{parent=properties/*}/firebaseLinks" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates a GoogleAdsLink. - rpc CreateGoogleAdsLink(CreateGoogleAdsLinkRequest) returns (GoogleAdsLink) { - option (google.api.http) = { - post: "/v1beta/{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: "/v1beta/{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: "/v1beta/{name=properties/*/googleAdsLinks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists GoogleAdsLinks on a property. - rpc ListGoogleAdsLinks(ListGoogleAdsLinksRequest) - returns (ListGoogleAdsLinksResponse) { - option (google.api.http) = { - get: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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 through this API) before MeasurementProtocolSecret resources may be - // created. - rpc AcknowledgeUserDataCollection(AcknowledgeUserDataCollectionRequest) - returns (AcknowledgeUserDataCollectionResponse) { - option (google.api.http) = { - post: "/v1beta/{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: "/v1beta/{account=accounts/*}:searchChangeHistoryEvents" - body: "*" - }; - } - - // Creates a conversion event with the specified attributes. - rpc CreateConversionEvent(CreateConversionEventRequest) - returns (ConversionEvent) { - option (google.api.http) = { - post: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{parent=properties/*}/conversionEvents" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates a CustomDimension. - rpc CreateCustomDimension(CreateCustomDimensionRequest) - returns (CustomDimension) { - option (google.api.http) = { - post: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{name=properties/*/customDimensions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a CustomMetric. - rpc CreateCustomMetric(CreateCustomMetricRequest) returns (CustomMetric) { - option (google.api.http) = { - post: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{parent=properties/*}/dataStreams" - }; - option (google.api.method_signature) = "parent"; - } - - // Lookup for a single DataStream. - rpc GetDataStream(GetDataStreamRequest) returns (DataStream) { - option (google.api.http) = { - get: "/v1beta/{name=properties/*/dataStreams/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Returns a customized report of data access records. The report provides - // records of each time a user reads Google Analytics reporting data. Access - // records are retained for up to 2 years. - // - // Data Access Reports can be requested for a property. The property must be - // in Google Analytics 360. This method is only available to Administrators. - // - // These data access records include GA4 UI Reporting, GA4 UI Explorations, - // GA4 Data API, and other products like Firebase & Admob that can retrieve - // data from Google Analytics through a linkage. These records don't include - // property configuration changes like adding a stream or changing a - // property's time zone. For configuration change history, see - // [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). - rpc RunAccessReport(RunAccessReportRequest) - returns (RunAccessReportResponse) { - option (google.api.http) = { - post: "/v1beta/{entity=properties/*}:runAccessReport" - body: "*" - additional_bindings { - post: "/v1beta/{entity=accounts/*}:runAccessReport" - body: "*" - } - }; - } -} - -// The request for a Data Access Record Report. -message RunAccessReportRequest { - // The Data Access Report supports requesting at the property level or account - // level. If requested at the account level, Data Access Reports include all - // access for all properties under that account. - // - // To request at the property level, entity should be for example - // 'properties/123' if "123" is your GA4 property ID. To request at the - // account level, entity should be for example 'accounts/1234' if "1234" is - // your GA4 Account ID. - string entity = 1; - - // The dimensions requested and displayed in the response. Requests are - // allowed up to 9 dimensions. - repeated AccessDimension dimensions = 2; - - // The metrics requested and displayed in the response. Requests are allowed - // up to 10 metrics. - repeated AccessMetric metrics = 3; - - // Date ranges of access records to read. If multiple date ranges are - // requested, each response row will contain a zero based date range index. If - // two date ranges overlap, the access records for the overlapping days is - // included in the response rows for both date ranges. Requests are allowed up - // to 2 date ranges. - repeated AccessDateRange date_ranges = 4; - - // Dimension filters let you restrict report response to specific - // dimension values which match the filter. For example, filtering on access - // records of a single user. To learn more, see [Fundamentals of Dimension - // Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) - // for examples. Metrics cannot be used in this filter. - AccessFilterExpression dimension_filter = 5; - - // Metric filters allow you to restrict report response to specific metric - // values which match the filter. Metric filters are applied after aggregating - // the report's rows, similar to SQL having-clause. Dimensions cannot be used - // in this filter. - AccessFilterExpression metric_filter = 6; - - // The row count of the start row. The first row is counted as row 0. If - // offset is unspecified, it is treated as 0. If offset is zero, then this - // method will return the first page of results with `limit` entries. - // - // To learn more about this pagination parameter, see - // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - int64 offset = 7; - - // The number of rows to return. If unspecified, 10,000 rows are returned. The - // API returns a maximum of 100,000 rows per request, no matter how many you - // ask for. `limit` must be positive. - // - // The API may return fewer rows than the requested `limit`, if there aren't - // as many remaining rows as the `limit`. For instance, there are fewer than - // 300 possible values for the dimension `country`, so when reporting on only - // `country`, you can't get more than 300 rows, even if you set `limit` to a - // higher value. - // - // To learn more about this pagination parameter, see - // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - int64 limit = 8; - - // This request's time zone if specified. If unspecified, the property's time - // zone is used. The request's time zone is used to interpret the start & end - // dates of the report. - // - // Formatted as strings from the IANA Time Zone database - // (https://www.iana.org/time-zones); for example "America/New_York" or - // "Asia/Tokyo". - string time_zone = 9; - - // Specifies how rows are ordered in the response. - repeated AccessOrderBy order_bys = 10; - - // Toggles whether to return the current state of this Analytics Property's - // quota. Quota is returned in [AccessQuota](#AccessQuota). For account-level - // requests, this field must be false. - bool return_entity_quota = 11; -} - -// The customized Data Access Record Report response. -message RunAccessReportResponse { - // The header for a column in the report that corresponds to a specific - // dimension. The number of DimensionHeaders and ordering of DimensionHeaders - // matches the dimensions present in rows. - repeated AccessDimensionHeader dimension_headers = 1; - - // The header for a column in the report that corresponds to a specific - // metric. The number of MetricHeaders and ordering of MetricHeaders matches - // the metrics present in rows. - repeated AccessMetricHeader metric_headers = 2; - - // Rows of dimension value combinations and metric values in the report. - repeated AccessRow rows = 3; - - // The total number of rows in the query result. `rowCount` is independent of - // the number of rows returned in the response, the `limit` request - // parameter, and the `offset` request parameter. For example if a query - // returns 175 rows and includes `limit` of 50 in the API request, the - // response will contain `rowCount` of 175 but only 50 rows. - // - // To learn more about this pagination parameter, see - // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - int32 row_count = 4; - - // The quota state for this Analytics property including this request. This - // field doesn't work with account-level requests. - AccessQuota quota = 5; -} - -// 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 (for example, "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 Cloud 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 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 `ListFirebaseLinks` 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 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 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 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/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/resources.proto b/owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/resources.proto deleted file mode 100644 index 43b299b7f58..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/resources.proto +++ /dev/null @@ -1,922 +0,0 @@ -// Copyright 2023 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.v1beta; - -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/v1beta;admin"; -option java_multiple_files = true; -option java_outer_classname = "ResourcesProto"; -option java_package = "com.google.analytics.admin.v1beta"; - -// 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; - - // 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; - - // AttributionSettings resource - ATTRIBUTION_SETTINGS = 20; -} - -// Types of Property resources. -enum PropertyType { - // Unknown or unspecified property type - PROPERTY_TYPE_UNSPECIFIED = 0; - - // Ordinary GA4 property - PROPERTY_TYPE_ORDINARY = 1; - - // GA4 subproperty - PROPERTY_TYPE_SUBPROPERTY = 2; - - // GA4 rollup property - PROPERTY_TYPE_ROLLUP = 3; -} - -// 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]; - - // Immutable. The property type for this Property resource. When creating a - // property, if the type is "PROPERTY_TYPE_UNSPECIFIED", then - // "ORDINARY_PROPERTY" will be implied. "SUBPROPERTY" and "ROLLUP_PROPERTY" - // types cannot yet be created with the Google Analytics Admin API. - PropertyType property_type = 14 [(google.api.field_behavior) = IMMUTABLE]; - - // 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}, properties/{property} - // Example: "accounts/100", "properties/101" - 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 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]; -} - -// 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; - - // The property's property type. - PropertyType property_type = 3; - - // Resource name of this property's logical parent. - // - // Note: The Property-Moving UI can be used to change the parent. - // Format: accounts/{account}, properties/{property} - // Example: "accounts/100", "properties/200" - string parent = 4; -} - -// 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}/dataStreams/{dataStream}/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 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 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 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 with - // 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]; -} - -// 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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js deleted file mode 100644 index 6b152cbaca5..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_AcknowledgeUserDataCollection_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_dimension.js deleted file mode 100644 index 6ca0cc1d981..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_dimension.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ArchiveCustomDimension_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_metric.js deleted file mode 100644 index f441178111d..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.archive_custom_metric.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ArchiveCustomMetric_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js deleted file mode 100644 index b63a44b7a36..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateConversionEvent_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_dimension.js deleted file mode 100644 index 79e0f4dcbb5..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_dimension.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateCustomDimension_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_metric.js deleted file mode 100644 index 722331618d2..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_custom_metric.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateCustomMetric_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_data_stream.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_data_stream.js deleted file mode 100644 index 3dbe146e8cf..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_data_stream.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateDataStream_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_firebase_link.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_firebase_link.js deleted file mode 100644 index 87bf87fed47..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_firebase_link.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateFirebaseLink_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_google_ads_link.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_google_ads_link.js deleted file mode 100644 index b58c28ceec4..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_google_ads_link.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateGoogleAdsLink_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_measurement_protocol_secret.js deleted file mode 100644 index 6d9b33ab2ab..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_measurement_protocol_secret.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateMeasurementProtocolSecret_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_property.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_property.js deleted file mode 100644 index e93bfc32f3e..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.create_property.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_CreateProperty_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_account.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_account.js deleted file mode 100644 index 31ece9bd4ba..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_account.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_DeleteAccount_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_conversion_event.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_conversion_event.js deleted file mode 100644 index 042ea55e2a7..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_conversion_event.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_DeleteConversionEvent_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_data_stream.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_data_stream.js deleted file mode 100644 index 104d08127da..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_data_stream.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_DeleteDataStream_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_firebase_link.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_firebase_link.js deleted file mode 100644 index 09889812cc0..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_firebase_link.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_DeleteFirebaseLink_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_google_ads_link.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_google_ads_link.js deleted file mode 100644 index 7bf84caacb2..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_google_ads_link.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_DeleteGoogleAdsLink_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_measurement_protocol_secret.js deleted file mode 100644 index 8a04c18a2b1..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_measurement_protocol_secret.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_DeleteMeasurementProtocolSecret_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_property.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_property.js deleted file mode 100644 index 760bd01d2e8..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.delete_property.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_DeleteProperty_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_account.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_account.js deleted file mode 100644 index 8019f72c04d..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_account.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetAccount_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_conversion_event.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_conversion_event.js deleted file mode 100644 index f999985b055..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_conversion_event.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetConversionEvent_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_dimension.js deleted file mode 100644 index e3bbf1d9606..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_dimension.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetCustomDimension_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_metric.js deleted file mode 100644 index 2bd9f9383f3..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_custom_metric.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetCustomMetric_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_retention_settings.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_retention_settings.js deleted file mode 100644 index 77822fa12c5..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_retention_settings.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetDataRetentionSettings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_sharing_settings.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_sharing_settings.js deleted file mode 100644 index 007bbfbb076..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_sharing_settings.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetDataSharingSettings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_stream.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_stream.js deleted file mode 100644 index 6a97cc695b5..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_data_stream.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetDataStream_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_measurement_protocol_secret.js deleted file mode 100644 index e22754bb3ad..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_measurement_protocol_secret.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_property.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_property.js deleted file mode 100644 index ea92d2e9c16..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.get_property.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_GetProperty_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_account_summaries.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_account_summaries.js deleted file mode 100644 index 71a9bcc0103..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_account_summaries.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListAccountSummaries_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_accounts.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_accounts.js deleted file mode 100644 index 992a358d88d..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_accounts.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListAccounts_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_conversion_events.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_conversion_events.js deleted file mode 100644 index e0cc416266f..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_conversion_events.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListConversionEvents_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_dimensions.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_dimensions.js deleted file mode 100644 index 38f9d0c26be..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_dimensions.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListCustomDimensions_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_metrics.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_metrics.js deleted file mode 100644 index 9064c52e9ad..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_custom_metrics.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListCustomMetrics_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_data_streams.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_data_streams.js deleted file mode 100644 index ba0f9c2e930..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_data_streams.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListDataStreams_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js deleted file mode 100644 index a444c5aa701..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListFirebaseLinks_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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 `ListFirebaseLinks` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_google_ads_links.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_google_ads_links.js deleted file mode 100644 index bbb5d96f346..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_google_ads_links.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListGoogleAdsLinks_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js deleted file mode 100644 index eadb7020873..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_properties.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_properties.js deleted file mode 100644 index 855831b816b..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.list_properties.js +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ListProperties_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js deleted file mode 100644 index 55d6b28696b..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_ProvisionAccountTicket_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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 Cloud Console as a Redirect URI. - */ - // const redirectUri = 'abc123' - - // Imports the Admin library - const {AnalyticsAdminServiceClient} = require('@google-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js deleted file mode 100644 index 62edc7851f5..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_SearchChangeHistoryEvents_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_account.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_account.js deleted file mode 100644 index 42a1adc651e..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_account.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateAccount_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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 (for example, "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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js deleted file mode 100644 index bc8726494e8..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateCustomDimension_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js deleted file mode 100644 index f0de40297ff..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateCustomMetric_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js deleted file mode 100644 index 4dc7e9f52d6..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateDataRetentionSettings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_stream.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_stream.js deleted file mode 100644 index f151f9e38dc..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_data_stream.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateDataStream_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js deleted file mode 100644 index a3177166541..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateGoogleAdsLink_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_measurement_protocol_secret.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_measurement_protocol_secret.js deleted file mode 100644 index 9b9650091fa..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_measurement_protocol_secret.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateMeasurementProtocolSecret_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_property.js b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_property.js deleted file mode 100644 index c856ef50871..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.update_property.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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_v1beta_generated_AnalyticsAdminService_UpdateProperty_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * 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-cloud/admin').v1beta; - - // 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_v1beta_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/google-analytics-admin/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json b/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json deleted file mode 100644 index f795dd8bedc..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json +++ /dev/null @@ -1,2155 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-admin", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.analytics.admin.v1beta", - "version": "v1beta" - } - ] - }, - "snippets": [ - { - "regionTag": "analyticsadmin_v1beta_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": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAccount", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetAccount", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1beta.Account", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetAccount", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetAccount", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAccounts", - "fullName": "google.analytics.admin.v1beta.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.v1beta.ListAccountsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListAccounts", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListAccounts", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteAccount", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteAccount", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteAccount", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteAccount", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateAccount", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateAccount", - "async": true, - "parameters": [ - { - "name": "account", - "type": ".google.analytics.admin.v1beta.Account" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1beta.Account", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateAccount", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateAccount", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ProvisionAccountTicket", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ProvisionAccountTicket", - "async": true, - "parameters": [ - { - "name": "account", - "type": ".google.analytics.admin.v1beta.Account" - }, - { - "name": "redirect_uri", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1beta.ProvisionAccountTicketResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ProvisionAccountTicket", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ProvisionAccountTicket", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAccountSummaries", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListAccountSummaries", - "async": true, - "parameters": [ - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1beta.ListAccountSummariesResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListAccountSummaries", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListAccountSummaries", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetProperty", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetProperty", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1beta.Property", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetProperty", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetProperty", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 89, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListProperties", - "fullName": "google.analytics.admin.v1beta.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.v1beta.ListPropertiesResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListProperties", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListProperties", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateProperty", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateProperty", - "async": true, - "parameters": [ - { - "name": "property", - "type": ".google.analytics.admin.v1beta.Property" - } - ], - "resultType": ".google.analytics.admin.v1beta.Property", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateProperty", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateProperty", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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 a GA4 Property.", - "canonical": true, - "file": "analytics_admin_service.delete_property.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteProperty", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteProperty", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1beta.Property", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteProperty", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteProperty", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateProperty", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateProperty", - "async": true, - "parameters": [ - { - "name": "property", - "type": ".google.analytics.admin.v1beta.Property" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1beta.Property", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateProperty", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateProperty", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateFirebaseLink", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateFirebaseLink", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "firebase_link", - "type": ".google.analytics.admin.v1beta.FirebaseLink" - } - ], - "resultType": ".google.analytics.admin.v1beta.FirebaseLink", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateFirebaseLink", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateFirebaseLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteFirebaseLink", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteFirebaseLink", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteFirebaseLink", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteFirebaseLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListFirebaseLinks", - "fullName": "google.analytics.admin.v1beta.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.v1beta.ListFirebaseLinksResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListFirebaseLinks", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListFirebaseLinks", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateGoogleAdsLink", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateGoogleAdsLink", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "google_ads_link", - "type": ".google.analytics.admin.v1beta.GoogleAdsLink" - } - ], - "resultType": ".google.analytics.admin.v1beta.GoogleAdsLink", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateGoogleAdsLink", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateGoogleAdsLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateGoogleAdsLink", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateGoogleAdsLink", - "async": true, - "parameters": [ - { - "name": "google_ads_link", - "type": ".google.analytics.admin.v1beta.GoogleAdsLink" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1beta.GoogleAdsLink", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateGoogleAdsLink", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateGoogleAdsLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteGoogleAdsLink", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteGoogleAdsLink", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteGoogleAdsLink", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteGoogleAdsLink", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListGoogleAdsLinks", - "fullName": "google.analytics.admin.v1beta.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.v1beta.ListGoogleAdsLinksResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListGoogleAdsLinks", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListGoogleAdsLinks", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDataSharingSettings", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetDataSharingSettings", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1beta.DataSharingSettings", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetDataSharingSettings", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetDataSharingSettings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetMeasurementProtocolSecret", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1beta.MeasurementProtocolSecret", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetMeasurementProtocolSecret", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListMeasurementProtocolSecrets", - "fullName": "google.analytics.admin.v1beta.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.v1beta.ListMeasurementProtocolSecretsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListMeasurementProtocolSecrets", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListMeasurementProtocolSecrets", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateMeasurementProtocolSecret", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "measurement_protocol_secret", - "type": ".google.analytics.admin.v1beta.MeasurementProtocolSecret" - } - ], - "resultType": ".google.analytics.admin.v1beta.MeasurementProtocolSecret", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateMeasurementProtocolSecret", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteMeasurementProtocolSecret", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteMeasurementProtocolSecret", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateMeasurementProtocolSecret", - "async": true, - "parameters": [ - { - "name": "measurement_protocol_secret", - "type": ".google.analytics.admin.v1beta.MeasurementProtocolSecret" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1beta.MeasurementProtocolSecret", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateMeasurementProtocolSecret", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateMeasurementProtocolSecret", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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 through 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": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "AcknowledgeUserDataCollection", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.AcknowledgeUserDataCollection", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "acknowledgement", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "AcknowledgeUserDataCollection", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.AcknowledgeUserDataCollection", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 99, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchChangeHistoryEvents", - "fullName": "google.analytics.admin.v1beta.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.v1beta.SearchChangeHistoryEventsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "SearchChangeHistoryEvents", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.SearchChangeHistoryEvents", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateConversionEvent", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateConversionEvent", - "async": true, - "parameters": [ - { - "name": "conversion_event", - "type": ".google.analytics.admin.v1beta.ConversionEvent" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1beta.ConversionEvent", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateConversionEvent", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateConversionEvent", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetConversionEvent", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetConversionEvent", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1beta.ConversionEvent", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetConversionEvent", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetConversionEvent", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteConversionEvent", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteConversionEvent", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteConversionEvent", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteConversionEvent", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListConversionEvents", - "fullName": "google.analytics.admin.v1beta.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.v1beta.ListConversionEventsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListConversionEvents", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListConversionEvents", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCustomDimension", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateCustomDimension", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "custom_dimension", - "type": ".google.analytics.admin.v1beta.CustomDimension" - } - ], - "resultType": ".google.analytics.admin.v1beta.CustomDimension", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateCustomDimension", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateCustomDimension", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCustomDimension", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateCustomDimension", - "async": true, - "parameters": [ - { - "name": "custom_dimension", - "type": ".google.analytics.admin.v1beta.CustomDimension" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1beta.CustomDimension", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateCustomDimension", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateCustomDimension", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCustomDimensions", - "fullName": "google.analytics.admin.v1beta.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.v1beta.ListCustomDimensionsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListCustomDimensions", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListCustomDimensions", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ArchiveCustomDimension", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ArchiveCustomDimension", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ArchiveCustomDimension", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ArchiveCustomDimension", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCustomDimension", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetCustomDimension", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1beta.CustomDimension", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetCustomDimension", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetCustomDimension", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCustomMetric", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateCustomMetric", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "custom_metric", - "type": ".google.analytics.admin.v1beta.CustomMetric" - } - ], - "resultType": ".google.analytics.admin.v1beta.CustomMetric", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateCustomMetric", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateCustomMetric", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCustomMetric", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateCustomMetric", - "async": true, - "parameters": [ - { - "name": "custom_metric", - "type": ".google.analytics.admin.v1beta.CustomMetric" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1beta.CustomMetric", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateCustomMetric", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateCustomMetric", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCustomMetrics", - "fullName": "google.analytics.admin.v1beta.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.v1beta.ListCustomMetricsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListCustomMetrics", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListCustomMetrics", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ArchiveCustomMetric", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ArchiveCustomMetric", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ArchiveCustomMetric", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ArchiveCustomMetric", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCustomMetric", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetCustomMetric", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1beta.CustomMetric", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetCustomMetric", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetCustomMetric", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDataRetentionSettings", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetDataRetentionSettings", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1beta.DataRetentionSettings", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetDataRetentionSettings", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetDataRetentionSettings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDataRetentionSettings", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateDataRetentionSettings", - "async": true, - "parameters": [ - { - "name": "data_retention_settings", - "type": ".google.analytics.admin.v1beta.DataRetentionSettings" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1beta.DataRetentionSettings", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateDataRetentionSettings", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateDataRetentionSettings", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDataStream", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateDataStream", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "data_stream", - "type": ".google.analytics.admin.v1beta.DataStream" - } - ], - "resultType": ".google.analytics.admin.v1beta.DataStream", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateDataStream", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.CreateDataStream", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteDataStream", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteDataStream", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteDataStream", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.DeleteDataStream", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDataStream", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateDataStream", - "async": true, - "parameters": [ - { - "name": "data_stream", - "type": ".google.analytics.admin.v1beta.DataStream" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.analytics.admin.v1beta.DataStream", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "UpdateDataStream", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.UpdateDataStream", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDataStreams", - "fullName": "google.analytics.admin.v1beta.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.v1beta.ListDataStreamsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListDataStreams", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.ListDataStreams", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_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": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDataStream", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetDataStream", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1beta.DataStream", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "GetDataStream", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.GetDataStream", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1beta_generated_AnalyticsAdminService_RunAccessReport_async", - "title": "AnalyticsAdminService runAccessReport Sample", - "origin": "API_DEFINITION", - "description": " Returns a customized report of data access records. The report provides records of each time a user reads Google Analytics reporting data. Access records are retained for up to 2 years. Data Access Reports can be requested for a property. The property must be in Google Analytics 360. This method is only available to Administrators. These data access records include GA4 UI Reporting, GA4 UI Explorations, GA4 Data API, and other products like Firebase & Admob that can retrieve data from Google Analytics through a linkage. These records don't include property configuration changes like adding a stream or changing a property's time zone. For configuration change history, see [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).", - "canonical": true, - "file": "analytics_admin_service.run_access_report.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 131, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunAccessReport", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.RunAccessReport", - "async": true, - "parameters": [ - { - "name": "entity", - "type": "TYPE_STRING" - }, - { - "name": "dimensions", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "metrics", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "date_ranges", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "dimension_filter", - "type": ".google.analytics.admin.v1beta.AccessFilterExpression" - }, - { - "name": "metric_filter", - "type": ".google.analytics.admin.v1beta.AccessFilterExpression" - }, - { - "name": "offset", - "type": "TYPE_INT64" - }, - { - "name": "limit", - "type": "TYPE_INT64" - }, - { - "name": "time_zone", - "type": "TYPE_STRING" - }, - { - "name": "order_bys", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "return_entity_quota", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.analytics.admin.v1beta.RunAccessReportResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "RunAccessReport", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.RunAccessReport", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/src/index.ts b/owl-bot-staging/google-analytics-admin/v1beta/src/index.ts deleted file mode 100644 index a21de875bdd..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1beta from './v1beta'; -const AnalyticsAdminServiceClient = v1beta.AnalyticsAdminServiceClient; -type AnalyticsAdminServiceClient = v1beta.AnalyticsAdminServiceClient; -export {v1beta, AnalyticsAdminServiceClient}; -export default {v1beta, AnalyticsAdminServiceClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client.ts b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client.ts deleted file mode 100644 index 0f27b716ed8..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client.ts +++ /dev/null @@ -1,5766 +0,0 @@ -// Copyright 2023 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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta/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 v1beta - */ -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}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AnalyticsAdminServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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}' - ), - 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}' - ), - firebaseLinkPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/firebaseLinks/{firebase_link}' - ), - googleAdsLinkPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/googleAdsLinks/{google_ads_link}' - ), - measurementProtocolSecretPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}/dataStreams/{data_stream}/measurementProtocolSecrets/{measurement_protocol_secret}' - ), - propertyPathTemplate: new this._gaxModule.PathTemplate( - 'properties/{property}' - ), - }; - - // 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'), - 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'), - 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.v1beta.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 = this._gaxModule.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.v1beta.AnalyticsAdminService. - this.analyticsAdminServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.analytics.admin.v1beta.AnalyticsAdminService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.analytics.admin.v1beta.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', 'createFirebaseLink', 'deleteFirebaseLink', 'listFirebaseLinks', 'createGoogleAdsLink', 'updateGoogleAdsLink', 'deleteGoogleAdsLink', 'listGoogleAdsLinks', 'getDataSharingSettings', 'getMeasurementProtocolSecret', 'listMeasurementProtocolSecrets', 'createMeasurementProtocolSecret', 'deleteMeasurementProtocolSecret', 'updateMeasurementProtocolSecret', 'acknowledgeUserDataCollection', 'searchChangeHistoryEvents', 'createConversionEvent', 'getConversionEvent', 'deleteConversionEvent', 'listConversionEvents', 'createCustomDimension', 'updateCustomDimension', 'listCustomDimensions', 'archiveCustomDimension', 'getCustomDimension', 'createCustomMetric', 'updateCustomMetric', 'listCustomMetrics', 'archiveCustomMetric', 'getCustomMetric', 'getDataRetentionSettings', 'updateDataRetentionSettings', 'createDataStream', 'deleteDataStream', 'updateDataStream', 'listDataStreams', 'getDataStream', 'runAccessReport']; - 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._opts.fallback - ); - - 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.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 {@link google.analytics.admin.v1beta.Account | 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/v1beta/analytics_admin_service.get_account.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetAccount_async - */ - getAccount( - request?: protos.google.analytics.admin.v1beta.IGetAccountRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IAccount, - protos.google.analytics.admin.v1beta.IGetAccountRequest|undefined, {}|undefined - ]>; - getAccount( - request: protos.google.analytics.admin.v1beta.IGetAccountRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IAccount, - protos.google.analytics.admin.v1beta.IGetAccountRequest|null|undefined, - {}|null|undefined>): void; - getAccount( - request: protos.google.analytics.admin.v1beta.IGetAccountRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IAccount, - protos.google.analytics.admin.v1beta.IGetAccountRequest|null|undefined, - {}|null|undefined>): void; - getAccount( - request?: protos.google.analytics.admin.v1beta.IGetAccountRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IAccount, - protos.google.analytics.admin.v1beta.IGetAccountRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IAccount, - protos.google.analytics.admin.v1beta.IGetAccountRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IAccount, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.delete_account.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteAccount_async - */ - deleteAccount( - request?: protos.google.analytics.admin.v1beta.IDeleteAccountRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteAccountRequest|undefined, {}|undefined - ]>; - deleteAccount( - request: protos.google.analytics.admin.v1beta.IDeleteAccountRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteAccountRequest|null|undefined, - {}|null|undefined>): void; - deleteAccount( - request: protos.google.analytics.admin.v1beta.IDeleteAccountRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteAccountRequest|null|undefined, - {}|null|undefined>): void; - deleteAccount( - request?: protos.google.analytics.admin.v1beta.IDeleteAccountRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteAccountRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteAccountRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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.v1beta.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 (for example, "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 {@link google.analytics.admin.v1beta.Account | 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/v1beta/analytics_admin_service.update_account.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateAccount_async - */ - updateAccount( - request?: protos.google.analytics.admin.v1beta.IUpdateAccountRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IAccount, - protos.google.analytics.admin.v1beta.IUpdateAccountRequest|undefined, {}|undefined - ]>; - updateAccount( - request: protos.google.analytics.admin.v1beta.IUpdateAccountRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IAccount, - protos.google.analytics.admin.v1beta.IUpdateAccountRequest|null|undefined, - {}|null|undefined>): void; - updateAccount( - request: protos.google.analytics.admin.v1beta.IUpdateAccountRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IAccount, - protos.google.analytics.admin.v1beta.IUpdateAccountRequest|null|undefined, - {}|null|undefined>): void; - updateAccount( - request?: protos.google.analytics.admin.v1beta.IUpdateAccountRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IAccount, - protos.google.analytics.admin.v1beta.IUpdateAccountRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IAccount, - protos.google.analytics.admin.v1beta.IUpdateAccountRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IAccount, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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.v1beta.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 Cloud 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 {@link google.analytics.admin.v1beta.ProvisionAccountTicketResponse | 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/v1beta/analytics_admin_service.provision_account_ticket.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ProvisionAccountTicket_async - */ - provisionAccountTicket( - request?: protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse, - protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest|undefined, {}|undefined - ]>; - provisionAccountTicket( - request: protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse, - protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest|null|undefined, - {}|null|undefined>): void; - provisionAccountTicket( - request: protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse, - protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest|null|undefined, - {}|null|undefined>): void; - provisionAccountTicket( - request?: protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse, - protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse, - protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse, - protos.google.analytics.admin.v1beta.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 {@link google.analytics.admin.v1beta.Property | 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/v1beta/analytics_admin_service.get_property.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetProperty_async - */ - getProperty( - request?: protos.google.analytics.admin.v1beta.IGetPropertyRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IGetPropertyRequest|undefined, {}|undefined - ]>; - getProperty( - request: protos.google.analytics.admin.v1beta.IGetPropertyRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IGetPropertyRequest|null|undefined, - {}|null|undefined>): void; - getProperty( - request: protos.google.analytics.admin.v1beta.IGetPropertyRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IGetPropertyRequest|null|undefined, - {}|null|undefined>): void; - getProperty( - request?: protos.google.analytics.admin.v1beta.IGetPropertyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IGetPropertyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IGetPropertyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.Property | 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/v1beta/analytics_admin_service.create_property.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateProperty_async - */ - createProperty( - request?: protos.google.analytics.admin.v1beta.ICreatePropertyRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.ICreatePropertyRequest|undefined, {}|undefined - ]>; - createProperty( - request: protos.google.analytics.admin.v1beta.ICreatePropertyRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.ICreatePropertyRequest|null|undefined, - {}|null|undefined>): void; - createProperty( - request: protos.google.analytics.admin.v1beta.ICreatePropertyRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.ICreatePropertyRequest|null|undefined, - {}|null|undefined>): void; - createProperty( - request?: protos.google.analytics.admin.v1beta.ICreatePropertyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.ICreatePropertyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.ICreatePropertyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.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 a 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 {@link google.analytics.admin.v1beta.Property | 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/v1beta/analytics_admin_service.delete_property.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteProperty_async - */ - deleteProperty( - request?: protos.google.analytics.admin.v1beta.IDeletePropertyRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IDeletePropertyRequest|undefined, {}|undefined - ]>; - deleteProperty( - request: protos.google.analytics.admin.v1beta.IDeletePropertyRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IDeletePropertyRequest|null|undefined, - {}|null|undefined>): void; - deleteProperty( - request: protos.google.analytics.admin.v1beta.IDeletePropertyRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IDeletePropertyRequest|null|undefined, - {}|null|undefined>): void; - deleteProperty( - request?: protos.google.analytics.admin.v1beta.IDeletePropertyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IDeletePropertyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IDeletePropertyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.Property | 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/v1beta/analytics_admin_service.update_property.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateProperty_async - */ - updateProperty( - request?: protos.google.analytics.admin.v1beta.IUpdatePropertyRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IUpdatePropertyRequest|undefined, {}|undefined - ]>; - updateProperty( - request: protos.google.analytics.admin.v1beta.IUpdatePropertyRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IUpdatePropertyRequest|null|undefined, - {}|null|undefined>): void; - updateProperty( - request: protos.google.analytics.admin.v1beta.IUpdatePropertyRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IUpdatePropertyRequest|null|undefined, - {}|null|undefined>): void; - updateProperty( - request?: protos.google.analytics.admin.v1beta.IUpdatePropertyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IUpdatePropertyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.IUpdatePropertyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IProperty, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'property.name': request.property!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateProperty(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.v1beta.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 {@link google.analytics.admin.v1beta.FirebaseLink | 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/v1beta/analytics_admin_service.create_firebase_link.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateFirebaseLink_async - */ - createFirebaseLink( - request?: protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IFirebaseLink, - protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest|undefined, {}|undefined - ]>; - createFirebaseLink( - request: protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IFirebaseLink, - protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest|null|undefined, - {}|null|undefined>): void; - createFirebaseLink( - request: protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IFirebaseLink, - protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest|null|undefined, - {}|null|undefined>): void; - createFirebaseLink( - request?: protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IFirebaseLink, - protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IFirebaseLink, - protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IFirebaseLink, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.delete_firebase_link.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteFirebaseLink_async - */ - deleteFirebaseLink( - request?: protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest|undefined, {}|undefined - ]>; - deleteFirebaseLink( - request: protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest|null|undefined, - {}|null|undefined>): void; - deleteFirebaseLink( - request: protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest|null|undefined, - {}|null|undefined>): void; - deleteFirebaseLink( - request?: protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteFirebaseLink(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.v1beta.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 {@link google.analytics.admin.v1beta.GoogleAdsLink | 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/v1beta/analytics_admin_service.create_google_ads_link.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateGoogleAdsLink_async - */ - createGoogleAdsLink( - request?: protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IGoogleAdsLink, - protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest|undefined, {}|undefined - ]>; - createGoogleAdsLink( - request: protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IGoogleAdsLink, - protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): void; - createGoogleAdsLink( - request: protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IGoogleAdsLink, - protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): void; - createGoogleAdsLink( - request?: protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IGoogleAdsLink, - protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IGoogleAdsLink, - protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IGoogleAdsLink, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.GoogleAdsLink | 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/v1beta/analytics_admin_service.update_google_ads_link.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateGoogleAdsLink_async - */ - updateGoogleAdsLink( - request?: protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IGoogleAdsLink, - protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest|undefined, {}|undefined - ]>; - updateGoogleAdsLink( - request: protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IGoogleAdsLink, - protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): void; - updateGoogleAdsLink( - request: protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IGoogleAdsLink, - protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): void; - updateGoogleAdsLink( - request?: protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IGoogleAdsLink, - protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IGoogleAdsLink, - protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IGoogleAdsLink, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.delete_google_ads_link.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteGoogleAdsLink_async - */ - deleteGoogleAdsLink( - request?: protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest|undefined, {}|undefined - ]>; - deleteGoogleAdsLink( - request: protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): void; - deleteGoogleAdsLink( - request: protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): void; - deleteGoogleAdsLink( - request?: protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.DataSharingSettings | 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/v1beta/analytics_admin_service.get_data_sharing_settings.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetDataSharingSettings_async - */ - getDataSharingSettings( - request?: protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IDataSharingSettings, - protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest|undefined, {}|undefined - ]>; - getDataSharingSettings( - request: protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IDataSharingSettings, - protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest|null|undefined, - {}|null|undefined>): void; - getDataSharingSettings( - request: protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IDataSharingSettings, - protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest|null|undefined, - {}|null|undefined>): void; - getDataSharingSettings( - request?: protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IDataSharingSettings, - protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IDataSharingSettings, - protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IDataSharingSettings, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.MeasurementProtocolSecret | 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/v1beta/analytics_admin_service.get_measurement_protocol_secret.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_async - */ - getMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest|undefined, {}|undefined - ]>; - getMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - getMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - getMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.MeasurementProtocolSecret | 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/v1beta/analytics_admin_service.create_measurement_protocol_secret.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateMeasurementProtocolSecret_async - */ - createMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest|undefined, {}|undefined - ]>; - createMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - createMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - createMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.delete_measurement_protocol_secret.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteMeasurementProtocolSecret_async - */ - deleteMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest|undefined, {}|undefined - ]>; - deleteMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - deleteMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - deleteMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.MeasurementProtocolSecret | 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/v1beta/analytics_admin_service.update_measurement_protocol_secret.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateMeasurementProtocolSecret_async - */ - updateMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest|undefined, {}|undefined - ]>; - updateMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - updateMeasurementProtocolSecret( - request: protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): void; - updateMeasurementProtocolSecret( - request?: protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 through 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 {@link google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse | 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/v1beta/analytics_admin_service.acknowledge_user_data_collection.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_AcknowledgeUserDataCollection_async - */ - acknowledgeUserDataCollection( - request?: protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse, - protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest|undefined, {}|undefined - ]>; - acknowledgeUserDataCollection( - request: protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse, - protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest|null|undefined, - {}|null|undefined>): void; - acknowledgeUserDataCollection( - request: protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse, - protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest|null|undefined, - {}|null|undefined>): void; - acknowledgeUserDataCollection( - request?: protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse, - protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse, - protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'property': request.property ?? '', - }); - this.initialize(); - return this.innerApiCalls.acknowledgeUserDataCollection(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.v1beta.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 {@link google.analytics.admin.v1beta.ConversionEvent | 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/v1beta/analytics_admin_service.create_conversion_event.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateConversionEvent_async - */ - createConversionEvent( - request?: protos.google.analytics.admin.v1beta.ICreateConversionEventRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IConversionEvent, - protos.google.analytics.admin.v1beta.ICreateConversionEventRequest|undefined, {}|undefined - ]>; - createConversionEvent( - request: protos.google.analytics.admin.v1beta.ICreateConversionEventRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IConversionEvent, - protos.google.analytics.admin.v1beta.ICreateConversionEventRequest|null|undefined, - {}|null|undefined>): void; - createConversionEvent( - request: protos.google.analytics.admin.v1beta.ICreateConversionEventRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IConversionEvent, - protos.google.analytics.admin.v1beta.ICreateConversionEventRequest|null|undefined, - {}|null|undefined>): void; - createConversionEvent( - request?: protos.google.analytics.admin.v1beta.ICreateConversionEventRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IConversionEvent, - protos.google.analytics.admin.v1beta.ICreateConversionEventRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IConversionEvent, - protos.google.analytics.admin.v1beta.ICreateConversionEventRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IConversionEvent, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.ConversionEvent | 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/v1beta/analytics_admin_service.get_conversion_event.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetConversionEvent_async - */ - getConversionEvent( - request?: protos.google.analytics.admin.v1beta.IGetConversionEventRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IConversionEvent, - protos.google.analytics.admin.v1beta.IGetConversionEventRequest|undefined, {}|undefined - ]>; - getConversionEvent( - request: protos.google.analytics.admin.v1beta.IGetConversionEventRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IConversionEvent, - protos.google.analytics.admin.v1beta.IGetConversionEventRequest|null|undefined, - {}|null|undefined>): void; - getConversionEvent( - request: protos.google.analytics.admin.v1beta.IGetConversionEventRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IConversionEvent, - protos.google.analytics.admin.v1beta.IGetConversionEventRequest|null|undefined, - {}|null|undefined>): void; - getConversionEvent( - request?: protos.google.analytics.admin.v1beta.IGetConversionEventRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IConversionEvent, - protos.google.analytics.admin.v1beta.IGetConversionEventRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IConversionEvent, - protos.google.analytics.admin.v1beta.IGetConversionEventRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IConversionEvent, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.delete_conversion_event.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteConversionEvent_async - */ - deleteConversionEvent( - request?: protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest|undefined, {}|undefined - ]>; - deleteConversionEvent( - request: protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest|null|undefined, - {}|null|undefined>): void; - deleteConversionEvent( - request: protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest|null|undefined, - {}|null|undefined>): void; - deleteConversionEvent( - request?: protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteConversionEvent(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.v1beta.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 {@link google.analytics.admin.v1beta.CustomDimension | 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/v1beta/analytics_admin_service.create_custom_dimension.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateCustomDimension_async - */ - createCustomDimension( - request?: protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest|undefined, {}|undefined - ]>; - createCustomDimension( - request: protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - createCustomDimension( - request: protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - createCustomDimension( - request?: protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.CustomDimension | 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/v1beta/analytics_admin_service.update_custom_dimension.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateCustomDimension_async - */ - updateCustomDimension( - request?: protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest|undefined, {}|undefined - ]>; - updateCustomDimension( - request: protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - updateCustomDimension( - request: protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - updateCustomDimension( - request?: protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.archive_custom_dimension.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ArchiveCustomDimension_async - */ - archiveCustomDimension( - request?: protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest|undefined, {}|undefined - ]>; - archiveCustomDimension( - request: protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - archiveCustomDimension( - request: protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - archiveCustomDimension( - request?: protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.CustomDimension | 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/v1beta/analytics_admin_service.get_custom_dimension.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetCustomDimension_async - */ - getCustomDimension( - request?: protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest|undefined, {}|undefined - ]>; - getCustomDimension( - request: protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - getCustomDimension( - request: protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest|null|undefined, - {}|null|undefined>): void; - getCustomDimension( - request?: protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomDimension, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.CustomMetric | 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/v1beta/analytics_admin_service.create_custom_metric.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateCustomMetric_async - */ - createCustomMetric( - request?: protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest|undefined, {}|undefined - ]>; - createCustomMetric( - request: protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - createCustomMetric( - request: protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - createCustomMetric( - request?: protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.CustomMetric | 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/v1beta/analytics_admin_service.update_custom_metric.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateCustomMetric_async - */ - updateCustomMetric( - request?: protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest|undefined, {}|undefined - ]>; - updateCustomMetric( - request: protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - updateCustomMetric( - request: protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - updateCustomMetric( - request?: protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.archive_custom_metric.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ArchiveCustomMetric_async - */ - archiveCustomMetric( - request?: protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest|undefined, {}|undefined - ]>; - archiveCustomMetric( - request: protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - archiveCustomMetric( - request: protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - archiveCustomMetric( - request?: protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.CustomMetric | 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/v1beta/analytics_admin_service.get_custom_metric.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetCustomMetric_async - */ - getCustomMetric( - request?: protos.google.analytics.admin.v1beta.IGetCustomMetricRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.IGetCustomMetricRequest|undefined, {}|undefined - ]>; - getCustomMetric( - request: protos.google.analytics.admin.v1beta.IGetCustomMetricRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.IGetCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - getCustomMetric( - request: protos.google.analytics.admin.v1beta.IGetCustomMetricRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.IGetCustomMetricRequest|null|undefined, - {}|null|undefined>): void; - getCustomMetric( - request?: protos.google.analytics.admin.v1beta.IGetCustomMetricRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.IGetCustomMetricRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.IGetCustomMetricRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomMetric, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.DataRetentionSettings | 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/v1beta/analytics_admin_service.get_data_retention_settings.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetDataRetentionSettings_async - */ - getDataRetentionSettings( - request?: protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IDataRetentionSettings, - protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest|undefined, {}|undefined - ]>; - getDataRetentionSettings( - request: protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IDataRetentionSettings, - protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>): void; - getDataRetentionSettings( - request: protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IDataRetentionSettings, - protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>): void; - getDataRetentionSettings( - request?: protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IDataRetentionSettings, - protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IDataRetentionSettings, - protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IDataRetentionSettings, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.DataRetentionSettings | 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/v1beta/analytics_admin_service.update_data_retention_settings.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateDataRetentionSettings_async - */ - updateDataRetentionSettings( - request?: protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IDataRetentionSettings, - protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest|undefined, {}|undefined - ]>; - updateDataRetentionSettings( - request: protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IDataRetentionSettings, - protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>): void; - updateDataRetentionSettings( - request: protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IDataRetentionSettings, - protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>): void; - updateDataRetentionSettings( - request?: protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IDataRetentionSettings, - protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IDataRetentionSettings, - protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IDataRetentionSettings, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.DataStream | 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/v1beta/analytics_admin_service.create_data_stream.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateDataStream_async - */ - createDataStream( - request?: protos.google.analytics.admin.v1beta.ICreateDataStreamRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.ICreateDataStreamRequest|undefined, {}|undefined - ]>; - createDataStream( - request: protos.google.analytics.admin.v1beta.ICreateDataStreamRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.ICreateDataStreamRequest|null|undefined, - {}|null|undefined>): void; - createDataStream( - request: protos.google.analytics.admin.v1beta.ICreateDataStreamRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.ICreateDataStreamRequest|null|undefined, - {}|null|undefined>): void; - createDataStream( - request?: protos.google.analytics.admin.v1beta.ICreateDataStreamRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.ICreateDataStreamRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.ICreateDataStreamRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.protobuf.Empty | 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/v1beta/analytics_admin_service.delete_data_stream.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteDataStream_async - */ - deleteDataStream( - request?: protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest|undefined, {}|undefined - ]>; - deleteDataStream( - request: protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest|null|undefined, - {}|null|undefined>): void; - deleteDataStream( - request: protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest|null|undefined, - {}|null|undefined>): void; - deleteDataStream( - request?: protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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.v1beta.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 {@link google.analytics.admin.v1beta.DataStream | 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/v1beta/analytics_admin_service.update_data_stream.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_UpdateDataStream_async - */ - updateDataStream( - request?: protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest|undefined, {}|undefined - ]>; - updateDataStream( - request: protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest|null|undefined, - {}|null|undefined>): void; - updateDataStream( - request: protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest|null|undefined, - {}|null|undefined>): void; - updateDataStream( - request?: protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.DataStream | 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/v1beta/analytics_admin_service.get_data_stream.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_GetDataStream_async - */ - getDataStream( - request?: protos.google.analytics.admin.v1beta.IGetDataStreamRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.IGetDataStreamRequest|undefined, {}|undefined - ]>; - getDataStream( - request: protos.google.analytics.admin.v1beta.IGetDataStreamRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.IGetDataStreamRequest|null|undefined, - {}|null|undefined>): void; - getDataStream( - request: protos.google.analytics.admin.v1beta.IGetDataStreamRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.IGetDataStreamRequest|null|undefined, - {}|null|undefined>): void; - getDataStream( - request?: protos.google.analytics.admin.v1beta.IGetDataStreamRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.IGetDataStreamRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.IGetDataStreamRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IDataStream, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getDataStream(request, options, callback); - } -/** - * Returns a customized report of data access records. The report provides - * records of each time a user reads Google Analytics reporting data. Access - * records are retained for up to 2 years. - * - * Data Access Reports can be requested for a property. The property must be - * in Google Analytics 360. This method is only available to Administrators. - * - * These data access records include GA4 UI Reporting, GA4 UI Explorations, - * GA4 Data API, and other products like Firebase & Admob that can retrieve - * data from Google Analytics through a linkage. These records don't include - * property configuration changes like adding a stream or changing a - * property's time zone. For configuration change history, see - * [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.entity - * The Data Access Report supports requesting at the property level or account - * level. If requested at the account level, Data Access Reports include all - * access for all properties under that account. - * - * To request at the property level, entity should be for example - * 'properties/123' if "123" is your GA4 property ID. To request at the - * account level, entity should be for example 'accounts/1234' if "1234" is - * your GA4 Account ID. - * @param {number[]} request.dimensions - * The dimensions requested and displayed in the response. Requests are - * allowed up to 9 dimensions. - * @param {number[]} request.metrics - * The metrics requested and displayed in the response. Requests are allowed - * up to 10 metrics. - * @param {number[]} request.dateRanges - * Date ranges of access records to read. If multiple date ranges are - * requested, each response row will contain a zero based date range index. If - * two date ranges overlap, the access records for the overlapping days is - * included in the response rows for both date ranges. Requests are allowed up - * to 2 date ranges. - * @param {google.analytics.admin.v1beta.AccessFilterExpression} request.dimensionFilter - * Dimension filters let you restrict report response to specific - * dimension values which match the filter. For example, filtering on access - * records of a single user. To learn more, see [Fundamentals of Dimension - * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) - * for examples. Metrics cannot be used in this filter. - * @param {google.analytics.admin.v1beta.AccessFilterExpression} request.metricFilter - * Metric filters allow you to restrict report response to specific metric - * values which match the filter. Metric filters are applied after aggregating - * the report's rows, similar to SQL having-clause. Dimensions cannot be used - * in this filter. - * @param {number} request.offset - * The row count of the start row. The first row is counted as row 0. If - * offset is unspecified, it is treated as 0. If offset is zero, then this - * method will return the first page of results with `limit` entries. - * - * To learn more about this pagination parameter, see - * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - * @param {number} request.limit - * The number of rows to return. If unspecified, 10,000 rows are returned. The - * API returns a maximum of 100,000 rows per request, no matter how many you - * ask for. `limit` must be positive. - * - * The API may return fewer rows than the requested `limit`, if there aren't - * as many remaining rows as the `limit`. For instance, there are fewer than - * 300 possible values for the dimension `country`, so when reporting on only - * `country`, you can't get more than 300 rows, even if you set `limit` to a - * higher value. - * - * To learn more about this pagination parameter, see - * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). - * @param {string} request.timeZone - * This request's time zone if specified. If unspecified, the property's time - * zone is used. The request's time zone is used to interpret the start & end - * dates of the report. - * - * Formatted as strings from the IANA Time Zone database - * (https://www.iana.org/time-zones); for example "America/New_York" or - * "Asia/Tokyo". - * @param {number[]} request.orderBys - * Specifies how rows are ordered in the response. - * @param {boolean} request.returnEntityQuota - * Toggles whether to return the current state of this Analytics Property's - * quota. Quota is returned in [AccessQuota](#AccessQuota). For account-level - * requests, this field must be false. - * @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 {@link google.analytics.admin.v1beta.RunAccessReportResponse | RunAccessReportResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta/analytics_admin_service.run_access_report.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_RunAccessReport_async - */ - runAccessReport( - request?: protos.google.analytics.admin.v1beta.IRunAccessReportRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IRunAccessReportResponse, - protos.google.analytics.admin.v1beta.IRunAccessReportRequest|undefined, {}|undefined - ]>; - runAccessReport( - request: protos.google.analytics.admin.v1beta.IRunAccessReportRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1beta.IRunAccessReportResponse, - protos.google.analytics.admin.v1beta.IRunAccessReportRequest|null|undefined, - {}|null|undefined>): void; - runAccessReport( - request: protos.google.analytics.admin.v1beta.IRunAccessReportRequest, - callback: Callback< - protos.google.analytics.admin.v1beta.IRunAccessReportResponse, - protos.google.analytics.admin.v1beta.IRunAccessReportRequest|null|undefined, - {}|null|undefined>): void; - runAccessReport( - request?: protos.google.analytics.admin.v1beta.IRunAccessReportRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1beta.IRunAccessReportResponse, - protos.google.analytics.admin.v1beta.IRunAccessReportRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1beta.IRunAccessReportResponse, - protos.google.analytics.admin.v1beta.IRunAccessReportRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1beta.IRunAccessReportResponse, - protos.google.analytics.admin.v1beta.IRunAccessReportRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'entity': request.entity ?? '', - }); - this.initialize(); - return this.innerApiCalls.runAccessReport(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 {@link google.analytics.admin.v1beta.Account | 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.v1beta.IListAccountsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IAccount[], - protos.google.analytics.admin.v1beta.IListAccountsRequest|null, - protos.google.analytics.admin.v1beta.IListAccountsResponse - ]>; - listAccounts( - request: protos.google.analytics.admin.v1beta.IListAccountsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListAccountsRequest, - protos.google.analytics.admin.v1beta.IListAccountsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IAccount>): void; - listAccounts( - request: protos.google.analytics.admin.v1beta.IListAccountsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListAccountsRequest, - protos.google.analytics.admin.v1beta.IListAccountsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IAccount>): void; - listAccounts( - request?: protos.google.analytics.admin.v1beta.IListAccountsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1beta.IListAccountsRequest, - protos.google.analytics.admin.v1beta.IListAccountsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IAccount>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1beta.IListAccountsRequest, - protos.google.analytics.admin.v1beta.IListAccountsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IAccount>): - Promise<[ - protos.google.analytics.admin.v1beta.IAccount[], - protos.google.analytics.admin.v1beta.IListAccountsRequest|null, - protos.google.analytics.admin.v1beta.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 {@link google.analytics.admin.v1beta.Account | 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.v1beta.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 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 - * {@link google.analytics.admin.v1beta.Account | 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/v1beta/analytics_admin_service.list_accounts.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListAccounts_async - */ - listAccountsAsync( - request?: protos.google.analytics.admin.v1beta.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 {}, - 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 {@link google.analytics.admin.v1beta.AccountSummary | 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.v1beta.IListAccountSummariesRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IAccountSummary[], - protos.google.analytics.admin.v1beta.IListAccountSummariesRequest|null, - protos.google.analytics.admin.v1beta.IListAccountSummariesResponse - ]>; - listAccountSummaries( - request: protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, - protos.google.analytics.admin.v1beta.IListAccountSummariesResponse|null|undefined, - protos.google.analytics.admin.v1beta.IAccountSummary>): void; - listAccountSummaries( - request: protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, - protos.google.analytics.admin.v1beta.IListAccountSummariesResponse|null|undefined, - protos.google.analytics.admin.v1beta.IAccountSummary>): void; - listAccountSummaries( - request?: protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, - protos.google.analytics.admin.v1beta.IListAccountSummariesResponse|null|undefined, - protos.google.analytics.admin.v1beta.IAccountSummary>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, - protos.google.analytics.admin.v1beta.IListAccountSummariesResponse|null|undefined, - protos.google.analytics.admin.v1beta.IAccountSummary>): - Promise<[ - protos.google.analytics.admin.v1beta.IAccountSummary[], - protos.google.analytics.admin.v1beta.IListAccountSummariesRequest|null, - protos.google.analytics.admin.v1beta.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 {@link google.analytics.admin.v1beta.AccountSummary | 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.v1beta.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 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 - * {@link google.analytics.admin.v1beta.AccountSummary | 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/v1beta/analytics_admin_service.list_account_summaries.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListAccountSummaries_async - */ - listAccountSummariesAsync( - request?: protos.google.analytics.admin.v1beta.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 {}, - 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 {@link google.analytics.admin.v1beta.Property | 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.v1beta.IListPropertiesRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IProperty[], - protos.google.analytics.admin.v1beta.IListPropertiesRequest|null, - protos.google.analytics.admin.v1beta.IListPropertiesResponse - ]>; - listProperties( - request: protos.google.analytics.admin.v1beta.IListPropertiesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListPropertiesRequest, - protos.google.analytics.admin.v1beta.IListPropertiesResponse|null|undefined, - protos.google.analytics.admin.v1beta.IProperty>): void; - listProperties( - request: protos.google.analytics.admin.v1beta.IListPropertiesRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListPropertiesRequest, - protos.google.analytics.admin.v1beta.IListPropertiesResponse|null|undefined, - protos.google.analytics.admin.v1beta.IProperty>): void; - listProperties( - request?: protos.google.analytics.admin.v1beta.IListPropertiesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1beta.IListPropertiesRequest, - protos.google.analytics.admin.v1beta.IListPropertiesResponse|null|undefined, - protos.google.analytics.admin.v1beta.IProperty>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1beta.IListPropertiesRequest, - protos.google.analytics.admin.v1beta.IListPropertiesResponse|null|undefined, - protos.google.analytics.admin.v1beta.IProperty>): - Promise<[ - protos.google.analytics.admin.v1beta.IProperty[], - protos.google.analytics.admin.v1beta.IListPropertiesRequest|null, - protos.google.analytics.admin.v1beta.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 {@link google.analytics.admin.v1beta.Property | 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.v1beta.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 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 - * {@link google.analytics.admin.v1beta.Property | 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/v1beta/analytics_admin_service.list_properties.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListProperties_async - */ - listPropertiesAsync( - request?: protos.google.analytics.admin.v1beta.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 {}, - 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 `ListFirebaseLinks` 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 {@link google.analytics.admin.v1beta.FirebaseLink | 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.v1beta.IListFirebaseLinksRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IFirebaseLink[], - protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest|null, - protos.google.analytics.admin.v1beta.IListFirebaseLinksResponse - ]>; - listFirebaseLinks( - request: protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, - protos.google.analytics.admin.v1beta.IListFirebaseLinksResponse|null|undefined, - protos.google.analytics.admin.v1beta.IFirebaseLink>): void; - listFirebaseLinks( - request: protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, - protos.google.analytics.admin.v1beta.IListFirebaseLinksResponse|null|undefined, - protos.google.analytics.admin.v1beta.IFirebaseLink>): void; - listFirebaseLinks( - request?: protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, - protos.google.analytics.admin.v1beta.IListFirebaseLinksResponse|null|undefined, - protos.google.analytics.admin.v1beta.IFirebaseLink>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, - protos.google.analytics.admin.v1beta.IListFirebaseLinksResponse|null|undefined, - protos.google.analytics.admin.v1beta.IFirebaseLink>): - Promise<[ - protos.google.analytics.admin.v1beta.IFirebaseLink[], - protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest|null, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 `ListFirebaseLinks` 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 {@link google.analytics.admin.v1beta.FirebaseLink | 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.v1beta.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' - ] = this._gaxModule.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 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 `ListFirebaseLinks` 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 - * {@link google.analytics.admin.v1beta.FirebaseLink | 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/v1beta/analytics_admin_service.list_firebase_links.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListFirebaseLinks_async - */ - listFirebaseLinksAsync( - request?: protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1beta.GoogleAdsLink | 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.v1beta.IListGoogleAdsLinksRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IGoogleAdsLink[], - protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest|null, - protos.google.analytics.admin.v1beta.IListGoogleAdsLinksResponse - ]>; - listGoogleAdsLinks( - request: protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, - protos.google.analytics.admin.v1beta.IListGoogleAdsLinksResponse|null|undefined, - protos.google.analytics.admin.v1beta.IGoogleAdsLink>): void; - listGoogleAdsLinks( - request: protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, - protos.google.analytics.admin.v1beta.IListGoogleAdsLinksResponse|null|undefined, - protos.google.analytics.admin.v1beta.IGoogleAdsLink>): void; - listGoogleAdsLinks( - request?: protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, - protos.google.analytics.admin.v1beta.IListGoogleAdsLinksResponse|null|undefined, - protos.google.analytics.admin.v1beta.IGoogleAdsLink>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, - protos.google.analytics.admin.v1beta.IListGoogleAdsLinksResponse|null|undefined, - protos.google.analytics.admin.v1beta.IGoogleAdsLink>): - Promise<[ - protos.google.analytics.admin.v1beta.IGoogleAdsLink[], - protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest|null, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.GoogleAdsLink | 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.v1beta.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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1beta.GoogleAdsLink | 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/v1beta/analytics_admin_service.list_google_ads_links.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListGoogleAdsLinks_async - */ - listGoogleAdsLinksAsync( - request?: protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1beta.MeasurementProtocolSecret | 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.v1beta.IListMeasurementProtocolSecretsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret[], - protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest|null, - protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsResponse - ]>; - listMeasurementProtocolSecrets( - request: protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, - protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret>): void; - listMeasurementProtocolSecrets( - request: protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, - protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret>): void; - listMeasurementProtocolSecrets( - request?: protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, - protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, - protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret>): - Promise<[ - protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret[], - protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest|null, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.MeasurementProtocolSecret | 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.v1beta.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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1beta.MeasurementProtocolSecret | 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/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_async - */ - listMeasurementProtocolSecretsAsync( - request?: protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1beta.ChangeHistoryEvent | 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.v1beta.ISearchChangeHistoryEventsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IChangeHistoryEvent[], - protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest|null, - protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsResponse - ]>; - searchChangeHistoryEvents( - request: protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, - protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IChangeHistoryEvent>): void; - searchChangeHistoryEvents( - request: protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, - protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IChangeHistoryEvent>): void; - searchChangeHistoryEvents( - request?: protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, - protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IChangeHistoryEvent>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, - protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IChangeHistoryEvent>): - Promise<[ - protos.google.analytics.admin.v1beta.IChangeHistoryEvent[], - protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest|null, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.ChangeHistoryEvent | 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.v1beta.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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1beta.ChangeHistoryEvent | 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/v1beta/analytics_admin_service.search_change_history_events.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_SearchChangeHistoryEvents_async - */ - searchChangeHistoryEventsAsync( - request?: protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1beta.ConversionEvent | 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.v1beta.IListConversionEventsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IConversionEvent[], - protos.google.analytics.admin.v1beta.IListConversionEventsRequest|null, - protos.google.analytics.admin.v1beta.IListConversionEventsResponse - ]>; - listConversionEvents( - request: protos.google.analytics.admin.v1beta.IListConversionEventsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListConversionEventsRequest, - protos.google.analytics.admin.v1beta.IListConversionEventsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IConversionEvent>): void; - listConversionEvents( - request: protos.google.analytics.admin.v1beta.IListConversionEventsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListConversionEventsRequest, - protos.google.analytics.admin.v1beta.IListConversionEventsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IConversionEvent>): void; - listConversionEvents( - request?: protos.google.analytics.admin.v1beta.IListConversionEventsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1beta.IListConversionEventsRequest, - protos.google.analytics.admin.v1beta.IListConversionEventsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IConversionEvent>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1beta.IListConversionEventsRequest, - protos.google.analytics.admin.v1beta.IListConversionEventsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IConversionEvent>): - Promise<[ - protos.google.analytics.admin.v1beta.IConversionEvent[], - protos.google.analytics.admin.v1beta.IListConversionEventsRequest|null, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.ConversionEvent | 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.v1beta.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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1beta.ConversionEvent | 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/v1beta/analytics_admin_service.list_conversion_events.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListConversionEvents_async - */ - listConversionEventsAsync( - request?: protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1beta.CustomDimension | 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.v1beta.IListCustomDimensionsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomDimension[], - protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest|null, - protos.google.analytics.admin.v1beta.IListCustomDimensionsResponse - ]>; - listCustomDimensions( - request: protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, - protos.google.analytics.admin.v1beta.IListCustomDimensionsResponse|null|undefined, - protos.google.analytics.admin.v1beta.ICustomDimension>): void; - listCustomDimensions( - request: protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, - protos.google.analytics.admin.v1beta.IListCustomDimensionsResponse|null|undefined, - protos.google.analytics.admin.v1beta.ICustomDimension>): void; - listCustomDimensions( - request?: protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, - protos.google.analytics.admin.v1beta.IListCustomDimensionsResponse|null|undefined, - protos.google.analytics.admin.v1beta.ICustomDimension>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, - protos.google.analytics.admin.v1beta.IListCustomDimensionsResponse|null|undefined, - protos.google.analytics.admin.v1beta.ICustomDimension>): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomDimension[], - protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest|null, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.CustomDimension | 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.v1beta.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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1beta.CustomDimension | 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/v1beta/analytics_admin_service.list_custom_dimensions.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListCustomDimensions_async - */ - listCustomDimensionsAsync( - request?: protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1beta.CustomMetric | 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.v1beta.IListCustomMetricsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomMetric[], - protos.google.analytics.admin.v1beta.IListCustomMetricsRequest|null, - protos.google.analytics.admin.v1beta.IListCustomMetricsResponse - ]>; - listCustomMetrics( - request: protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, - protos.google.analytics.admin.v1beta.IListCustomMetricsResponse|null|undefined, - protos.google.analytics.admin.v1beta.ICustomMetric>): void; - listCustomMetrics( - request: protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, - protos.google.analytics.admin.v1beta.IListCustomMetricsResponse|null|undefined, - protos.google.analytics.admin.v1beta.ICustomMetric>): void; - listCustomMetrics( - request?: protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, - protos.google.analytics.admin.v1beta.IListCustomMetricsResponse|null|undefined, - protos.google.analytics.admin.v1beta.ICustomMetric>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, - protos.google.analytics.admin.v1beta.IListCustomMetricsResponse|null|undefined, - protos.google.analytics.admin.v1beta.ICustomMetric>): - Promise<[ - protos.google.analytics.admin.v1beta.ICustomMetric[], - protos.google.analytics.admin.v1beta.IListCustomMetricsRequest|null, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.CustomMetric | 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.v1beta.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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1beta.CustomMetric | 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/v1beta/analytics_admin_service.list_custom_metrics.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListCustomMetrics_async - */ - listCustomMetricsAsync( - request?: protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {}, - 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 {@link google.analytics.admin.v1beta.DataStream | 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.v1beta.IListDataStreamsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1beta.IDataStream[], - protos.google.analytics.admin.v1beta.IListDataStreamsRequest|null, - protos.google.analytics.admin.v1beta.IListDataStreamsResponse - ]>; - listDataStreams( - request: protos.google.analytics.admin.v1beta.IListDataStreamsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListDataStreamsRequest, - protos.google.analytics.admin.v1beta.IListDataStreamsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IDataStream>): void; - listDataStreams( - request: protos.google.analytics.admin.v1beta.IListDataStreamsRequest, - callback: PaginationCallback< - protos.google.analytics.admin.v1beta.IListDataStreamsRequest, - protos.google.analytics.admin.v1beta.IListDataStreamsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IDataStream>): void; - listDataStreams( - request?: protos.google.analytics.admin.v1beta.IListDataStreamsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.analytics.admin.v1beta.IListDataStreamsRequest, - protos.google.analytics.admin.v1beta.IListDataStreamsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IDataStream>, - callback?: PaginationCallback< - protos.google.analytics.admin.v1beta.IListDataStreamsRequest, - protos.google.analytics.admin.v1beta.IListDataStreamsResponse|null|undefined, - protos.google.analytics.admin.v1beta.IDataStream>): - Promise<[ - protos.google.analytics.admin.v1beta.IDataStream[], - protos.google.analytics.admin.v1beta.IListDataStreamsRequest|null, - protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {@link google.analytics.admin.v1beta.DataStream | 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.v1beta.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' - ] = this._gaxModule.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 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 - * {@link google.analytics.admin.v1beta.DataStream | 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/v1beta/analytics_admin_service.list_data_streams.js - * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_ListDataStreams_async - */ - listDataStreamsAsync( - request?: protos.google.analytics.admin.v1beta.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' - ] = this._gaxModule.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 {}, - 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 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 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 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 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; - } - - /** - * 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/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client_config.json b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client_config.json deleted file mode 100644 index aabd0a6eb1e..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_client_config.json +++ /dev/null @@ -1,279 +0,0 @@ -{ - "interfaces": { - "google.analytics.admin.v1beta.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" - }, - "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" - }, - "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" - }, - "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" - }, - "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" - }, - "RunAccessReport": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - } - } - } - } -} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_proto_list.json b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_proto_list.json deleted file mode 100644 index 95cd6a5fee5..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/analytics_admin_service_proto_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "../../protos/google/analytics/admin/v1beta/access_report.proto", - "../../protos/google/analytics/admin/v1beta/analytics_admin.proto", - "../../protos/google/analytics/admin/v1beta/resources.proto" -] diff --git a/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/gapic_metadata.json b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/gapic_metadata.json deleted file mode 100644 index 5c694601ea0..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/gapic_metadata.json +++ /dev/null @@ -1,547 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.analytics.admin.v1beta", - "libraryPackage": "@google-cloud/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" - ] - }, - "CreateFirebaseLink": { - "methods": [ - "createFirebaseLink" - ] - }, - "DeleteFirebaseLink": { - "methods": [ - "deleteFirebaseLink" - ] - }, - "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" - ] - }, - "CreateConversionEvent": { - "methods": [ - "createConversionEvent" - ] - }, - "GetConversionEvent": { - "methods": [ - "getConversionEvent" - ] - }, - "DeleteConversionEvent": { - "methods": [ - "deleteConversionEvent" - ] - }, - "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" - ] - }, - "RunAccessReport": { - "methods": [ - "runAccessReport" - ] - }, - "ListAccounts": { - "methods": [ - "listAccounts", - "listAccountsStream", - "listAccountsAsync" - ] - }, - "ListAccountSummaries": { - "methods": [ - "listAccountSummaries", - "listAccountSummariesStream", - "listAccountSummariesAsync" - ] - }, - "ListProperties": { - "methods": [ - "listProperties", - "listPropertiesStream", - "listPropertiesAsync" - ] - }, - "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" - ] - }, - "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" - ] - }, - "CreateFirebaseLink": { - "methods": [ - "createFirebaseLink" - ] - }, - "DeleteFirebaseLink": { - "methods": [ - "deleteFirebaseLink" - ] - }, - "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" - ] - }, - "CreateConversionEvent": { - "methods": [ - "createConversionEvent" - ] - }, - "GetConversionEvent": { - "methods": [ - "getConversionEvent" - ] - }, - "DeleteConversionEvent": { - "methods": [ - "deleteConversionEvent" - ] - }, - "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" - ] - }, - "RunAccessReport": { - "methods": [ - "runAccessReport" - ] - }, - "ListAccounts": { - "methods": [ - "listAccounts", - "listAccountsStream", - "listAccountsAsync" - ] - }, - "ListAccountSummaries": { - "methods": [ - "listAccountSummaries", - "listAccountSummariesStream", - "listAccountSummariesAsync" - ] - }, - "ListProperties": { - "methods": [ - "listProperties", - "listPropertiesStream", - "listPropertiesAsync" - ] - }, - "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" - ] - }, - "ListCustomDimensions": { - "methods": [ - "listCustomDimensions", - "listCustomDimensionsStream", - "listCustomDimensionsAsync" - ] - }, - "ListCustomMetrics": { - "methods": [ - "listCustomMetrics", - "listCustomMetricsStream", - "listCustomMetricsAsync" - ] - }, - "ListDataStreams": { - "methods": [ - "listDataStreams", - "listDataStreamsStream", - "listDataStreamsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/index.ts b/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/index.ts deleted file mode 100644 index f0f311d4088..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/src/v1beta/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2023 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/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 3d1ef8d9342..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2023 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-cloud/admin'); - -function main() { - const analyticsAdminServiceClient = new admin.AnalyticsAdminServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 5b3ec35c38f..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2023 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-cloud/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/google-analytics-admin/v1beta/system-test/install.ts b/owl-bot-staging/google-analytics-admin/v1beta/system-test/install.ts deleted file mode 100644 index c8f81b25a86..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 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/google-analytics-admin/v1beta/test/gapic_analytics_admin_service_v1beta.ts b/owl-bot-staging/google-analytics-admin/v1beta/test/gapic_analytics_admin_service_v1beta.ts deleted file mode 100644 index 7377b008d2a..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/test/gapic_analytics_admin_service_v1beta.ts +++ /dev/null @@ -1,7071 +0,0 @@ -// Copyright 2023 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'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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('v1beta.AnalyticsAdminServiceClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new analyticsadminserviceModule.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.Account() - ); - client.innerApiCalls.getAccount = stubSimpleCall(expectedResponse); - const [response] = await client.getAccount(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAccount without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.Account() - ); - client.innerApiCalls.getAccount = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAccount( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IAccount|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAccount with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAccount(request), expectedError); - const actualRequest = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAccount with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetAccountRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAccount = stubSimpleCall(expectedResponse); - const [response] = await client.deleteAccount(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAccount without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAccount with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteAccount(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAccount with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteAccountRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateAccountRequest() - ); - request.account ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateAccountRequest', ['account', 'name']); - request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.Account() - ); - client.innerApiCalls.updateAccount = stubSimpleCall(expectedResponse); - const [response] = await client.updateAccount(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAccount without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateAccountRequest() - ); - request.account ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateAccountRequest', ['account', 'name']); - request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.Account() - ); - client.innerApiCalls.updateAccount = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateAccount( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IAccount|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAccount with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateAccountRequest() - ); - request.account ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateAccountRequest', ['account', 'name']); - request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateAccount(request), expectedError); - const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAccount with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateAccountRequest() - ); - request.account ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateAccountRequest', ['account', 'name']); - request.account.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ProvisionAccountTicketRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ProvisionAccountTicketResponse() - ); - client.innerApiCalls.provisionAccountTicket = stubSimpleCall(expectedResponse); - const [response] = await client.provisionAccountTicket(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes provisionAccountTicket without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ProvisionAccountTicketRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ProvisionAccountTicketResponse() - ); - client.innerApiCalls.provisionAccountTicket = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.provisionAccountTicket( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes provisionAccountTicket with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ProvisionAccountTicketRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.provisionAccountTicket = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.provisionAccountTicket(request), expectedError); - }); - - it('invokes provisionAccountTicket with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetPropertyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetPropertyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.Property() - ); - client.innerApiCalls.getProperty = stubSimpleCall(expectedResponse); - const [response] = await client.getProperty(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProperty without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetPropertyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetPropertyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.Property() - ); - client.innerApiCalls.getProperty = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getProperty( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IProperty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProperty with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetPropertyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetPropertyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getProperty = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getProperty(request), expectedError); - const actualRequest = (client.innerApiCalls.getProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProperty with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetPropertyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetPropertyRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreatePropertyRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.Property() - ); - client.innerApiCalls.createProperty = stubSimpleCall(expectedResponse); - const [response] = await client.createProperty(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes createProperty without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreatePropertyRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.Property() - ); - client.innerApiCalls.createProperty = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createProperty( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IProperty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes createProperty with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreatePropertyRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.createProperty = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createProperty(request), expectedError); - }); - - it('invokes createProperty with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeletePropertyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeletePropertyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.Property() - ); - client.innerApiCalls.deleteProperty = stubSimpleCall(expectedResponse); - const [response] = await client.deleteProperty(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProperty without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeletePropertyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeletePropertyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.Property() - ); - client.innerApiCalls.deleteProperty = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteProperty( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IProperty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProperty with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeletePropertyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeletePropertyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteProperty = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteProperty(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProperty with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeletePropertyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeletePropertyRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdatePropertyRequest() - ); - request.property ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdatePropertyRequest', ['property', 'name']); - request.property.name = defaultValue1; - const expectedHeaderRequestParams = `property.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.Property() - ); - client.innerApiCalls.updateProperty = stubSimpleCall(expectedResponse); - const [response] = await client.updateProperty(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateProperty without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdatePropertyRequest() - ); - request.property ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdatePropertyRequest', ['property', 'name']); - request.property.name = defaultValue1; - const expectedHeaderRequestParams = `property.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.Property() - ); - client.innerApiCalls.updateProperty = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateProperty( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IProperty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateProperty with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdatePropertyRequest() - ); - request.property ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdatePropertyRequest', ['property', 'name']); - request.property.name = defaultValue1; - const expectedHeaderRequestParams = `property.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateProperty = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateProperty(request), expectedError); - const actualRequest = (client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateProperty as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateProperty with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdatePropertyRequest() - ); - request.property ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdatePropertyRequest', ['property', 'name']); - request.property.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateProperty(request), expectedError); - }); - }); - - describe('createFirebaseLink', () => { - it('invokes createFirebaseLink without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateFirebaseLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateFirebaseLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.FirebaseLink() - ); - client.innerApiCalls.createFirebaseLink = stubSimpleCall(expectedResponse); - const [response] = await client.createFirebaseLink(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createFirebaseLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateFirebaseLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateFirebaseLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.FirebaseLink() - ); - client.innerApiCalls.createFirebaseLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createFirebaseLink( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IFirebaseLink|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createFirebaseLink with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateFirebaseLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateFirebaseLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createFirebaseLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createFirebaseLink(request), expectedError); - const actualRequest = (client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFirebaseLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createFirebaseLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateFirebaseLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateFirebaseLinkRequest', ['parent']); - request.parent = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteFirebaseLink = stubSimpleCall(expectedResponse); - const [response] = await client.deleteFirebaseLink(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteFirebaseLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteFirebaseLink with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFirebaseLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteFirebaseLink(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFirebaseLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteFirebaseLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteFirebaseLink(request), expectedError); - }); - }); - - describe('createGoogleAdsLink', () => { - it('invokes createGoogleAdsLink without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GoogleAdsLink() - ); - client.innerApiCalls.createGoogleAdsLink = stubSimpleCall(expectedResponse); - const [response] = await client.createGoogleAdsLink(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createGoogleAdsLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GoogleAdsLink() - ); - client.innerApiCalls.createGoogleAdsLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createGoogleAdsLink( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IGoogleAdsLink|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createGoogleAdsLink with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createGoogleAdsLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createGoogleAdsLink(request), expectedError); - const actualRequest = (client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createGoogleAdsLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest', ['parent']); - request.parent = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest() - ); - request.googleAdsLink ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); - request.googleAdsLink.name = defaultValue1; - const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GoogleAdsLink() - ); - client.innerApiCalls.updateGoogleAdsLink = stubSimpleCall(expectedResponse); - const [response] = await client.updateGoogleAdsLink(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateGoogleAdsLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest() - ); - request.googleAdsLink ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); - request.googleAdsLink.name = defaultValue1; - const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GoogleAdsLink() - ); - client.innerApiCalls.updateGoogleAdsLink = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateGoogleAdsLink( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IGoogleAdsLink|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateGoogleAdsLink with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest() - ); - request.googleAdsLink ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); - request.googleAdsLink.name = defaultValue1; - const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateGoogleAdsLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateGoogleAdsLink(request), expectedError); - const actualRequest = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateGoogleAdsLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest() - ); - request.googleAdsLink ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest', ['googleAdsLink', 'name']); - request.googleAdsLink.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCall(expectedResponse); - const [response] = await client.deleteGoogleAdsLink(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteGoogleAdsLink without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteGoogleAdsLink with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteGoogleAdsLink(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteGoogleAdsLink as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteGoogleAdsLink with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetDataSharingSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataSharingSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DataSharingSettings() - ); - client.innerApiCalls.getDataSharingSettings = stubSimpleCall(expectedResponse); - const [response] = await client.getDataSharingSettings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataSharingSettings without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetDataSharingSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataSharingSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DataSharingSettings() - ); - client.innerApiCalls.getDataSharingSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDataSharingSettings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IDataSharingSettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataSharingSettings with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetDataSharingSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataSharingSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataSharingSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataSharingSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataSharingSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataSharingSettings with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetDataSharingSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataSharingSettingsRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() - ); - client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCall(expectedResponse); - const [response] = await client.getMeasurementProtocolSecret(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getMeasurementProtocolSecret without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() - ); - client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getMeasurementProtocolSecret( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getMeasurementProtocolSecret with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getMeasurementProtocolSecret(request), expectedError); - const actualRequest = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getMeasurementProtocolSecret with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() - ); - client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCall(expectedResponse); - const [response] = await client.createMeasurementProtocolSecret(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createMeasurementProtocolSecret without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() - ); - client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createMeasurementProtocolSecret( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createMeasurementProtocolSecret with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createMeasurementProtocolSecret(request), expectedError); - const actualRequest = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createMeasurementProtocolSecret with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest', ['parent']); - request.parent = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCall(expectedResponse); - const [response] = await client.deleteMeasurementProtocolSecret(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteMeasurementProtocolSecret without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteMeasurementProtocolSecret with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteMeasurementProtocolSecret(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteMeasurementProtocolSecret with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest() - ); - request.measurementProtocolSecret ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); - request.measurementProtocolSecret.name = defaultValue1; - const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() - ); - client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCall(expectedResponse); - const [response] = await client.updateMeasurementProtocolSecret(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMeasurementProtocolSecret without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest() - ); - request.measurementProtocolSecret ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); - request.measurementProtocolSecret.name = defaultValue1; - const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() - ); - client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateMeasurementProtocolSecret( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMeasurementProtocolSecret with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest() - ); - request.measurementProtocolSecret ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); - request.measurementProtocolSecret.name = defaultValue1; - const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateMeasurementProtocolSecret(request), expectedError); - const actualRequest = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMeasurementProtocolSecret as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMeasurementProtocolSecret with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest() - ); - request.measurementProtocolSecret ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest', ['measurementProtocolSecret', 'name']); - request.measurementProtocolSecret.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest', ['property']); - request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse() - ); - client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCall(expectedResponse); - const [response] = await client.acknowledgeUserDataCollection(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes acknowledgeUserDataCollection without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest', ['property']); - request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse() - ); - client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.acknowledgeUserDataCollection( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes acknowledgeUserDataCollection with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest', ['property']); - request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.acknowledgeUserDataCollection(request), expectedError); - const actualRequest = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.acknowledgeUserDataCollection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes acknowledgeUserDataCollection with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest', ['property']); - request.property = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.acknowledgeUserDataCollection(request), expectedError); - }); - }); - - describe('createConversionEvent', () => { - it('invokes createConversionEvent without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateConversionEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateConversionEventRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ConversionEvent() - ); - client.innerApiCalls.createConversionEvent = stubSimpleCall(expectedResponse); - const [response] = await client.createConversionEvent(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createConversionEvent without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateConversionEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateConversionEventRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ConversionEvent() - ); - client.innerApiCalls.createConversionEvent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createConversionEvent( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IConversionEvent|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createConversionEvent with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateConversionEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateConversionEventRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createConversionEvent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createConversionEvent(request), expectedError); - const actualRequest = (client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createConversionEvent with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateConversionEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateConversionEventRequest', ['parent']); - request.parent = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetConversionEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetConversionEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ConversionEvent() - ); - client.innerApiCalls.getConversionEvent = stubSimpleCall(expectedResponse); - const [response] = await client.getConversionEvent(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConversionEvent without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetConversionEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetConversionEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ConversionEvent() - ); - client.innerApiCalls.getConversionEvent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getConversionEvent( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IConversionEvent|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConversionEvent with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetConversionEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetConversionEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getConversionEvent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getConversionEvent(request), expectedError); - const actualRequest = (client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConversionEvent with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetConversionEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetConversionEventRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteConversionEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteConversionEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteConversionEvent = stubSimpleCall(expectedResponse); - const [response] = await client.deleteConversionEvent(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConversionEvent without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteConversionEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteConversionEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConversionEvent with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteConversionEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteConversionEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteConversionEvent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteConversionEvent(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConversionEvent with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteConversionEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteConversionEventRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteConversionEvent(request), expectedError); - }); - }); - - describe('createCustomDimension', () => { - it('invokes createCustomDimension without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateCustomDimensionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomDimensionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CustomDimension() - ); - client.innerApiCalls.createCustomDimension = stubSimpleCall(expectedResponse); - const [response] = await client.createCustomDimension(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCustomDimension without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateCustomDimensionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomDimensionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CustomDimension() - ); - client.innerApiCalls.createCustomDimension = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCustomDimension( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomDimension|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCustomDimension with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateCustomDimensionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomDimensionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCustomDimension = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCustomDimension(request), expectedError); - const actualRequest = (client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCustomDimension with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateCustomDimensionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomDimensionRequest', ['parent']); - request.parent = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateCustomDimensionRequest() - ); - request.customDimension ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomDimensionRequest', ['customDimension', 'name']); - request.customDimension.name = defaultValue1; - const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CustomDimension() - ); - client.innerApiCalls.updateCustomDimension = stubSimpleCall(expectedResponse); - const [response] = await client.updateCustomDimension(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCustomDimension without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateCustomDimensionRequest() - ); - request.customDimension ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomDimensionRequest', ['customDimension', 'name']); - request.customDimension.name = defaultValue1; - const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CustomDimension() - ); - client.innerApiCalls.updateCustomDimension = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCustomDimension( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomDimension|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCustomDimension with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateCustomDimensionRequest() - ); - request.customDimension ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomDimensionRequest', ['customDimension', 'name']); - request.customDimension.name = defaultValue1; - const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCustomDimension = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateCustomDimension(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCustomDimension with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateCustomDimensionRequest() - ); - request.customDimension ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomDimensionRequest', ['customDimension', 'name']); - request.customDimension.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.archiveCustomDimension = stubSimpleCall(expectedResponse); - const [response] = await client.archiveCustomDimension(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes archiveCustomDimension without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes archiveCustomDimension with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.archiveCustomDimension = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.archiveCustomDimension(request), expectedError); - const actualRequest = (client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes archiveCustomDimension with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetCustomDimensionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomDimensionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CustomDimension() - ); - client.innerApiCalls.getCustomDimension = stubSimpleCall(expectedResponse); - const [response] = await client.getCustomDimension(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCustomDimension without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetCustomDimensionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomDimensionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CustomDimension() - ); - client.innerApiCalls.getCustomDimension = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCustomDimension( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomDimension|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCustomDimension with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetCustomDimensionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomDimensionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCustomDimension = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCustomDimension(request), expectedError); - const actualRequest = (client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomDimension as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCustomDimension with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetCustomDimensionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomDimensionRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateCustomMetricRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomMetricRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CustomMetric() - ); - client.innerApiCalls.createCustomMetric = stubSimpleCall(expectedResponse); - const [response] = await client.createCustomMetric(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCustomMetric without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateCustomMetricRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomMetricRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CustomMetric() - ); - client.innerApiCalls.createCustomMetric = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCustomMetric( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomMetric|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCustomMetric with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateCustomMetricRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomMetricRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCustomMetric = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCustomMetric(request), expectedError); - const actualRequest = (client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCustomMetric with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateCustomMetricRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateCustomMetricRequest', ['parent']); - request.parent = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateCustomMetricRequest() - ); - request.customMetric ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomMetricRequest', ['customMetric', 'name']); - request.customMetric.name = defaultValue1; - const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CustomMetric() - ); - client.innerApiCalls.updateCustomMetric = stubSimpleCall(expectedResponse); - const [response] = await client.updateCustomMetric(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCustomMetric without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateCustomMetricRequest() - ); - request.customMetric ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomMetricRequest', ['customMetric', 'name']); - request.customMetric.name = defaultValue1; - const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CustomMetric() - ); - client.innerApiCalls.updateCustomMetric = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCustomMetric( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomMetric|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCustomMetric with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateCustomMetricRequest() - ); - request.customMetric ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomMetricRequest', ['customMetric', 'name']); - request.customMetric.name = defaultValue1; - const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCustomMetric = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateCustomMetric(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCustomMetric with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateCustomMetricRequest() - ); - request.customMetric ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateCustomMetricRequest', ['customMetric', 'name']); - request.customMetric.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ArchiveCustomMetricRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomMetricRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.archiveCustomMetric = stubSimpleCall(expectedResponse); - const [response] = await client.archiveCustomMetric(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes archiveCustomMetric without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ArchiveCustomMetricRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomMetricRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes archiveCustomMetric with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ArchiveCustomMetricRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomMetricRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.archiveCustomMetric = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.archiveCustomMetric(request), expectedError); - const actualRequest = (client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.archiveCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes archiveCustomMetric with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ArchiveCustomMetricRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ArchiveCustomMetricRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetCustomMetricRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomMetricRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CustomMetric() - ); - client.innerApiCalls.getCustomMetric = stubSimpleCall(expectedResponse); - const [response] = await client.getCustomMetric(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCustomMetric without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetCustomMetricRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomMetricRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CustomMetric() - ); - client.innerApiCalls.getCustomMetric = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCustomMetric( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomMetric|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCustomMetric with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetCustomMetricRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomMetricRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCustomMetric = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCustomMetric(request), expectedError); - const actualRequest = (client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomMetric as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCustomMetric with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetCustomMetricRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetCustomMetricRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DataRetentionSettings() - ); - client.innerApiCalls.getDataRetentionSettings = stubSimpleCall(expectedResponse); - const [response] = await client.getDataRetentionSettings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataRetentionSettings without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DataRetentionSettings() - ); - client.innerApiCalls.getDataRetentionSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDataRetentionSettings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IDataRetentionSettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataRetentionSettings with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataRetentionSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataRetentionSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataRetentionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataRetentionSettings with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest() - ); - request.dataRetentionSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); - request.dataRetentionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DataRetentionSettings() - ); - client.innerApiCalls.updateDataRetentionSettings = stubSimpleCall(expectedResponse); - const [response] = await client.updateDataRetentionSettings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDataRetentionSettings without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest() - ); - request.dataRetentionSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); - request.dataRetentionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DataRetentionSettings() - ); - client.innerApiCalls.updateDataRetentionSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDataRetentionSettings( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IDataRetentionSettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDataRetentionSettings with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest() - ); - request.dataRetentionSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); - request.dataRetentionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataRetentionSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDataRetentionSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataRetentionSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDataRetentionSettings with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest() - ); - request.dataRetentionSettings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest', ['dataRetentionSettings', 'name']); - request.dataRetentionSettings.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateDataStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateDataStreamRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DataStream() - ); - client.innerApiCalls.createDataStream = stubSimpleCall(expectedResponse); - const [response] = await client.createDataStream(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDataStream without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateDataStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateDataStreamRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DataStream() - ); - client.innerApiCalls.createDataStream = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDataStream( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IDataStream|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDataStream with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateDataStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateDataStreamRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataStream = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDataStream(request), expectedError); - const actualRequest = (client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDataStream with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.CreateDataStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.CreateDataStreamRequest', ['parent']); - request.parent = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteDataStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteDataStreamRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDataStream = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDataStream(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDataStream without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteDataStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteDataStreamRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDataStream with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteDataStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteDataStreamRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataStream = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDataStream(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDataStream with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DeleteDataStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.DeleteDataStreamRequest', ['name']); - request.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateDataStreamRequest() - ); - request.dataStream ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataStreamRequest', ['dataStream', 'name']); - request.dataStream.name = defaultValue1; - const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DataStream() - ); - client.innerApiCalls.updateDataStream = stubSimpleCall(expectedResponse); - const [response] = await client.updateDataStream(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDataStream without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateDataStreamRequest() - ); - request.dataStream ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataStreamRequest', ['dataStream', 'name']); - request.dataStream.name = defaultValue1; - const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DataStream() - ); - client.innerApiCalls.updateDataStream = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDataStream( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IDataStream|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDataStream with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateDataStreamRequest() - ); - request.dataStream ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataStreamRequest', ['dataStream', 'name']); - request.dataStream.name = defaultValue1; - const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataStream = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDataStream(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDataStream with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.UpdateDataStreamRequest() - ); - request.dataStream ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.UpdateDataStreamRequest', ['dataStream', 'name']); - request.dataStream.name = defaultValue1; - 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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetDataStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataStreamRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DataStream() - ); - client.innerApiCalls.getDataStream = stubSimpleCall(expectedResponse); - const [response] = await client.getDataStream(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataStream without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetDataStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataStreamRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.DataStream() - ); - client.innerApiCalls.getDataStream = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDataStream( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IDataStream|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataStream with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetDataStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataStreamRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataStream = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataStream(request), expectedError); - const actualRequest = (client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataStream with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.GetDataStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.GetDataStreamRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDataStream(request), expectedError); - }); - }); - - describe('runAccessReport', () => { - it('invokes runAccessReport without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.RunAccessReportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.RunAccessReportRequest', ['entity']); - request.entity = defaultValue1; - const expectedHeaderRequestParams = `entity=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.RunAccessReportResponse() - ); - client.innerApiCalls.runAccessReport = stubSimpleCall(expectedResponse); - const [response] = await client.runAccessReport(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runAccessReport as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runAccessReport as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runAccessReport without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.RunAccessReportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.RunAccessReportRequest', ['entity']); - request.entity = defaultValue1; - const expectedHeaderRequestParams = `entity=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1beta.RunAccessReportResponse() - ); - client.innerApiCalls.runAccessReport = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runAccessReport( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IRunAccessReportResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runAccessReport as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runAccessReport as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runAccessReport with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.RunAccessReportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.RunAccessReportRequest', ['entity']); - request.entity = defaultValue1; - const expectedHeaderRequestParams = `entity=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.runAccessReport = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.runAccessReport(request), expectedError); - const actualRequest = (client.innerApiCalls.runAccessReport as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runAccessReport as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runAccessReport with closed client', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.RunAccessReportRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.RunAccessReportRequest', ['entity']); - request.entity = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.runAccessReport(request), expectedError); - }); - }); - - describe('listAccounts', () => { - it('invokes listAccounts without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListAccountsRequest() - );const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), - ]; - client.innerApiCalls.listAccounts = stubSimpleCall(expectedResponse); - const [response] = await client.listAccounts(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes listAccounts without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListAccountsRequest() - );const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), - ]; - client.innerApiCalls.listAccounts = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAccounts( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IAccount[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes listAccounts with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListAccountsRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.listAccounts = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAccounts(request), expectedError); - }); - - it('invokes listAccountsStream without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListAccountsRequest() - ); - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.Account[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.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.v1beta.Account[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListAccountsRequest() - ); - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.Account()), - ]; - client.descriptors.page.listAccounts.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.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.v1beta.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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListAccountSummariesRequest() - );const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), - ]; - client.innerApiCalls.listAccountSummaries = stubSimpleCall(expectedResponse); - const [response] = await client.listAccountSummaries(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes listAccountSummaries without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListAccountSummariesRequest() - );const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), - ]; - client.innerApiCalls.listAccountSummaries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAccountSummaries( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IAccountSummary[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes listAccountSummaries with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListAccountSummariesRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.listAccountSummaries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAccountSummaries(request), expectedError); - }); - - it('invokes listAccountSummariesStream without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListAccountSummariesRequest() - ); - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.AccountSummary[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.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.v1beta.AccountSummary[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListAccountSummariesRequest() - ); - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.AccountSummary()), - ]; - client.descriptors.page.listAccountSummaries.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.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.v1beta.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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListPropertiesRequest() - );const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), - ]; - client.innerApiCalls.listProperties = stubSimpleCall(expectedResponse); - const [response] = await client.listProperties(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes listProperties without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListPropertiesRequest() - );const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), - ]; - client.innerApiCalls.listProperties = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listProperties( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IProperty[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes listProperties with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListPropertiesRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.listProperties = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listProperties(request), expectedError); - }); - - it('invokes listPropertiesStream without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListPropertiesRequest() - ); - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.Property[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.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.v1beta.Property[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListPropertiesRequest() - ); - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.Property()), - ]; - client.descriptors.page.listProperties.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1beta.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.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.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.v1beta.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('listFirebaseLinks', () => { - it('invokes listFirebaseLinks without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListFirebaseLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListFirebaseLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), - ]; - client.innerApiCalls.listFirebaseLinks = stubSimpleCall(expectedResponse); - const [response] = await client.listFirebaseLinks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listFirebaseLinks without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListFirebaseLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListFirebaseLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), - ]; - client.innerApiCalls.listFirebaseLinks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listFirebaseLinks( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IFirebaseLink[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listFirebaseLinks with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListFirebaseLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListFirebaseLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listFirebaseLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listFirebaseLinks(request), expectedError); - const actualRequest = (client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFirebaseLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listFirebaseLinksStream without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListFirebaseLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListFirebaseLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.FirebaseLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listFirebaseLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listFirebaseLinksStream with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListFirebaseLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListFirebaseLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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.v1beta.FirebaseLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listFirebaseLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listFirebaseLinks without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListFirebaseLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListFirebaseLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.FirebaseLink()), - ]; - client.descriptors.page.listFirebaseLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listFirebaseLinks with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListFirebaseLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListFirebaseLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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.v1beta.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( - (client.descriptors.page.listFirebaseLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listGoogleAdsLinks', () => { - it('invokes listGoogleAdsLinks without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), - ]; - client.innerApiCalls.listGoogleAdsLinks = stubSimpleCall(expectedResponse); - const [response] = await client.listGoogleAdsLinks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listGoogleAdsLinks without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), - ]; - client.innerApiCalls.listGoogleAdsLinks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listGoogleAdsLinks( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IGoogleAdsLink[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listGoogleAdsLinks with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listGoogleAdsLinks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listGoogleAdsLinks(request), expectedError); - const actualRequest = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listGoogleAdsLinks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listGoogleAdsLinksStream without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.GoogleAdsLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listGoogleAdsLinksStream with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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.v1beta.GoogleAdsLink[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listGoogleAdsLinks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listGoogleAdsLinks without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.GoogleAdsLink()), - ]; - client.descriptors.page.listGoogleAdsLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listGoogleAdsLinks with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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.v1beta.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( - (client.descriptors.page.listGoogleAdsLinks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listMeasurementProtocolSecrets', () => { - it('invokes listMeasurementProtocolSecrets without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), - ]; - client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCall(expectedResponse); - const [response] = await client.listMeasurementProtocolSecrets(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listMeasurementProtocolSecrets without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), - ]; - client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listMeasurementProtocolSecrets( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listMeasurementProtocolSecrets with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listMeasurementProtocolSecrets(request), expectedError); - const actualRequest = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMeasurementProtocolSecrets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listMeasurementProtocolSecretsStream without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.MeasurementProtocolSecret[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listMeasurementProtocolSecretsStream with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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.v1beta.MeasurementProtocolSecret[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listMeasurementProtocolSecrets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listMeasurementProtocolSecrets without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret()), - ]; - client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listMeasurementProtocolSecrets with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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.v1beta.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( - (client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('searchChangeHistoryEvents', () => { - it('invokes searchChangeHistoryEvents without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest', ['account']); - request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), - ]; - client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCall(expectedResponse); - const [response] = await client.searchChangeHistoryEvents(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchChangeHistoryEvents without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest', ['account']); - request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), - ]; - client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchChangeHistoryEvents( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IChangeHistoryEvent[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchChangeHistoryEvents with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest', ['account']); - request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchChangeHistoryEvents(request), expectedError); - const actualRequest = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchChangeHistoryEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchChangeHistoryEventsStream without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest', ['account']); - request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.ChangeHistoryEvent[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes searchChangeHistoryEventsStream with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest', ['account']); - request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; - 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.v1beta.ChangeHistoryEvent[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.searchChangeHistoryEvents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchChangeHistoryEvents without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest', ['account']); - request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.ChangeHistoryEvent()), - ]; - client.descriptors.page.searchChangeHistoryEvents.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchChangeHistoryEvents with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest', ['account']); - request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; - 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.v1beta.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( - (client.descriptors.page.searchChangeHistoryEvents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listConversionEvents', () => { - it('invokes listConversionEvents without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListConversionEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListConversionEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), - ]; - client.innerApiCalls.listConversionEvents = stubSimpleCall(expectedResponse); - const [response] = await client.listConversionEvents(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConversionEvents without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListConversionEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListConversionEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), - ]; - client.innerApiCalls.listConversionEvents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listConversionEvents( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IConversionEvent[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConversionEvents with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListConversionEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListConversionEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listConversionEvents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listConversionEvents(request), expectedError); - const actualRequest = (client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversionEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConversionEventsStream without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListConversionEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListConversionEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.ConversionEvent[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listConversionEvents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listConversionEventsStream with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListConversionEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListConversionEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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.v1beta.ConversionEvent[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listConversionEvents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listConversionEvents without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListConversionEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListConversionEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.ConversionEvent()), - ]; - client.descriptors.page.listConversionEvents.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listConversionEvents with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListConversionEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListConversionEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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.v1beta.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( - (client.descriptors.page.listConversionEvents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listCustomDimensions', () => { - it('invokes listCustomDimensions without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListCustomDimensionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomDimensionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), - ]; - client.innerApiCalls.listCustomDimensions = stubSimpleCall(expectedResponse); - const [response] = await client.listCustomDimensions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCustomDimensions without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListCustomDimensionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomDimensionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), - ]; - client.innerApiCalls.listCustomDimensions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCustomDimensions( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomDimension[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCustomDimensions with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListCustomDimensionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomDimensionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCustomDimensions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listCustomDimensions(request), expectedError); - const actualRequest = (client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomDimensions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCustomDimensionsStream without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListCustomDimensionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomDimensionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.CustomDimension[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listCustomDimensions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listCustomDimensionsStream with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListCustomDimensionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomDimensionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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.v1beta.CustomDimension[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listCustomDimensions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listCustomDimensions without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListCustomDimensionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomDimensionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomDimension()), - ]; - client.descriptors.page.listCustomDimensions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listCustomDimensions with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListCustomDimensionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomDimensionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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.v1beta.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( - (client.descriptors.page.listCustomDimensions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listCustomMetrics', () => { - it('invokes listCustomMetrics without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListCustomMetricsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomMetricsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), - ]; - client.innerApiCalls.listCustomMetrics = stubSimpleCall(expectedResponse); - const [response] = await client.listCustomMetrics(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCustomMetrics without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListCustomMetricsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomMetricsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), - ]; - client.innerApiCalls.listCustomMetrics = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCustomMetrics( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.ICustomMetric[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCustomMetrics with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListCustomMetricsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomMetricsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCustomMetrics = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listCustomMetrics(request), expectedError); - const actualRequest = (client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomMetrics as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCustomMetricsStream without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListCustomMetricsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomMetricsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.CustomMetric[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listCustomMetrics.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listCustomMetricsStream with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListCustomMetricsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomMetricsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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.v1beta.CustomMetric[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listCustomMetrics.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listCustomMetrics without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListCustomMetricsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomMetricsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.CustomMetric()), - ]; - client.descriptors.page.listCustomMetrics.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listCustomMetrics with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListCustomMetricsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListCustomMetricsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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.v1beta.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( - (client.descriptors.page.listCustomMetrics.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listDataStreams', () => { - it('invokes listDataStreams without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListDataStreamsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListDataStreamsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), - ]; - client.innerApiCalls.listDataStreams = stubSimpleCall(expectedResponse); - const [response] = await client.listDataStreams(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDataStreams without error using callback', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListDataStreamsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListDataStreamsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), - ]; - client.innerApiCalls.listDataStreams = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDataStreams( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1beta.IDataStream[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDataStreams with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListDataStreamsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListDataStreamsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDataStreams = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDataStreams(request), expectedError); - const actualRequest = (client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataStreams as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDataStreamsStream without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListDataStreamsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListDataStreamsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.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.v1beta.DataStream[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listDataStreams.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDataStreamsStream with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListDataStreamsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListDataStreamsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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.v1beta.DataStream[] = []; - stream.on('data', (response: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listDataStreams.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDataStreams without error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListDataStreamsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListDataStreamsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), - generateSampleMessage(new protos.google.analytics.admin.v1beta.DataStream()), - ]; - client.descriptors.page.listDataStreams.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.analytics.admin.v1beta.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( - (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDataStreams with error', async () => { - const client = new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1beta.ListDataStreamsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.analytics.admin.v1beta.ListDataStreamsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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.v1beta.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( - (client.descriptors.page.listDataStreams.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new analyticsadminserviceModule.v1beta.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.v1beta.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('conversionEvent', () => { - const fakePath = "/rendered/path/conversionEvent"; - const expectedParameters = { - property: "propertyValue", - conversion_event: "conversionEventValue", - }; - const client = new analyticsadminserviceModule.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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('firebaseLink', () => { - const fakePath = "/rendered/path/firebaseLink"; - const expectedParameters = { - property: "propertyValue", - firebase_link: "firebaseLinkValue", - }; - const client = new analyticsadminserviceModule.v1beta.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('googleAdsLink', () => { - const fakePath = "/rendered/path/googleAdsLink"; - const expectedParameters = { - property: "propertyValue", - google_ads_link: "googleAdsLinkValue", - }; - const client = new analyticsadminserviceModule.v1beta.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('measurementProtocolSecret', () => { - const fakePath = "/rendered/path/measurementProtocolSecret"; - const expectedParameters = { - property: "propertyValue", - data_stream: "dataStreamValue", - measurement_protocol_secret: "measurementProtocolSecretValue", - }; - const client = new analyticsadminserviceModule.v1beta.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.v1beta.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)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-analytics-admin/v1beta/tsconfig.json b/owl-bot-staging/google-analytics-admin/v1beta/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-analytics-admin/v1beta/webpack.config.js b/owl-bot-staging/google-analytics-admin/v1beta/webpack.config.js deleted file mode 100644 index 0e336a8bddc..00000000000 --- a/owl-bot-staging/google-analytics-admin/v1beta/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: '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/packages/google-analytics-admin/README.md b/packages/google-analytics-admin/README.md index 701da3b299d..8e95f71134f 100644 --- a/packages/google-analytics-admin/README.md +++ b/packages/google-analytics-admin/README.md @@ -257,6 +257,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Analytics_admin_service.list_measurement_protocol_secrets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js,samples/README.md) | | Analytics_admin_service.list_properties | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_properties.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_properties.js,samples/README.md) | | Analytics_admin_service.provision_account_ticket | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js,samples/README.md) | +| Analytics_admin_service.run_access_report | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.run_access_report.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.run_access_report.js,samples/README.md) | | Analytics_admin_service.search_change_history_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js,samples/README.md) | | Analytics_admin_service.update_account | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_account.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_account.js,samples/README.md) | | Analytics_admin_service.update_custom_dimension | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js,samples/README.md) | diff --git a/owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/access_report.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/access_report.proto similarity index 100% rename from owl-bot-staging/google-analytics-admin/v1beta/protos/google/analytics/admin/v1beta/access_report.proto rename to packages/google-analytics-admin/protos/google/analytics/admin/v1beta/access_report.proto diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/analytics_admin.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/analytics_admin.proto index 7e80f73628f..b8ecfe20e3c 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/analytics_admin.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/analytics_admin.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ syntax = "proto3"; package google.analytics.admin.v1beta; +import "google/analytics/admin/v1beta/access_report.proto"; import "google/analytics/admin/v1beta/resources.proto"; import "google/api/annotations.proto"; import "google/api/client.proto"; @@ -84,7 +85,8 @@ service AnalyticsAdminService { } // Requests a ticket for creating an account. - rpc ProvisionAccountTicket(ProvisionAccountTicketRequest) returns (ProvisionAccountTicketResponse) { + rpc ProvisionAccountTicket(ProvisionAccountTicketRequest) + returns (ProvisionAccountTicketResponse) { option (google.api.http) = { post: "/v1beta/accounts:provisionAccountTicket" body: "*" @@ -92,7 +94,8 @@ service AnalyticsAdminService { } // Returns summaries of all accounts accessible by the caller. - rpc ListAccountSummaries(ListAccountSummariesRequest) returns (ListAccountSummariesResponse) { + rpc ListAccountSummaries(ListAccountSummariesRequest) + returns (ListAccountSummariesResponse) { option (google.api.http) = { get: "/v1beta/accountSummaries" }; @@ -137,7 +140,7 @@ service AnalyticsAdminService { // 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. + // Returns an error if the target is not found, or is not a GA4 Property. rpc DeleteProperty(DeletePropertyRequest) returns (Property) { option (google.api.http) = { delete: "/v1beta/{name=properties/*}" @@ -166,7 +169,8 @@ service AnalyticsAdminService { } // Deletes a FirebaseLink on a property - rpc DeleteFirebaseLink(DeleteFirebaseLinkRequest) returns (google.protobuf.Empty) { + rpc DeleteFirebaseLink(DeleteFirebaseLinkRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1beta/{name=properties/*/firebaseLinks/*}" }; @@ -175,7 +179,8 @@ service AnalyticsAdminService { // Lists FirebaseLinks on a property. // Properties can have at most one FirebaseLink. - rpc ListFirebaseLinks(ListFirebaseLinksRequest) returns (ListFirebaseLinksResponse) { + rpc ListFirebaseLinks(ListFirebaseLinksRequest) + returns (ListFirebaseLinksResponse) { option (google.api.http) = { get: "/v1beta/{parent=properties/*}/firebaseLinks" }; @@ -201,7 +206,8 @@ service AnalyticsAdminService { } // Deletes a GoogleAdsLink on a property - rpc DeleteGoogleAdsLink(DeleteGoogleAdsLinkRequest) returns (google.protobuf.Empty) { + rpc DeleteGoogleAdsLink(DeleteGoogleAdsLinkRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1beta/{name=properties/*/googleAdsLinks/*}" }; @@ -209,7 +215,8 @@ service AnalyticsAdminService { } // Lists GoogleAdsLinks on a property. - rpc ListGoogleAdsLinks(ListGoogleAdsLinksRequest) returns (ListGoogleAdsLinksResponse) { + rpc ListGoogleAdsLinks(ListGoogleAdsLinksRequest) + returns (ListGoogleAdsLinksResponse) { option (google.api.http) = { get: "/v1beta/{parent=properties/*}/googleAdsLinks" }; @@ -218,7 +225,8 @@ service AnalyticsAdminService { // Get data sharing settings on an account. // Data sharing settings are singletons. - rpc GetDataSharingSettings(GetDataSharingSettingsRequest) returns (DataSharingSettings) { + rpc GetDataSharingSettings(GetDataSharingSettingsRequest) + returns (DataSharingSettings) { option (google.api.http) = { get: "/v1beta/{name=accounts/*/dataSharingSettings}" }; @@ -226,7 +234,8 @@ service AnalyticsAdminService { } // Lookup for a single "GA4" MeasurementProtocolSecret. - rpc GetMeasurementProtocolSecret(GetMeasurementProtocolSecretRequest) returns (MeasurementProtocolSecret) { + rpc GetMeasurementProtocolSecret(GetMeasurementProtocolSecretRequest) + returns (MeasurementProtocolSecret) { option (google.api.http) = { get: "/v1beta/{name=properties/*/dataStreams/*/measurementProtocolSecrets/*}" }; @@ -235,7 +244,8 @@ service AnalyticsAdminService { // Returns child MeasurementProtocolSecrets under the specified parent // Property. - rpc ListMeasurementProtocolSecrets(ListMeasurementProtocolSecretsRequest) returns (ListMeasurementProtocolSecretsResponse) { + rpc ListMeasurementProtocolSecrets(ListMeasurementProtocolSecretsRequest) + returns (ListMeasurementProtocolSecretsResponse) { option (google.api.http) = { get: "/v1beta/{parent=properties/*/dataStreams/*}/measurementProtocolSecrets" }; @@ -243,7 +253,8 @@ service AnalyticsAdminService { } // Creates a measurement protocol secret. - rpc CreateMeasurementProtocolSecret(CreateMeasurementProtocolSecretRequest) returns (MeasurementProtocolSecret) { + rpc CreateMeasurementProtocolSecret(CreateMeasurementProtocolSecretRequest) + returns (MeasurementProtocolSecret) { option (google.api.http) = { post: "/v1beta/{parent=properties/*/dataStreams/*}/measurementProtocolSecrets" body: "measurement_protocol_secret" @@ -252,7 +263,8 @@ service AnalyticsAdminService { } // Deletes target MeasurementProtocolSecret. - rpc DeleteMeasurementProtocolSecret(DeleteMeasurementProtocolSecretRequest) returns (google.protobuf.Empty) { + rpc DeleteMeasurementProtocolSecret(DeleteMeasurementProtocolSecretRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1beta/{name=properties/*/dataStreams/*/measurementProtocolSecrets/*}" }; @@ -260,19 +272,23 @@ service AnalyticsAdminService { } // Updates a measurement protocol secret. - rpc UpdateMeasurementProtocolSecret(UpdateMeasurementProtocolSecretRequest) returns (MeasurementProtocolSecret) { + rpc UpdateMeasurementProtocolSecret(UpdateMeasurementProtocolSecretRequest) + returns (MeasurementProtocolSecret) { option (google.api.http) = { patch: "/v1beta/{measurement_protocol_secret.name=properties/*/dataStreams/*/measurementProtocolSecrets/*}" body: "measurement_protocol_secret" }; - option (google.api.method_signature) = "measurement_protocol_secret,update_mask"; + 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) { + // or through this API) before MeasurementProtocolSecret resources may be + // created. + rpc AcknowledgeUserDataCollection(AcknowledgeUserDataCollectionRequest) + returns (AcknowledgeUserDataCollectionResponse) { option (google.api.http) = { post: "/v1beta/{property=properties/*}:acknowledgeUserDataCollection" body: "*" @@ -281,7 +297,8 @@ service AnalyticsAdminService { // Searches through all changes to an account or its children given the // specified set of filters. - rpc SearchChangeHistoryEvents(SearchChangeHistoryEventsRequest) returns (SearchChangeHistoryEventsResponse) { + rpc SearchChangeHistoryEvents(SearchChangeHistoryEventsRequest) + returns (SearchChangeHistoryEventsResponse) { option (google.api.http) = { post: "/v1beta/{account=accounts/*}:searchChangeHistoryEvents" body: "*" @@ -289,7 +306,8 @@ service AnalyticsAdminService { } // Creates a conversion event with the specified attributes. - rpc CreateConversionEvent(CreateConversionEventRequest) returns (ConversionEvent) { + rpc CreateConversionEvent(CreateConversionEventRequest) + returns (ConversionEvent) { option (google.api.http) = { post: "/v1beta/{parent=properties/*}/conversionEvents" body: "conversion_event" @@ -306,7 +324,8 @@ service AnalyticsAdminService { } // Deletes a conversion event in a property. - rpc DeleteConversionEvent(DeleteConversionEventRequest) returns (google.protobuf.Empty) { + rpc DeleteConversionEvent(DeleteConversionEventRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1beta/{name=properties/*/conversionEvents/*}" }; @@ -316,7 +335,8 @@ service AnalyticsAdminService { // 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) { + rpc ListConversionEvents(ListConversionEventsRequest) + returns (ListConversionEventsResponse) { option (google.api.http) = { get: "/v1beta/{parent=properties/*}/conversionEvents" }; @@ -324,7 +344,8 @@ service AnalyticsAdminService { } // Creates a CustomDimension. - rpc CreateCustomDimension(CreateCustomDimensionRequest) returns (CustomDimension) { + rpc CreateCustomDimension(CreateCustomDimensionRequest) + returns (CustomDimension) { option (google.api.http) = { post: "/v1beta/{parent=properties/*}/customDimensions" body: "custom_dimension" @@ -333,7 +354,8 @@ service AnalyticsAdminService { } // Updates a CustomDimension on a property. - rpc UpdateCustomDimension(UpdateCustomDimensionRequest) returns (CustomDimension) { + rpc UpdateCustomDimension(UpdateCustomDimensionRequest) + returns (CustomDimension) { option (google.api.http) = { patch: "/v1beta/{custom_dimension.name=properties/*/customDimensions/*}" body: "custom_dimension" @@ -342,7 +364,8 @@ service AnalyticsAdminService { } // Lists CustomDimensions on a property. - rpc ListCustomDimensions(ListCustomDimensionsRequest) returns (ListCustomDimensionsResponse) { + rpc ListCustomDimensions(ListCustomDimensionsRequest) + returns (ListCustomDimensionsResponse) { option (google.api.http) = { get: "/v1beta/{parent=properties/*}/customDimensions" }; @@ -350,7 +373,8 @@ service AnalyticsAdminService { } // Archives a CustomDimension on a property. - rpc ArchiveCustomDimension(ArchiveCustomDimensionRequest) returns (google.protobuf.Empty) { + rpc ArchiveCustomDimension(ArchiveCustomDimensionRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { post: "/v1beta/{name=properties/*/customDimensions/*}:archive" body: "*" @@ -385,7 +409,8 @@ service AnalyticsAdminService { } // Lists CustomMetrics on a property. - rpc ListCustomMetrics(ListCustomMetricsRequest) returns (ListCustomMetricsResponse) { + rpc ListCustomMetrics(ListCustomMetricsRequest) + returns (ListCustomMetricsResponse) { option (google.api.http) = { get: "/v1beta/{parent=properties/*}/customMetrics" }; @@ -393,7 +418,8 @@ service AnalyticsAdminService { } // Archives a CustomMetric on a property. - rpc ArchiveCustomMetric(ArchiveCustomMetricRequest) returns (google.protobuf.Empty) { + rpc ArchiveCustomMetric(ArchiveCustomMetricRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { post: "/v1beta/{name=properties/*/customMetrics/*}:archive" body: "*" @@ -410,7 +436,8 @@ service AnalyticsAdminService { } // Returns the singleton data retention settings for this property. - rpc GetDataRetentionSettings(GetDataRetentionSettingsRequest) returns (DataRetentionSettings) { + rpc GetDataRetentionSettings(GetDataRetentionSettingsRequest) + returns (DataRetentionSettings) { option (google.api.http) = { get: "/v1beta/{name=properties/*/dataRetentionSettings}" }; @@ -418,12 +445,14 @@ service AnalyticsAdminService { } // Updates the singleton data retention settings for this property. - rpc UpdateDataRetentionSettings(UpdateDataRetentionSettingsRequest) returns (DataRetentionSettings) { + rpc UpdateDataRetentionSettings(UpdateDataRetentionSettingsRequest) + returns (DataRetentionSettings) { option (google.api.http) = { patch: "/v1beta/{data_retention_settings.name=properties/*/dataRetentionSettings}" body: "data_retention_settings" }; - option (google.api.method_signature) = "data_retention_settings,update_mask"; + option (google.api.method_signature) = + "data_retention_settings,update_mask"; } // Creates a DataStream. @@ -436,7 +465,8 @@ service AnalyticsAdminService { } // Deletes a DataStream on a property. - rpc DeleteDataStream(DeleteDataStreamRequest) returns (google.protobuf.Empty) { + rpc DeleteDataStream(DeleteDataStreamRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1beta/{name=properties/*/dataStreams/*}" }; @@ -453,7 +483,8 @@ service AnalyticsAdminService { } // Lists DataStreams on a property. - rpc ListDataStreams(ListDataStreamsRequest) returns (ListDataStreamsResponse) { + rpc ListDataStreams(ListDataStreamsRequest) + returns (ListDataStreamsResponse) { option (google.api.http) = { get: "/v1beta/{parent=properties/*}/dataStreams" }; @@ -467,6 +498,141 @@ service AnalyticsAdminService { }; option (google.api.method_signature) = "name"; } + + // Returns a customized report of data access records. The report provides + // records of each time a user reads Google Analytics reporting data. Access + // records are retained for up to 2 years. + // + // Data Access Reports can be requested for a property. The property must be + // in Google Analytics 360. This method is only available to Administrators. + // + // These data access records include GA4 UI Reporting, GA4 UI Explorations, + // GA4 Data API, and other products like Firebase & Admob that can retrieve + // data from Google Analytics through a linkage. These records don't include + // property configuration changes like adding a stream or changing a + // property's time zone. For configuration change history, see + // [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). + rpc RunAccessReport(RunAccessReportRequest) + returns (RunAccessReportResponse) { + option (google.api.http) = { + post: "/v1beta/{entity=properties/*}:runAccessReport" + body: "*" + additional_bindings { + post: "/v1beta/{entity=accounts/*}:runAccessReport" + body: "*" + } + }; + } +} + +// The request for a Data Access Record Report. +message RunAccessReportRequest { + // The Data Access Report supports requesting at the property level or account + // level. If requested at the account level, Data Access Reports include all + // access for all properties under that account. + // + // To request at the property level, entity should be for example + // 'properties/123' if "123" is your GA4 property ID. To request at the + // account level, entity should be for example 'accounts/1234' if "1234" is + // your GA4 Account ID. + string entity = 1; + + // The dimensions requested and displayed in the response. Requests are + // allowed up to 9 dimensions. + repeated AccessDimension dimensions = 2; + + // The metrics requested and displayed in the response. Requests are allowed + // up to 10 metrics. + repeated AccessMetric metrics = 3; + + // Date ranges of access records to read. If multiple date ranges are + // requested, each response row will contain a zero based date range index. If + // two date ranges overlap, the access records for the overlapping days is + // included in the response rows for both date ranges. Requests are allowed up + // to 2 date ranges. + repeated AccessDateRange date_ranges = 4; + + // Dimension filters let you restrict report response to specific + // dimension values which match the filter. For example, filtering on access + // records of a single user. To learn more, see [Fundamentals of Dimension + // Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + // for examples. Metrics cannot be used in this filter. + AccessFilterExpression dimension_filter = 5; + + // Metric filters allow you to restrict report response to specific metric + // values which match the filter. Metric filters are applied after aggregating + // the report's rows, similar to SQL having-clause. Dimensions cannot be used + // in this filter. + AccessFilterExpression metric_filter = 6; + + // The row count of the start row. The first row is counted as row 0. If + // offset is unspecified, it is treated as 0. If offset is zero, then this + // method will return the first page of results with `limit` entries. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int64 offset = 7; + + // The number of rows to return. If unspecified, 10,000 rows are returned. The + // API returns a maximum of 100,000 rows per request, no matter how many you + // ask for. `limit` must be positive. + // + // The API may return fewer rows than the requested `limit`, if there aren't + // as many remaining rows as the `limit`. For instance, there are fewer than + // 300 possible values for the dimension `country`, so when reporting on only + // `country`, you can't get more than 300 rows, even if you set `limit` to a + // higher value. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int64 limit = 8; + + // This request's time zone if specified. If unspecified, the property's time + // zone is used. The request's time zone is used to interpret the start & end + // dates of the report. + // + // Formatted as strings from the IANA Time Zone database + // (https://www.iana.org/time-zones); for example "America/New_York" or + // "Asia/Tokyo". + string time_zone = 9; + + // Specifies how rows are ordered in the response. + repeated AccessOrderBy order_bys = 10; + + // Toggles whether to return the current state of this Analytics Property's + // quota. Quota is returned in [AccessQuota](#AccessQuota). For account-level + // requests, this field must be false. + bool return_entity_quota = 11; +} + +// The customized Data Access Record Report response. +message RunAccessReportResponse { + // The header for a column in the report that corresponds to a specific + // dimension. The number of DimensionHeaders and ordering of DimensionHeaders + // matches the dimensions present in rows. + repeated AccessDimensionHeader dimension_headers = 1; + + // The header for a column in the report that corresponds to a specific + // metric. The number of MetricHeaders and ordering of MetricHeaders matches + // the metrics present in rows. + repeated AccessMetricHeader metric_headers = 2; + + // Rows of dimension value combinations and metric values in the report. + repeated AccessRow rows = 3; + + // The total number of rows in the query result. `rowCount` is independent of + // the number of rows returned in the response, the `limit` request + // parameter, and the `offset` request parameter. For example if a query + // returns 175 rows and includes `limit` of 50 in the API request, the + // response will contain `rowCount` of 175 but only 50 rows. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int32 row_count = 4; + + // The quota state for this Analytics property including this request. This + // field doesn't work with account-level requests. + AccessQuota quota = 5; } // Request message for GetAccount RPC. @@ -531,10 +697,12 @@ message UpdateAccountRequest { // 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]; + // Required. The list of fields to be updated. Field names must be in snake + // case (for example, "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. @@ -543,7 +711,7 @@ message ProvisionAccountTicketRequest { 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 + // Must be configured in Cloud Console as a Redirect URI. string redirect_uri = 2; } @@ -621,10 +789,12 @@ message UpdatePropertyRequest { // 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]; + // 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. @@ -693,7 +863,7 @@ message ListFirebaseLinksRequest { // 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 + // When paginating, all other parameters provided to `ListFirebaseLinks` must // match the call that provided the page token. string page_token = 3; } @@ -729,10 +899,12 @@ 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]; + // 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. @@ -827,8 +999,8 @@ message AcknowledgeUserDataCollectionRequest { } ]; - // Required. An acknowledgement that the caller of this method understands the terms - // of user data collection. + // 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 @@ -839,13 +1011,12 @@ message AcknowledgeUserDataCollectionRequest { } // Response message for AcknowledgeUserDataCollection RPC. -message AcknowledgeUserDataCollectionResponse { - -} +message AcknowledgeUserDataCollectionResponse {} // Request message for SearchChangeHistoryEvents RPC. message SearchChangeHistoryEventsRequest { - // Required. The account resource for which to return change history resources. + // Required. The account resource for which to return change history + // resources. string account = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -862,22 +1033,26 @@ message SearchChangeHistoryEventsRequest { } ]; - // 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 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. + // 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. + // 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]; + 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]; + 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 @@ -885,10 +1060,11 @@ message SearchChangeHistoryEventsRequest { // 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. + // 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]; } @@ -927,7 +1103,8 @@ message CreateMeasurementProtocolSecretRequest { ]; // Required. The measurement protocol secret to create. - MeasurementProtocolSecret measurement_protocol_secret = 2 [(google.api.field_behavior) = REQUIRED]; + MeasurementProtocolSecret measurement_protocol_secret = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request message for DeleteMeasurementProtocolSecret RPC @@ -946,7 +1123,8 @@ message DeleteMeasurementProtocolSecretRequest { // Request message for UpdateMeasurementProtocolSecret RPC message UpdateMeasurementProtocolSecretRequest { // Required. The measurement protocol secret to update. - MeasurementProtocolSecret measurement_protocol_secret = 1 [(google.api.field_behavior) = REQUIRED]; + 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; @@ -991,8 +1169,8 @@ 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 + // 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) = { @@ -1079,10 +1257,11 @@ 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]; + // 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. @@ -1161,10 +1340,11 @@ 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]; + // 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. @@ -1242,12 +1422,15 @@ message GetDataRetentionSettingsRequest { 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]; + 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. @@ -1281,10 +1464,11 @@ 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]; + // 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. diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/resources.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/resources.proto index 2a7010305a2..43b299b7f58 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/resources.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -223,10 +223,12 @@ message Account { 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]; + 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]; + 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]; @@ -251,17 +253,19 @@ message Property { // Example: "properties/1000" string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Immutable. The property type for this Property resource. When creating a property, if - // the type is "PROPERTY_TYPE_UNSPECIFIED", then "ORDINARY_PROPERTY" will be - // implied. "SUBPROPERTY" and "ROLLUP_PROPERTY" types cannot yet be created - // via Google Analytics Admin API. + // Immutable. The property type for this Property resource. When creating a + // property, if the type is "PROPERTY_TYPE_UNSPECIFIED", then + // "ORDINARY_PROPERTY" will be implied. "SUBPROPERTY" and "ROLLUP_PROPERTY" + // types cannot yet be created with the Google Analytics Admin API. PropertyType property_type = 14 [(google.api.field_behavior) = IMMUTABLE]; // Output only. Time when the entity was originally created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + 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]; + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Immutable. Resource name of this property's logical parent. // @@ -279,9 +283,9 @@ message 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. + // 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. @@ -297,17 +301,20 @@ message Property { // Examples: "USD", "EUR", "JPY" string currency_code = 8; - // Output only. The Google Analytics service level that applies to this property. + // 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 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]; + // 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} @@ -417,10 +424,12 @@ message DataStream { 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]; + 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]; + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // A link between a GA4 property and a Firebase project. @@ -433,9 +442,9 @@ message FirebaseLink { // 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 + // 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}' @@ -443,7 +452,8 @@ message FirebaseLink { 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]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // A link between a GA4 property and a Google Ads account. @@ -453,7 +463,8 @@ message GoogleAdsLink { pattern: "properties/{property}/googleAdsLinks/{google_ads_link}" }; - // Output only. Format: properties/{propertyId}/googleAdsLinks/{googleAdsLinkId} + // 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]; @@ -471,10 +482,12 @@ message GoogleAdsLink { 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]; + 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]; + 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. @@ -531,8 +544,8 @@ message AccountSummary { // Format: accounts/{account_id} // Example: "accounts/1000" string account = 2 [(google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Account" - }]; + type: "analyticsadmin.googleapis.com/Account" + }]; // Display name for the account referred to in this account summary. string display_name = 3; @@ -547,8 +560,8 @@ message PropertySummary { // Format: properties/{property_id} // Example: "properties/1000" string property = 1 [(google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Property" - }]; + type: "analyticsadmin.googleapis.com/Property" + }]; // Display name for the property referred to in this property summary. string display_name = 2; @@ -571,17 +584,16 @@ message 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: + // Output only. Resource name of this secret. This secret may be a child of + // any type of stream. Format: // properties/{property}/dataStreams/{dataStream}/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 + // 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]; } @@ -677,16 +689,18 @@ message ConversionEvent { 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]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. If set, this event can currently be deleted via DeleteConversionEvent. + // Output only. If set, this event can currently be deleted with + // 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 + // 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]; } @@ -728,14 +742,15 @@ message CustomDimension { (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 + // 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. + // 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. @@ -744,11 +759,12 @@ message CustomDimension { (google.api.field_behavior) = IMMUTABLE ]; - // Optional. If set to true, sets this dimension as NPA and excludes it from ads - // personalization. + // 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]; + bool disallow_ads_personalization = 6 + [(google.api.field_behavior) = OPTIONAL]; } // A definition for a custom metric. @@ -855,10 +871,11 @@ message CustomMetric { (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]; + // 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. diff --git a/packages/google-analytics-admin/protos/protos.d.ts b/packages/google-analytics-admin/protos/protos.d.ts index 0610aaf444c..1e67a25ac9b 100644 --- a/packages/google-analytics-admin/protos/protos.d.ts +++ b/packages/google-analytics-admin/protos/protos.d.ts @@ -25530,6 +25530,2234 @@ export namespace google { /** Namespace v1beta. */ namespace v1beta { + /** Properties of an AccessDimension. */ + interface IAccessDimension { + + /** AccessDimension dimensionName */ + dimensionName?: (string|null); + } + + /** Represents an AccessDimension. */ + class AccessDimension implements IAccessDimension { + + /** + * Constructs a new AccessDimension. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessDimension); + + /** AccessDimension dimensionName. */ + public dimensionName: string; + + /** + * Creates a new AccessDimension instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessDimension instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessDimension): google.analytics.admin.v1beta.AccessDimension; + + /** + * Encodes the specified AccessDimension message. Does not implicitly {@link google.analytics.admin.v1beta.AccessDimension.verify|verify} messages. + * @param message AccessDimension message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessDimension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessDimension message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessDimension.verify|verify} messages. + * @param message AccessDimension message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessDimension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessDimension message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessDimension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessDimension; + + /** + * Decodes an AccessDimension message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessDimension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessDimension; + + /** + * Verifies an AccessDimension message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessDimension message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessDimension + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessDimension; + + /** + * Creates a plain object from an AccessDimension message. Also converts values to other types if specified. + * @param message AccessDimension + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessDimension, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessDimension to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessDimension + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessMetric. */ + interface IAccessMetric { + + /** AccessMetric metricName */ + metricName?: (string|null); + } + + /** Represents an AccessMetric. */ + class AccessMetric implements IAccessMetric { + + /** + * Constructs a new AccessMetric. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessMetric); + + /** AccessMetric metricName. */ + public metricName: string; + + /** + * Creates a new AccessMetric instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessMetric instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessMetric): google.analytics.admin.v1beta.AccessMetric; + + /** + * Encodes the specified AccessMetric message. Does not implicitly {@link google.analytics.admin.v1beta.AccessMetric.verify|verify} messages. + * @param message AccessMetric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessMetric message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessMetric.verify|verify} messages. + * @param message AccessMetric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessMetric message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessMetric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessMetric; + + /** + * Decodes an AccessMetric message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessMetric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessMetric; + + /** + * Verifies an AccessMetric message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessMetric message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessMetric + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessMetric; + + /** + * Creates a plain object from an AccessMetric message. Also converts values to other types if specified. + * @param message AccessMetric + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessMetric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessMetric to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessMetric + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessDateRange. */ + interface IAccessDateRange { + + /** AccessDateRange startDate */ + startDate?: (string|null); + + /** AccessDateRange endDate */ + endDate?: (string|null); + } + + /** Represents an AccessDateRange. */ + class AccessDateRange implements IAccessDateRange { + + /** + * Constructs a new AccessDateRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessDateRange); + + /** AccessDateRange startDate. */ + public startDate: string; + + /** AccessDateRange endDate. */ + public endDate: string; + + /** + * Creates a new AccessDateRange instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessDateRange instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessDateRange): google.analytics.admin.v1beta.AccessDateRange; + + /** + * Encodes the specified AccessDateRange message. Does not implicitly {@link google.analytics.admin.v1beta.AccessDateRange.verify|verify} messages. + * @param message AccessDateRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessDateRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessDateRange message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessDateRange.verify|verify} messages. + * @param message AccessDateRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessDateRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessDateRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessDateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessDateRange; + + /** + * Decodes an AccessDateRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessDateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessDateRange; + + /** + * Verifies an AccessDateRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessDateRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessDateRange + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessDateRange; + + /** + * Creates a plain object from an AccessDateRange message. Also converts values to other types if specified. + * @param message AccessDateRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessDateRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessDateRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessDateRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessFilterExpression. */ + interface IAccessFilterExpression { + + /** AccessFilterExpression andGroup */ + andGroup?: (google.analytics.admin.v1beta.IAccessFilterExpressionList|null); + + /** AccessFilterExpression orGroup */ + orGroup?: (google.analytics.admin.v1beta.IAccessFilterExpressionList|null); + + /** AccessFilterExpression notExpression */ + notExpression?: (google.analytics.admin.v1beta.IAccessFilterExpression|null); + + /** AccessFilterExpression accessFilter */ + accessFilter?: (google.analytics.admin.v1beta.IAccessFilter|null); + } + + /** Represents an AccessFilterExpression. */ + class AccessFilterExpression implements IAccessFilterExpression { + + /** + * Constructs a new AccessFilterExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessFilterExpression); + + /** AccessFilterExpression andGroup. */ + public andGroup?: (google.analytics.admin.v1beta.IAccessFilterExpressionList|null); + + /** AccessFilterExpression orGroup. */ + public orGroup?: (google.analytics.admin.v1beta.IAccessFilterExpressionList|null); + + /** AccessFilterExpression notExpression. */ + public notExpression?: (google.analytics.admin.v1beta.IAccessFilterExpression|null); + + /** AccessFilterExpression accessFilter. */ + public accessFilter?: (google.analytics.admin.v1beta.IAccessFilter|null); + + /** AccessFilterExpression oneExpression. */ + public oneExpression?: ("andGroup"|"orGroup"|"notExpression"|"accessFilter"); + + /** + * Creates a new AccessFilterExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessFilterExpression instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessFilterExpression): google.analytics.admin.v1beta.AccessFilterExpression; + + /** + * Encodes the specified AccessFilterExpression message. Does not implicitly {@link google.analytics.admin.v1beta.AccessFilterExpression.verify|verify} messages. + * @param message AccessFilterExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessFilterExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessFilterExpression message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessFilterExpression.verify|verify} messages. + * @param message AccessFilterExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessFilterExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessFilterExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessFilterExpression; + + /** + * Decodes an AccessFilterExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessFilterExpression; + + /** + * Verifies an AccessFilterExpression message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessFilterExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessFilterExpression + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessFilterExpression; + + /** + * Creates a plain object from an AccessFilterExpression message. Also converts values to other types if specified. + * @param message AccessFilterExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessFilterExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessFilterExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessFilterExpression + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessFilterExpressionList. */ + interface IAccessFilterExpressionList { + + /** AccessFilterExpressionList expressions */ + expressions?: (google.analytics.admin.v1beta.IAccessFilterExpression[]|null); + } + + /** Represents an AccessFilterExpressionList. */ + class AccessFilterExpressionList implements IAccessFilterExpressionList { + + /** + * Constructs a new AccessFilterExpressionList. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessFilterExpressionList); + + /** AccessFilterExpressionList expressions. */ + public expressions: google.analytics.admin.v1beta.IAccessFilterExpression[]; + + /** + * Creates a new AccessFilterExpressionList instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessFilterExpressionList instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessFilterExpressionList): google.analytics.admin.v1beta.AccessFilterExpressionList; + + /** + * Encodes the specified AccessFilterExpressionList message. Does not implicitly {@link google.analytics.admin.v1beta.AccessFilterExpressionList.verify|verify} messages. + * @param message AccessFilterExpressionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessFilterExpressionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessFilterExpressionList message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessFilterExpressionList.verify|verify} messages. + * @param message AccessFilterExpressionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessFilterExpressionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessFilterExpressionList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessFilterExpressionList; + + /** + * Decodes an AccessFilterExpressionList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessFilterExpressionList; + + /** + * Verifies an AccessFilterExpressionList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessFilterExpressionList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessFilterExpressionList + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessFilterExpressionList; + + /** + * Creates a plain object from an AccessFilterExpressionList message. Also converts values to other types if specified. + * @param message AccessFilterExpressionList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessFilterExpressionList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessFilterExpressionList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessFilterExpressionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessFilter. */ + interface IAccessFilter { + + /** AccessFilter stringFilter */ + stringFilter?: (google.analytics.admin.v1beta.IAccessStringFilter|null); + + /** AccessFilter inListFilter */ + inListFilter?: (google.analytics.admin.v1beta.IAccessInListFilter|null); + + /** AccessFilter numericFilter */ + numericFilter?: (google.analytics.admin.v1beta.IAccessNumericFilter|null); + + /** AccessFilter betweenFilter */ + betweenFilter?: (google.analytics.admin.v1beta.IAccessBetweenFilter|null); + + /** AccessFilter fieldName */ + fieldName?: (string|null); + } + + /** Represents an AccessFilter. */ + class AccessFilter implements IAccessFilter { + + /** + * Constructs a new AccessFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessFilter); + + /** AccessFilter stringFilter. */ + public stringFilter?: (google.analytics.admin.v1beta.IAccessStringFilter|null); + + /** AccessFilter inListFilter. */ + public inListFilter?: (google.analytics.admin.v1beta.IAccessInListFilter|null); + + /** AccessFilter numericFilter. */ + public numericFilter?: (google.analytics.admin.v1beta.IAccessNumericFilter|null); + + /** AccessFilter betweenFilter. */ + public betweenFilter?: (google.analytics.admin.v1beta.IAccessBetweenFilter|null); + + /** AccessFilter fieldName. */ + public fieldName: string; + + /** AccessFilter oneFilter. */ + public oneFilter?: ("stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"); + + /** + * Creates a new AccessFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessFilter instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessFilter): google.analytics.admin.v1beta.AccessFilter; + + /** + * Encodes the specified AccessFilter message. Does not implicitly {@link google.analytics.admin.v1beta.AccessFilter.verify|verify} messages. + * @param message AccessFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessFilter message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessFilter.verify|verify} messages. + * @param message AccessFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessFilter; + + /** + * Decodes an AccessFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessFilter; + + /** + * Verifies an AccessFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessFilter; + + /** + * Creates a plain object from an AccessFilter message. Also converts values to other types if specified. + * @param message AccessFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessStringFilter. */ + interface IAccessStringFilter { + + /** AccessStringFilter matchType */ + matchType?: (google.analytics.admin.v1beta.AccessStringFilter.MatchType|keyof typeof google.analytics.admin.v1beta.AccessStringFilter.MatchType|null); + + /** AccessStringFilter value */ + value?: (string|null); + + /** AccessStringFilter caseSensitive */ + caseSensitive?: (boolean|null); + } + + /** Represents an AccessStringFilter. */ + class AccessStringFilter implements IAccessStringFilter { + + /** + * Constructs a new AccessStringFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessStringFilter); + + /** AccessStringFilter matchType. */ + public matchType: (google.analytics.admin.v1beta.AccessStringFilter.MatchType|keyof typeof google.analytics.admin.v1beta.AccessStringFilter.MatchType); + + /** AccessStringFilter value. */ + public value: string; + + /** AccessStringFilter caseSensitive. */ + public caseSensitive: boolean; + + /** + * Creates a new AccessStringFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessStringFilter instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessStringFilter): google.analytics.admin.v1beta.AccessStringFilter; + + /** + * Encodes the specified AccessStringFilter message. Does not implicitly {@link google.analytics.admin.v1beta.AccessStringFilter.verify|verify} messages. + * @param message AccessStringFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessStringFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessStringFilter message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessStringFilter.verify|verify} messages. + * @param message AccessStringFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessStringFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessStringFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessStringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessStringFilter; + + /** + * Decodes an AccessStringFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessStringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessStringFilter; + + /** + * Verifies an AccessStringFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessStringFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessStringFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessStringFilter; + + /** + * Creates a plain object from an AccessStringFilter message. Also converts values to other types if specified. + * @param message AccessStringFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessStringFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessStringFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessStringFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AccessStringFilter { + + /** MatchType enum. */ + enum MatchType { + MATCH_TYPE_UNSPECIFIED = 0, + EXACT = 1, + BEGINS_WITH = 2, + ENDS_WITH = 3, + CONTAINS = 4, + FULL_REGEXP = 5, + PARTIAL_REGEXP = 6 + } + } + + /** Properties of an AccessInListFilter. */ + interface IAccessInListFilter { + + /** AccessInListFilter values */ + values?: (string[]|null); + + /** AccessInListFilter caseSensitive */ + caseSensitive?: (boolean|null); + } + + /** Represents an AccessInListFilter. */ + class AccessInListFilter implements IAccessInListFilter { + + /** + * Constructs a new AccessInListFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessInListFilter); + + /** AccessInListFilter values. */ + public values: string[]; + + /** AccessInListFilter caseSensitive. */ + public caseSensitive: boolean; + + /** + * Creates a new AccessInListFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessInListFilter instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessInListFilter): google.analytics.admin.v1beta.AccessInListFilter; + + /** + * Encodes the specified AccessInListFilter message. Does not implicitly {@link google.analytics.admin.v1beta.AccessInListFilter.verify|verify} messages. + * @param message AccessInListFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessInListFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessInListFilter message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessInListFilter.verify|verify} messages. + * @param message AccessInListFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessInListFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessInListFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessInListFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessInListFilter; + + /** + * Decodes an AccessInListFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessInListFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessInListFilter; + + /** + * Verifies an AccessInListFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessInListFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessInListFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessInListFilter; + + /** + * Creates a plain object from an AccessInListFilter message. Also converts values to other types if specified. + * @param message AccessInListFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessInListFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessInListFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessInListFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessNumericFilter. */ + interface IAccessNumericFilter { + + /** AccessNumericFilter operation */ + operation?: (google.analytics.admin.v1beta.AccessNumericFilter.Operation|keyof typeof google.analytics.admin.v1beta.AccessNumericFilter.Operation|null); + + /** AccessNumericFilter value */ + value?: (google.analytics.admin.v1beta.INumericValue|null); + } + + /** Represents an AccessNumericFilter. */ + class AccessNumericFilter implements IAccessNumericFilter { + + /** + * Constructs a new AccessNumericFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessNumericFilter); + + /** AccessNumericFilter operation. */ + public operation: (google.analytics.admin.v1beta.AccessNumericFilter.Operation|keyof typeof google.analytics.admin.v1beta.AccessNumericFilter.Operation); + + /** AccessNumericFilter value. */ + public value?: (google.analytics.admin.v1beta.INumericValue|null); + + /** + * Creates a new AccessNumericFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessNumericFilter instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessNumericFilter): google.analytics.admin.v1beta.AccessNumericFilter; + + /** + * Encodes the specified AccessNumericFilter message. Does not implicitly {@link google.analytics.admin.v1beta.AccessNumericFilter.verify|verify} messages. + * @param message AccessNumericFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessNumericFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessNumericFilter message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessNumericFilter.verify|verify} messages. + * @param message AccessNumericFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessNumericFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessNumericFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessNumericFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessNumericFilter; + + /** + * Decodes an AccessNumericFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessNumericFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessNumericFilter; + + /** + * Verifies an AccessNumericFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessNumericFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessNumericFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessNumericFilter; + + /** + * Creates a plain object from an AccessNumericFilter message. Also converts values to other types if specified. + * @param message AccessNumericFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessNumericFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessNumericFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessNumericFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AccessNumericFilter { + + /** Operation enum. */ + enum Operation { + OPERATION_UNSPECIFIED = 0, + EQUAL = 1, + LESS_THAN = 2, + LESS_THAN_OR_EQUAL = 3, + GREATER_THAN = 4, + GREATER_THAN_OR_EQUAL = 5 + } + } + + /** Properties of an AccessBetweenFilter. */ + interface IAccessBetweenFilter { + + /** AccessBetweenFilter fromValue */ + fromValue?: (google.analytics.admin.v1beta.INumericValue|null); + + /** AccessBetweenFilter toValue */ + toValue?: (google.analytics.admin.v1beta.INumericValue|null); + } + + /** Represents an AccessBetweenFilter. */ + class AccessBetweenFilter implements IAccessBetweenFilter { + + /** + * Constructs a new AccessBetweenFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessBetweenFilter); + + /** AccessBetweenFilter fromValue. */ + public fromValue?: (google.analytics.admin.v1beta.INumericValue|null); + + /** AccessBetweenFilter toValue. */ + public toValue?: (google.analytics.admin.v1beta.INumericValue|null); + + /** + * Creates a new AccessBetweenFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessBetweenFilter instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessBetweenFilter): google.analytics.admin.v1beta.AccessBetweenFilter; + + /** + * Encodes the specified AccessBetweenFilter message. Does not implicitly {@link google.analytics.admin.v1beta.AccessBetweenFilter.verify|verify} messages. + * @param message AccessBetweenFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessBetweenFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessBetweenFilter message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessBetweenFilter.verify|verify} messages. + * @param message AccessBetweenFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessBetweenFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessBetweenFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessBetweenFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessBetweenFilter; + + /** + * Decodes an AccessBetweenFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessBetweenFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessBetweenFilter; + + /** + * Verifies an AccessBetweenFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessBetweenFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessBetweenFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessBetweenFilter; + + /** + * Creates a plain object from an AccessBetweenFilter message. Also converts values to other types if specified. + * @param message AccessBetweenFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessBetweenFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessBetweenFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessBetweenFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NumericValue. */ + interface INumericValue { + + /** NumericValue int64Value */ + int64Value?: (number|Long|string|null); + + /** NumericValue doubleValue */ + doubleValue?: (number|null); + } + + /** Represents a NumericValue. */ + class NumericValue implements INumericValue { + + /** + * Constructs a new NumericValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.INumericValue); + + /** NumericValue int64Value. */ + public int64Value?: (number|Long|string|null); + + /** NumericValue doubleValue. */ + public doubleValue?: (number|null); + + /** NumericValue oneValue. */ + public oneValue?: ("int64Value"|"doubleValue"); + + /** + * Creates a new NumericValue instance using the specified properties. + * @param [properties] Properties to set + * @returns NumericValue instance + */ + public static create(properties?: google.analytics.admin.v1beta.INumericValue): google.analytics.admin.v1beta.NumericValue; + + /** + * Encodes the specified NumericValue message. Does not implicitly {@link google.analytics.admin.v1beta.NumericValue.verify|verify} messages. + * @param message NumericValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.INumericValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NumericValue message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.NumericValue.verify|verify} messages. + * @param message NumericValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.INumericValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NumericValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NumericValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.NumericValue; + + /** + * Decodes a NumericValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NumericValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.NumericValue; + + /** + * Verifies a NumericValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NumericValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NumericValue + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.NumericValue; + + /** + * Creates a plain object from a NumericValue message. Also converts values to other types if specified. + * @param message NumericValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.NumericValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NumericValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NumericValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessOrderBy. */ + interface IAccessOrderBy { + + /** AccessOrderBy metric */ + metric?: (google.analytics.admin.v1beta.AccessOrderBy.IMetricOrderBy|null); + + /** AccessOrderBy dimension */ + dimension?: (google.analytics.admin.v1beta.AccessOrderBy.IDimensionOrderBy|null); + + /** AccessOrderBy desc */ + desc?: (boolean|null); + } + + /** Represents an AccessOrderBy. */ + class AccessOrderBy implements IAccessOrderBy { + + /** + * Constructs a new AccessOrderBy. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessOrderBy); + + /** AccessOrderBy metric. */ + public metric?: (google.analytics.admin.v1beta.AccessOrderBy.IMetricOrderBy|null); + + /** AccessOrderBy dimension. */ + public dimension?: (google.analytics.admin.v1beta.AccessOrderBy.IDimensionOrderBy|null); + + /** AccessOrderBy desc. */ + public desc: boolean; + + /** AccessOrderBy oneOrderBy. */ + public oneOrderBy?: ("metric"|"dimension"); + + /** + * Creates a new AccessOrderBy instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessOrderBy instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessOrderBy): google.analytics.admin.v1beta.AccessOrderBy; + + /** + * Encodes the specified AccessOrderBy message. Does not implicitly {@link google.analytics.admin.v1beta.AccessOrderBy.verify|verify} messages. + * @param message AccessOrderBy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessOrderBy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessOrderBy message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessOrderBy.verify|verify} messages. + * @param message AccessOrderBy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessOrderBy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessOrderBy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessOrderBy; + + /** + * Decodes an AccessOrderBy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessOrderBy; + + /** + * Verifies an AccessOrderBy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessOrderBy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessOrderBy + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessOrderBy; + + /** + * Creates a plain object from an AccessOrderBy message. Also converts values to other types if specified. + * @param message AccessOrderBy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessOrderBy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessOrderBy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessOrderBy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AccessOrderBy { + + /** Properties of a MetricOrderBy. */ + interface IMetricOrderBy { + + /** MetricOrderBy metricName */ + metricName?: (string|null); + } + + /** Represents a MetricOrderBy. */ + class MetricOrderBy implements IMetricOrderBy { + + /** + * Constructs a new MetricOrderBy. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.AccessOrderBy.IMetricOrderBy); + + /** MetricOrderBy metricName. */ + public metricName: string; + + /** + * Creates a new MetricOrderBy instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricOrderBy instance + */ + public static create(properties?: google.analytics.admin.v1beta.AccessOrderBy.IMetricOrderBy): google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy; + + /** + * Encodes the specified MetricOrderBy message. Does not implicitly {@link google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy.verify|verify} messages. + * @param message MetricOrderBy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.AccessOrderBy.IMetricOrderBy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricOrderBy message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy.verify|verify} messages. + * @param message MetricOrderBy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.AccessOrderBy.IMetricOrderBy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricOrderBy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy; + + /** + * Decodes a MetricOrderBy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy; + + /** + * Verifies a MetricOrderBy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricOrderBy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricOrderBy + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy; + + /** + * Creates a plain object from a MetricOrderBy message. Also converts values to other types if specified. + * @param message MetricOrderBy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricOrderBy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricOrderBy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DimensionOrderBy. */ + interface IDimensionOrderBy { + + /** DimensionOrderBy dimensionName */ + dimensionName?: (string|null); + + /** DimensionOrderBy orderType */ + orderType?: (google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.OrderType|keyof typeof google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.OrderType|null); + } + + /** Represents a DimensionOrderBy. */ + class DimensionOrderBy implements IDimensionOrderBy { + + /** + * Constructs a new DimensionOrderBy. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.AccessOrderBy.IDimensionOrderBy); + + /** DimensionOrderBy dimensionName. */ + public dimensionName: string; + + /** DimensionOrderBy orderType. */ + public orderType: (google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.OrderType|keyof typeof google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.OrderType); + + /** + * Creates a new DimensionOrderBy instance using the specified properties. + * @param [properties] Properties to set + * @returns DimensionOrderBy instance + */ + public static create(properties?: google.analytics.admin.v1beta.AccessOrderBy.IDimensionOrderBy): google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy; + + /** + * Encodes the specified DimensionOrderBy message. Does not implicitly {@link google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.verify|verify} messages. + * @param message DimensionOrderBy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.AccessOrderBy.IDimensionOrderBy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DimensionOrderBy message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.verify|verify} messages. + * @param message DimensionOrderBy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.AccessOrderBy.IDimensionOrderBy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DimensionOrderBy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DimensionOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy; + + /** + * Decodes a DimensionOrderBy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DimensionOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy; + + /** + * Verifies a DimensionOrderBy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DimensionOrderBy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DimensionOrderBy + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy; + + /** + * Creates a plain object from a DimensionOrderBy message. Also converts values to other types if specified. + * @param message DimensionOrderBy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DimensionOrderBy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DimensionOrderBy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DimensionOrderBy { + + /** OrderType enum. */ + enum OrderType { + ORDER_TYPE_UNSPECIFIED = 0, + ALPHANUMERIC = 1, + CASE_INSENSITIVE_ALPHANUMERIC = 2, + NUMERIC = 3 + } + } + } + + /** Properties of an AccessDimensionHeader. */ + interface IAccessDimensionHeader { + + /** AccessDimensionHeader dimensionName */ + dimensionName?: (string|null); + } + + /** Represents an AccessDimensionHeader. */ + class AccessDimensionHeader implements IAccessDimensionHeader { + + /** + * Constructs a new AccessDimensionHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessDimensionHeader); + + /** AccessDimensionHeader dimensionName. */ + public dimensionName: string; + + /** + * Creates a new AccessDimensionHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessDimensionHeader instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessDimensionHeader): google.analytics.admin.v1beta.AccessDimensionHeader; + + /** + * Encodes the specified AccessDimensionHeader message. Does not implicitly {@link google.analytics.admin.v1beta.AccessDimensionHeader.verify|verify} messages. + * @param message AccessDimensionHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessDimensionHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessDimensionHeader message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessDimensionHeader.verify|verify} messages. + * @param message AccessDimensionHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessDimensionHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessDimensionHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessDimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessDimensionHeader; + + /** + * Decodes an AccessDimensionHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessDimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessDimensionHeader; + + /** + * Verifies an AccessDimensionHeader message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessDimensionHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessDimensionHeader + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessDimensionHeader; + + /** + * Creates a plain object from an AccessDimensionHeader message. Also converts values to other types if specified. + * @param message AccessDimensionHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessDimensionHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessDimensionHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessDimensionHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessMetricHeader. */ + interface IAccessMetricHeader { + + /** AccessMetricHeader metricName */ + metricName?: (string|null); + } + + /** Represents an AccessMetricHeader. */ + class AccessMetricHeader implements IAccessMetricHeader { + + /** + * Constructs a new AccessMetricHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessMetricHeader); + + /** AccessMetricHeader metricName. */ + public metricName: string; + + /** + * Creates a new AccessMetricHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessMetricHeader instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessMetricHeader): google.analytics.admin.v1beta.AccessMetricHeader; + + /** + * Encodes the specified AccessMetricHeader message. Does not implicitly {@link google.analytics.admin.v1beta.AccessMetricHeader.verify|verify} messages. + * @param message AccessMetricHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessMetricHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessMetricHeader message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessMetricHeader.verify|verify} messages. + * @param message AccessMetricHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessMetricHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessMetricHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessMetricHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessMetricHeader; + + /** + * Decodes an AccessMetricHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessMetricHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessMetricHeader; + + /** + * Verifies an AccessMetricHeader message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessMetricHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessMetricHeader + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessMetricHeader; + + /** + * Creates a plain object from an AccessMetricHeader message. Also converts values to other types if specified. + * @param message AccessMetricHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessMetricHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessMetricHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessMetricHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessRow. */ + interface IAccessRow { + + /** AccessRow dimensionValues */ + dimensionValues?: (google.analytics.admin.v1beta.IAccessDimensionValue[]|null); + + /** AccessRow metricValues */ + metricValues?: (google.analytics.admin.v1beta.IAccessMetricValue[]|null); + } + + /** Represents an AccessRow. */ + class AccessRow implements IAccessRow { + + /** + * Constructs a new AccessRow. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessRow); + + /** AccessRow dimensionValues. */ + public dimensionValues: google.analytics.admin.v1beta.IAccessDimensionValue[]; + + /** AccessRow metricValues. */ + public metricValues: google.analytics.admin.v1beta.IAccessMetricValue[]; + + /** + * Creates a new AccessRow instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessRow instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessRow): google.analytics.admin.v1beta.AccessRow; + + /** + * Encodes the specified AccessRow message. Does not implicitly {@link google.analytics.admin.v1beta.AccessRow.verify|verify} messages. + * @param message AccessRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessRow message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessRow.verify|verify} messages. + * @param message AccessRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessRow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessRow; + + /** + * Decodes an AccessRow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessRow; + + /** + * Verifies an AccessRow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessRow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessRow + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessRow; + + /** + * Creates a plain object from an AccessRow message. Also converts values to other types if specified. + * @param message AccessRow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessRow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessRow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessDimensionValue. */ + interface IAccessDimensionValue { + + /** AccessDimensionValue value */ + value?: (string|null); + } + + /** Represents an AccessDimensionValue. */ + class AccessDimensionValue implements IAccessDimensionValue { + + /** + * Constructs a new AccessDimensionValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessDimensionValue); + + /** AccessDimensionValue value. */ + public value: string; + + /** + * Creates a new AccessDimensionValue instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessDimensionValue instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessDimensionValue): google.analytics.admin.v1beta.AccessDimensionValue; + + /** + * Encodes the specified AccessDimensionValue message. Does not implicitly {@link google.analytics.admin.v1beta.AccessDimensionValue.verify|verify} messages. + * @param message AccessDimensionValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessDimensionValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessDimensionValue message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessDimensionValue.verify|verify} messages. + * @param message AccessDimensionValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessDimensionValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessDimensionValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessDimensionValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessDimensionValue; + + /** + * Decodes an AccessDimensionValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessDimensionValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessDimensionValue; + + /** + * Verifies an AccessDimensionValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessDimensionValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessDimensionValue + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessDimensionValue; + + /** + * Creates a plain object from an AccessDimensionValue message. Also converts values to other types if specified. + * @param message AccessDimensionValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessDimensionValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessDimensionValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessDimensionValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessMetricValue. */ + interface IAccessMetricValue { + + /** AccessMetricValue value */ + value?: (string|null); + } + + /** Represents an AccessMetricValue. */ + class AccessMetricValue implements IAccessMetricValue { + + /** + * Constructs a new AccessMetricValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessMetricValue); + + /** AccessMetricValue value. */ + public value: string; + + /** + * Creates a new AccessMetricValue instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessMetricValue instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessMetricValue): google.analytics.admin.v1beta.AccessMetricValue; + + /** + * Encodes the specified AccessMetricValue message. Does not implicitly {@link google.analytics.admin.v1beta.AccessMetricValue.verify|verify} messages. + * @param message AccessMetricValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessMetricValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessMetricValue message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessMetricValue.verify|verify} messages. + * @param message AccessMetricValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessMetricValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessMetricValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessMetricValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessMetricValue; + + /** + * Decodes an AccessMetricValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessMetricValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessMetricValue; + + /** + * Verifies an AccessMetricValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessMetricValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessMetricValue + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessMetricValue; + + /** + * Creates a plain object from an AccessMetricValue message. Also converts values to other types if specified. + * @param message AccessMetricValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessMetricValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessMetricValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessMetricValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessQuota. */ + interface IAccessQuota { + + /** AccessQuota tokensPerDay */ + tokensPerDay?: (google.analytics.admin.v1beta.IAccessQuotaStatus|null); + + /** AccessQuota tokensPerHour */ + tokensPerHour?: (google.analytics.admin.v1beta.IAccessQuotaStatus|null); + + /** AccessQuota concurrentRequests */ + concurrentRequests?: (google.analytics.admin.v1beta.IAccessQuotaStatus|null); + + /** AccessQuota serverErrorsPerProjectPerHour */ + serverErrorsPerProjectPerHour?: (google.analytics.admin.v1beta.IAccessQuotaStatus|null); + + /** AccessQuota tokensPerProjectPerHour */ + tokensPerProjectPerHour?: (google.analytics.admin.v1beta.IAccessQuotaStatus|null); + } + + /** Represents an AccessQuota. */ + class AccessQuota implements IAccessQuota { + + /** + * Constructs a new AccessQuota. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessQuota); + + /** AccessQuota tokensPerDay. */ + public tokensPerDay?: (google.analytics.admin.v1beta.IAccessQuotaStatus|null); + + /** AccessQuota tokensPerHour. */ + public tokensPerHour?: (google.analytics.admin.v1beta.IAccessQuotaStatus|null); + + /** AccessQuota concurrentRequests. */ + public concurrentRequests?: (google.analytics.admin.v1beta.IAccessQuotaStatus|null); + + /** AccessQuota serverErrorsPerProjectPerHour. */ + public serverErrorsPerProjectPerHour?: (google.analytics.admin.v1beta.IAccessQuotaStatus|null); + + /** AccessQuota tokensPerProjectPerHour. */ + public tokensPerProjectPerHour?: (google.analytics.admin.v1beta.IAccessQuotaStatus|null); + + /** + * Creates a new AccessQuota instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessQuota instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessQuota): google.analytics.admin.v1beta.AccessQuota; + + /** + * Encodes the specified AccessQuota message. Does not implicitly {@link google.analytics.admin.v1beta.AccessQuota.verify|verify} messages. + * @param message AccessQuota message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessQuota, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessQuota message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessQuota.verify|verify} messages. + * @param message AccessQuota message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessQuota, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessQuota message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessQuota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessQuota; + + /** + * Decodes an AccessQuota message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessQuota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessQuota; + + /** + * Verifies an AccessQuota message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessQuota message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessQuota + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessQuota; + + /** + * Creates a plain object from an AccessQuota message. Also converts values to other types if specified. + * @param message AccessQuota + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessQuota, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessQuota to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessQuota + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessQuotaStatus. */ + interface IAccessQuotaStatus { + + /** AccessQuotaStatus consumed */ + consumed?: (number|null); + + /** AccessQuotaStatus remaining */ + remaining?: (number|null); + } + + /** Represents an AccessQuotaStatus. */ + class AccessQuotaStatus implements IAccessQuotaStatus { + + /** + * Constructs a new AccessQuotaStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IAccessQuotaStatus); + + /** AccessQuotaStatus consumed. */ + public consumed: number; + + /** AccessQuotaStatus remaining. */ + public remaining: number; + + /** + * Creates a new AccessQuotaStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessQuotaStatus instance + */ + public static create(properties?: google.analytics.admin.v1beta.IAccessQuotaStatus): google.analytics.admin.v1beta.AccessQuotaStatus; + + /** + * Encodes the specified AccessQuotaStatus message. Does not implicitly {@link google.analytics.admin.v1beta.AccessQuotaStatus.verify|verify} messages. + * @param message AccessQuotaStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IAccessQuotaStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessQuotaStatus message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessQuotaStatus.verify|verify} messages. + * @param message AccessQuotaStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IAccessQuotaStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessQuotaStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessQuotaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.AccessQuotaStatus; + + /** + * Decodes an AccessQuotaStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessQuotaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.AccessQuotaStatus; + + /** + * Verifies an AccessQuotaStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessQuotaStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessQuotaStatus + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.AccessQuotaStatus; + + /** + * Creates a plain object from an AccessQuotaStatus message. Also converts values to other types if specified. + * @param message AccessQuotaStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.AccessQuotaStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessQuotaStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessQuotaStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Represents an AnalyticsAdminService */ class AnalyticsAdminService extends $protobuf.rpc.Service { @@ -26207,6 +28435,20 @@ export namespace google { * @returns Promise */ public getDataStream(request: google.analytics.admin.v1beta.IGetDataStreamRequest): Promise; + + /** + * Calls RunAccessReport. + * @param request RunAccessReportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RunAccessReportResponse + */ + public runAccessReport(request: google.analytics.admin.v1beta.IRunAccessReportRequest, callback: google.analytics.admin.v1beta.AnalyticsAdminService.RunAccessReportCallback): void; + + /** + * Calls RunAccessReport. + * @param request RunAccessReportRequest message or plain object + * @returns Promise + */ + public runAccessReport(request: google.analytics.admin.v1beta.IRunAccessReportRequest): Promise; } namespace AnalyticsAdminService { @@ -26539,6 +28781,291 @@ export namespace google { * @param [response] DataStream */ type GetDataStreamCallback = (error: (Error|null), response?: google.analytics.admin.v1beta.DataStream) => void; + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|runAccessReport}. + * @param error Error, if any + * @param [response] RunAccessReportResponse + */ + type RunAccessReportCallback = (error: (Error|null), response?: google.analytics.admin.v1beta.RunAccessReportResponse) => void; + } + + /** Properties of a RunAccessReportRequest. */ + interface IRunAccessReportRequest { + + /** RunAccessReportRequest entity */ + entity?: (string|null); + + /** RunAccessReportRequest dimensions */ + dimensions?: (google.analytics.admin.v1beta.IAccessDimension[]|null); + + /** RunAccessReportRequest metrics */ + metrics?: (google.analytics.admin.v1beta.IAccessMetric[]|null); + + /** RunAccessReportRequest dateRanges */ + dateRanges?: (google.analytics.admin.v1beta.IAccessDateRange[]|null); + + /** RunAccessReportRequest dimensionFilter */ + dimensionFilter?: (google.analytics.admin.v1beta.IAccessFilterExpression|null); + + /** RunAccessReportRequest metricFilter */ + metricFilter?: (google.analytics.admin.v1beta.IAccessFilterExpression|null); + + /** RunAccessReportRequest offset */ + offset?: (number|Long|string|null); + + /** RunAccessReportRequest limit */ + limit?: (number|Long|string|null); + + /** RunAccessReportRequest timeZone */ + timeZone?: (string|null); + + /** RunAccessReportRequest orderBys */ + orderBys?: (google.analytics.admin.v1beta.IAccessOrderBy[]|null); + + /** RunAccessReportRequest returnEntityQuota */ + returnEntityQuota?: (boolean|null); + } + + /** Represents a RunAccessReportRequest. */ + class RunAccessReportRequest implements IRunAccessReportRequest { + + /** + * Constructs a new RunAccessReportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IRunAccessReportRequest); + + /** RunAccessReportRequest entity. */ + public entity: string; + + /** RunAccessReportRequest dimensions. */ + public dimensions: google.analytics.admin.v1beta.IAccessDimension[]; + + /** RunAccessReportRequest metrics. */ + public metrics: google.analytics.admin.v1beta.IAccessMetric[]; + + /** RunAccessReportRequest dateRanges. */ + public dateRanges: google.analytics.admin.v1beta.IAccessDateRange[]; + + /** RunAccessReportRequest dimensionFilter. */ + public dimensionFilter?: (google.analytics.admin.v1beta.IAccessFilterExpression|null); + + /** RunAccessReportRequest metricFilter. */ + public metricFilter?: (google.analytics.admin.v1beta.IAccessFilterExpression|null); + + /** RunAccessReportRequest offset. */ + public offset: (number|Long|string); + + /** RunAccessReportRequest limit. */ + public limit: (number|Long|string); + + /** RunAccessReportRequest timeZone. */ + public timeZone: string; + + /** RunAccessReportRequest orderBys. */ + public orderBys: google.analytics.admin.v1beta.IAccessOrderBy[]; + + /** RunAccessReportRequest returnEntityQuota. */ + public returnEntityQuota: boolean; + + /** + * Creates a new RunAccessReportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAccessReportRequest instance + */ + public static create(properties?: google.analytics.admin.v1beta.IRunAccessReportRequest): google.analytics.admin.v1beta.RunAccessReportRequest; + + /** + * Encodes the specified RunAccessReportRequest message. Does not implicitly {@link google.analytics.admin.v1beta.RunAccessReportRequest.verify|verify} messages. + * @param message RunAccessReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IRunAccessReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAccessReportRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.RunAccessReportRequest.verify|verify} messages. + * @param message RunAccessReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IRunAccessReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAccessReportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAccessReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.RunAccessReportRequest; + + /** + * Decodes a RunAccessReportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAccessReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.RunAccessReportRequest; + + /** + * Verifies a RunAccessReportRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunAccessReportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAccessReportRequest + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.RunAccessReportRequest; + + /** + * Creates a plain object from a RunAccessReportRequest message. Also converts values to other types if specified. + * @param message RunAccessReportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.RunAccessReportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAccessReportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunAccessReportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunAccessReportResponse. */ + interface IRunAccessReportResponse { + + /** RunAccessReportResponse dimensionHeaders */ + dimensionHeaders?: (google.analytics.admin.v1beta.IAccessDimensionHeader[]|null); + + /** RunAccessReportResponse metricHeaders */ + metricHeaders?: (google.analytics.admin.v1beta.IAccessMetricHeader[]|null); + + /** RunAccessReportResponse rows */ + rows?: (google.analytics.admin.v1beta.IAccessRow[]|null); + + /** RunAccessReportResponse rowCount */ + rowCount?: (number|null); + + /** RunAccessReportResponse quota */ + quota?: (google.analytics.admin.v1beta.IAccessQuota|null); + } + + /** Represents a RunAccessReportResponse. */ + class RunAccessReportResponse implements IRunAccessReportResponse { + + /** + * Constructs a new RunAccessReportResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1beta.IRunAccessReportResponse); + + /** RunAccessReportResponse dimensionHeaders. */ + public dimensionHeaders: google.analytics.admin.v1beta.IAccessDimensionHeader[]; + + /** RunAccessReportResponse metricHeaders. */ + public metricHeaders: google.analytics.admin.v1beta.IAccessMetricHeader[]; + + /** RunAccessReportResponse rows. */ + public rows: google.analytics.admin.v1beta.IAccessRow[]; + + /** RunAccessReportResponse rowCount. */ + public rowCount: number; + + /** RunAccessReportResponse quota. */ + public quota?: (google.analytics.admin.v1beta.IAccessQuota|null); + + /** + * Creates a new RunAccessReportResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAccessReportResponse instance + */ + public static create(properties?: google.analytics.admin.v1beta.IRunAccessReportResponse): google.analytics.admin.v1beta.RunAccessReportResponse; + + /** + * Encodes the specified RunAccessReportResponse message. Does not implicitly {@link google.analytics.admin.v1beta.RunAccessReportResponse.verify|verify} messages. + * @param message RunAccessReportResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1beta.IRunAccessReportResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAccessReportResponse message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.RunAccessReportResponse.verify|verify} messages. + * @param message RunAccessReportResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1beta.IRunAccessReportResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAccessReportResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAccessReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1beta.RunAccessReportResponse; + + /** + * Decodes a RunAccessReportResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAccessReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1beta.RunAccessReportResponse; + + /** + * Verifies a RunAccessReportResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunAccessReportResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAccessReportResponse + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1beta.RunAccessReportResponse; + + /** + * Creates a plain object from a RunAccessReportResponse message. Also converts values to other types if specified. + * @param message RunAccessReportResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1beta.RunAccessReportResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAccessReportResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunAccessReportResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetAccountRequest. */ diff --git a/packages/google-analytics-admin/protos/protos.js b/packages/google-analytics-admin/protos/protos.js index f868ad92faa..7ccb0fa0b97 100644 --- a/packages/google-analytics-admin/protos/protos.js +++ b/packages/google-analytics-admin/protos/protos.js @@ -59545,1590 +59545,7835 @@ */ var v1beta = {}; - v1beta.AnalyticsAdminService = (function() { + v1beta.AccessDimension = (function() { /** - * Constructs a new AnalyticsAdminService service. + * Properties of an AccessDimension. * @memberof google.analytics.admin.v1beta - * @classdesc Represents an AnalyticsAdminService - * @extends $protobuf.rpc.Service + * @interface IAccessDimension + * @property {string|null} [dimensionName] AccessDimension dimensionName + */ + + /** + * Constructs a new AccessDimension. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessDimension. + * @implements IAccessDimension * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @param {google.analytics.admin.v1beta.IAccessDimension=} [properties] Properties to set */ - function AnalyticsAdminService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function AccessDimension(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (AnalyticsAdminService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AnalyticsAdminService; + /** + * AccessDimension dimensionName. + * @member {string} dimensionName + * @memberof google.analytics.admin.v1beta.AccessDimension + * @instance + */ + AccessDimension.prototype.dimensionName = ""; /** - * Creates new AnalyticsAdminService service using the specified rpc implementation. + * Creates a new AccessDimension instance using the specified properties. * @function create - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @memberof google.analytics.admin.v1beta.AccessDimension * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {AnalyticsAdminService} RPC service. Useful where requests and/or responses are streamed. + * @param {google.analytics.admin.v1beta.IAccessDimension=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessDimension} AccessDimension instance */ - AnalyticsAdminService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + AccessDimension.create = function create(properties) { + return new AccessDimension(properties); }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getAccount}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef GetAccountCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.Account} [response] Account + * Encodes the specified AccessDimension message. Does not implicitly {@link google.analytics.admin.v1beta.AccessDimension.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessDimension + * @static + * @param {google.analytics.admin.v1beta.IAccessDimension} message AccessDimension message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AccessDimension.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dimensionName != null && Object.hasOwnProperty.call(message, "dimensionName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dimensionName); + return writer; + }; /** - * Calls GetAccount. - * @function getAccount - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IGetAccountRequest} request GetAccountRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetAccountCallback} callback Node-style callback called with the error, if any, and Account - * @returns {undefined} - * @variation 1 + * Encodes the specified AccessDimension message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessDimension.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessDimension + * @static + * @param {google.analytics.admin.v1beta.IAccessDimension} message AccessDimension message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AnalyticsAdminService.prototype.getAccount = function getAccount(request, callback) { - return this.rpcCall(getAccount, $root.google.analytics.admin.v1beta.GetAccountRequest, $root.google.analytics.admin.v1beta.Account, request, callback); - }, "name", { value: "GetAccount" }); + AccessDimension.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls GetAccount. - * @function getAccount - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IGetAccountRequest} request GetAccountRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an AccessDimension message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessDimension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessDimension} AccessDimension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AccessDimension.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessDimension(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dimensionName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listAccounts}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef ListAccountsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.ListAccountsResponse} [response] ListAccountsResponse + * Decodes an AccessDimension message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessDimension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessDimension} AccessDimension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AccessDimension.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ListAccounts. - * @function listAccounts - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IListAccountsRequest} request ListAccountsRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListAccountsCallback} callback Node-style callback called with the error, if any, and ListAccountsResponse - * @returns {undefined} - * @variation 1 + * Verifies an AccessDimension message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessDimension + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(AnalyticsAdminService.prototype.listAccounts = function listAccounts(request, callback) { - return this.rpcCall(listAccounts, $root.google.analytics.admin.v1beta.ListAccountsRequest, $root.google.analytics.admin.v1beta.ListAccountsResponse, request, callback); - }, "name", { value: "ListAccounts" }); + AccessDimension.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dimensionName != null && message.hasOwnProperty("dimensionName")) + if (!$util.isString(message.dimensionName)) + return "dimensionName: string expected"; + return null; + }; /** - * Calls ListAccounts. - * @function listAccounts - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IListAccountsRequest} request ListAccountsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates an AccessDimension message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessDimension + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessDimension} AccessDimension */ + AccessDimension.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessDimension) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessDimension(); + if (object.dimensionName != null) + message.dimensionName = String(object.dimensionName); + return message; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|deleteAccount}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef DeleteAccountCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Creates a plain object from an AccessDimension message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessDimension + * @static + * @param {google.analytics.admin.v1beta.AccessDimension} message AccessDimension + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + AccessDimension.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dimensionName = ""; + if (message.dimensionName != null && message.hasOwnProperty("dimensionName")) + object.dimensionName = message.dimensionName; + return object; + }; /** - * Calls DeleteAccount. - * @function deleteAccount - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * Converts this AccessDimension to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessDimension * @instance - * @param {google.analytics.admin.v1beta.IDeleteAccountRequest} request DeleteAccountRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.DeleteAccountCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(AnalyticsAdminService.prototype.deleteAccount = function deleteAccount(request, callback) { - return this.rpcCall(deleteAccount, $root.google.analytics.admin.v1beta.DeleteAccountRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteAccount" }); + AccessDimension.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls DeleteAccount. - * @function deleteAccount - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IDeleteAccountRequest} request DeleteAccountRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for AccessDimension + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessDimension + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + AccessDimension.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessDimension"; + }; + + return AccessDimension; + })(); + + v1beta.AccessMetric = (function() { /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateAccount}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef UpdateAccountCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.Account} [response] Account + * Properties of an AccessMetric. + * @memberof google.analytics.admin.v1beta + * @interface IAccessMetric + * @property {string|null} [metricName] AccessMetric metricName */ /** - * Calls UpdateAccount. - * @function updateAccount - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IUpdateAccountRequest} request UpdateAccountRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdateAccountCallback} callback Node-style callback called with the error, if any, and Account - * @returns {undefined} - * @variation 1 + * Constructs a new AccessMetric. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessMetric. + * @implements IAccessMetric + * @constructor + * @param {google.analytics.admin.v1beta.IAccessMetric=} [properties] Properties to set */ - Object.defineProperty(AnalyticsAdminService.prototype.updateAccount = function updateAccount(request, callback) { - return this.rpcCall(updateAccount, $root.google.analytics.admin.v1beta.UpdateAccountRequest, $root.google.analytics.admin.v1beta.Account, request, callback); - }, "name", { value: "UpdateAccount" }); + function AccessMetric(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls UpdateAccount. - * @function updateAccount - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessMetric metricName. + * @member {string} metricName + * @memberof google.analytics.admin.v1beta.AccessMetric * @instance - * @param {google.analytics.admin.v1beta.IUpdateAccountRequest} request UpdateAccountRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + AccessMetric.prototype.metricName = ""; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|provisionAccountTicket}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef ProvisionAccountTicketCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.ProvisionAccountTicketResponse} [response] ProvisionAccountTicketResponse + * Creates a new AccessMetric instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessMetric + * @static + * @param {google.analytics.admin.v1beta.IAccessMetric=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessMetric} AccessMetric instance */ + AccessMetric.create = function create(properties) { + return new AccessMetric(properties); + }; /** - * Calls ProvisionAccountTicket. - * @function provisionAccountTicket - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IProvisionAccountTicketRequest} request ProvisionAccountTicketRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ProvisionAccountTicketCallback} callback Node-style callback called with the error, if any, and ProvisionAccountTicketResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified AccessMetric message. Does not implicitly {@link google.analytics.admin.v1beta.AccessMetric.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessMetric + * @static + * @param {google.analytics.admin.v1beta.IAccessMetric} message AccessMetric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AnalyticsAdminService.prototype.provisionAccountTicket = function provisionAccountTicket(request, callback) { - return this.rpcCall(provisionAccountTicket, $root.google.analytics.admin.v1beta.ProvisionAccountTicketRequest, $root.google.analytics.admin.v1beta.ProvisionAccountTicketResponse, request, callback); - }, "name", { value: "ProvisionAccountTicket" }); + AccessMetric.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); + return writer; + }; /** - * Calls ProvisionAccountTicket. - * @function provisionAccountTicket - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IProvisionAccountTicketRequest} request ProvisionAccountTicketRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified AccessMetric message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessMetric.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessMetric + * @static + * @param {google.analytics.admin.v1beta.IAccessMetric} message AccessMetric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AccessMetric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listAccountSummaries}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef ListAccountSummariesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.ListAccountSummariesResponse} [response] ListAccountSummariesResponse + * Decodes an AccessMetric message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessMetric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessMetric} AccessMetric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AccessMetric.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessMetric(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metricName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls ListAccountSummaries. - * @function listAccountSummaries - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IListAccountSummariesRequest} request ListAccountSummariesRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListAccountSummariesCallback} callback Node-style callback called with the error, if any, and ListAccountSummariesResponse - * @returns {undefined} - * @variation 1 + * Decodes an AccessMetric message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessMetric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessMetric} AccessMetric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(AnalyticsAdminService.prototype.listAccountSummaries = function listAccountSummaries(request, callback) { - return this.rpcCall(listAccountSummaries, $root.google.analytics.admin.v1beta.ListAccountSummariesRequest, $root.google.analytics.admin.v1beta.ListAccountSummariesResponse, request, callback); - }, "name", { value: "ListAccountSummaries" }); + AccessMetric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ListAccountSummaries. - * @function listAccountSummaries - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IListAccountSummariesRequest} request ListAccountSummariesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies an AccessMetric message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessMetric + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + AccessMetric.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metricName != null && message.hasOwnProperty("metricName")) + if (!$util.isString(message.metricName)) + return "metricName: string expected"; + return null; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getProperty}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef GetPropertyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.Property} [response] Property + * Creates an AccessMetric message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessMetric + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessMetric} AccessMetric */ + AccessMetric.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessMetric) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessMetric(); + if (object.metricName != null) + message.metricName = String(object.metricName); + return message; + }; /** - * Calls GetProperty. - * @function getProperty - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IGetPropertyRequest} request GetPropertyRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetPropertyCallback} callback Node-style callback called with the error, if any, and Property - * @returns {undefined} - * @variation 1 + * Creates a plain object from an AccessMetric message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessMetric + * @static + * @param {google.analytics.admin.v1beta.AccessMetric} message AccessMetric + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(AnalyticsAdminService.prototype.getProperty = function getProperty(request, callback) { - return this.rpcCall(getProperty, $root.google.analytics.admin.v1beta.GetPropertyRequest, $root.google.analytics.admin.v1beta.Property, request, callback); - }, "name", { value: "GetProperty" }); + AccessMetric.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metricName = ""; + if (message.metricName != null && message.hasOwnProperty("metricName")) + object.metricName = message.metricName; + return object; + }; /** - * Calls GetProperty. - * @function getProperty - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * Converts this AccessMetric to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessMetric * @instance - * @param {google.analytics.admin.v1beta.IGetPropertyRequest} request GetPropertyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + AccessMetric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listProperties}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef ListPropertiesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.ListPropertiesResponse} [response] ListPropertiesResponse + * Gets the default type url for AccessMetric + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessMetric + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + AccessMetric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessMetric"; + }; + + return AccessMetric; + })(); + + v1beta.AccessDateRange = (function() { /** - * Calls ListProperties. - * @function listProperties - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IListPropertiesRequest} request ListPropertiesRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListPropertiesCallback} callback Node-style callback called with the error, if any, and ListPropertiesResponse - * @returns {undefined} - * @variation 1 + * Properties of an AccessDateRange. + * @memberof google.analytics.admin.v1beta + * @interface IAccessDateRange + * @property {string|null} [startDate] AccessDateRange startDate + * @property {string|null} [endDate] AccessDateRange endDate */ - Object.defineProperty(AnalyticsAdminService.prototype.listProperties = function listProperties(request, callback) { - return this.rpcCall(listProperties, $root.google.analytics.admin.v1beta.ListPropertiesRequest, $root.google.analytics.admin.v1beta.ListPropertiesResponse, request, callback); - }, "name", { value: "ListProperties" }); /** - * Calls ListProperties. - * @function listProperties - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IListPropertiesRequest} request ListPropertiesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Constructs a new AccessDateRange. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessDateRange. + * @implements IAccessDateRange + * @constructor + * @param {google.analytics.admin.v1beta.IAccessDateRange=} [properties] Properties to set */ + function AccessDateRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createProperty}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef CreatePropertyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.Property} [response] Property + * AccessDateRange startDate. + * @member {string} startDate + * @memberof google.analytics.admin.v1beta.AccessDateRange + * @instance */ + AccessDateRange.prototype.startDate = ""; /** - * Calls CreateProperty. - * @function createProperty - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessDateRange endDate. + * @member {string} endDate + * @memberof google.analytics.admin.v1beta.AccessDateRange * @instance - * @param {google.analytics.admin.v1beta.ICreatePropertyRequest} request CreatePropertyRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreatePropertyCallback} callback Node-style callback called with the error, if any, and Property - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AnalyticsAdminService.prototype.createProperty = function createProperty(request, callback) { - return this.rpcCall(createProperty, $root.google.analytics.admin.v1beta.CreatePropertyRequest, $root.google.analytics.admin.v1beta.Property, request, callback); - }, "name", { value: "CreateProperty" }); + AccessDateRange.prototype.endDate = ""; /** - * Calls CreateProperty. - * @function createProperty - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.ICreatePropertyRequest} request CreatePropertyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new AccessDateRange instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessDateRange + * @static + * @param {google.analytics.admin.v1beta.IAccessDateRange=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessDateRange} AccessDateRange instance */ + AccessDateRange.create = function create(properties) { + return new AccessDateRange(properties); + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|deleteProperty}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef DeletePropertyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.Property} [response] Property + * Encodes the specified AccessDateRange message. Does not implicitly {@link google.analytics.admin.v1beta.AccessDateRange.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessDateRange + * @static + * @param {google.analytics.admin.v1beta.IAccessDateRange} message AccessDateRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AccessDateRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.startDate); + if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.endDate); + return writer; + }; /** - * Calls DeleteProperty. - * @function deleteProperty - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IDeletePropertyRequest} request DeletePropertyRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.DeletePropertyCallback} callback Node-style callback called with the error, if any, and Property - * @returns {undefined} - * @variation 1 + * Encodes the specified AccessDateRange message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessDateRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessDateRange + * @static + * @param {google.analytics.admin.v1beta.IAccessDateRange} message AccessDateRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AnalyticsAdminService.prototype.deleteProperty = function deleteProperty(request, callback) { - return this.rpcCall(deleteProperty, $root.google.analytics.admin.v1beta.DeletePropertyRequest, $root.google.analytics.admin.v1beta.Property, request, callback); - }, "name", { value: "DeleteProperty" }); + AccessDateRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls DeleteProperty. - * @function deleteProperty - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IDeletePropertyRequest} request DeletePropertyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an AccessDateRange message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessDateRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessDateRange} AccessDateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AccessDateRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessDateRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startDate = reader.string(); + break; + } + case 2: { + message.endDate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateProperty}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef UpdatePropertyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.Property} [response] Property + * Decodes an AccessDateRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessDateRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessDateRange} AccessDateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AccessDateRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls UpdateProperty. - * @function updateProperty - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IUpdatePropertyRequest} request UpdatePropertyRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdatePropertyCallback} callback Node-style callback called with the error, if any, and Property - * @returns {undefined} - * @variation 1 + * Verifies an AccessDateRange message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessDateRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(AnalyticsAdminService.prototype.updateProperty = function updateProperty(request, callback) { - return this.rpcCall(updateProperty, $root.google.analytics.admin.v1beta.UpdatePropertyRequest, $root.google.analytics.admin.v1beta.Property, request, callback); - }, "name", { value: "UpdateProperty" }); + AccessDateRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startDate != null && message.hasOwnProperty("startDate")) + if (!$util.isString(message.startDate)) + return "startDate: string expected"; + if (message.endDate != null && message.hasOwnProperty("endDate")) + if (!$util.isString(message.endDate)) + return "endDate: string expected"; + return null; + }; /** - * Calls UpdateProperty. - * @function updateProperty - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IUpdatePropertyRequest} request UpdatePropertyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates an AccessDateRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessDateRange + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessDateRange} AccessDateRange */ + AccessDateRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessDateRange) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessDateRange(); + if (object.startDate != null) + message.startDate = String(object.startDate); + if (object.endDate != null) + message.endDate = String(object.endDate); + return message; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createFirebaseLink}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef CreateFirebaseLinkCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.FirebaseLink} [response] FirebaseLink + * Creates a plain object from an AccessDateRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessDateRange + * @static + * @param {google.analytics.admin.v1beta.AccessDateRange} message AccessDateRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + AccessDateRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startDate = ""; + object.endDate = ""; + } + if (message.startDate != null && message.hasOwnProperty("startDate")) + object.startDate = message.startDate; + if (message.endDate != null && message.hasOwnProperty("endDate")) + object.endDate = message.endDate; + return object; + }; /** - * Calls CreateFirebaseLink. - * @function createFirebaseLink - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * Converts this AccessDateRange to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessDateRange * @instance - * @param {google.analytics.admin.v1beta.ICreateFirebaseLinkRequest} request CreateFirebaseLinkRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreateFirebaseLinkCallback} callback Node-style callback called with the error, if any, and FirebaseLink - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(AnalyticsAdminService.prototype.createFirebaseLink = function createFirebaseLink(request, callback) { - return this.rpcCall(createFirebaseLink, $root.google.analytics.admin.v1beta.CreateFirebaseLinkRequest, $root.google.analytics.admin.v1beta.FirebaseLink, request, callback); - }, "name", { value: "CreateFirebaseLink" }); + AccessDateRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls CreateFirebaseLink. - * @function createFirebaseLink - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.ICreateFirebaseLinkRequest} request CreateFirebaseLinkRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for AccessDateRange + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessDateRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + AccessDateRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessDateRange"; + }; + + return AccessDateRange; + })(); + + v1beta.AccessFilterExpression = (function() { /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|deleteFirebaseLink}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef DeleteFirebaseLinkCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Properties of an AccessFilterExpression. + * @memberof google.analytics.admin.v1beta + * @interface IAccessFilterExpression + * @property {google.analytics.admin.v1beta.IAccessFilterExpressionList|null} [andGroup] AccessFilterExpression andGroup + * @property {google.analytics.admin.v1beta.IAccessFilterExpressionList|null} [orGroup] AccessFilterExpression orGroup + * @property {google.analytics.admin.v1beta.IAccessFilterExpression|null} [notExpression] AccessFilterExpression notExpression + * @property {google.analytics.admin.v1beta.IAccessFilter|null} [accessFilter] AccessFilterExpression accessFilter */ /** - * Calls DeleteFirebaseLink. - * @function deleteFirebaseLink - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest} request DeleteFirebaseLinkRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.DeleteFirebaseLinkCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Constructs a new AccessFilterExpression. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessFilterExpression. + * @implements IAccessFilterExpression + * @constructor + * @param {google.analytics.admin.v1beta.IAccessFilterExpression=} [properties] Properties to set */ - Object.defineProperty(AnalyticsAdminService.prototype.deleteFirebaseLink = function deleteFirebaseLink(request, callback) { - return this.rpcCall(deleteFirebaseLink, $root.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteFirebaseLink" }); + function AccessFilterExpression(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls DeleteFirebaseLink. - * @function deleteFirebaseLink - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessFilterExpression andGroup. + * @member {google.analytics.admin.v1beta.IAccessFilterExpressionList|null|undefined} andGroup + * @memberof google.analytics.admin.v1beta.AccessFilterExpression * @instance - * @param {google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest} request DeleteFirebaseLinkRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + AccessFilterExpression.prototype.andGroup = null; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listFirebaseLinks}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef ListFirebaseLinksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.ListFirebaseLinksResponse} [response] ListFirebaseLinksResponse + * AccessFilterExpression orGroup. + * @member {google.analytics.admin.v1beta.IAccessFilterExpressionList|null|undefined} orGroup + * @memberof google.analytics.admin.v1beta.AccessFilterExpression + * @instance */ + AccessFilterExpression.prototype.orGroup = null; /** - * Calls ListFirebaseLinks. - * @function listFirebaseLinks - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessFilterExpression notExpression. + * @member {google.analytics.admin.v1beta.IAccessFilterExpression|null|undefined} notExpression + * @memberof google.analytics.admin.v1beta.AccessFilterExpression * @instance - * @param {google.analytics.admin.v1beta.IListFirebaseLinksRequest} request ListFirebaseLinksRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListFirebaseLinksCallback} callback Node-style callback called with the error, if any, and ListFirebaseLinksResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AnalyticsAdminService.prototype.listFirebaseLinks = function listFirebaseLinks(request, callback) { - return this.rpcCall(listFirebaseLinks, $root.google.analytics.admin.v1beta.ListFirebaseLinksRequest, $root.google.analytics.admin.v1beta.ListFirebaseLinksResponse, request, callback); - }, "name", { value: "ListFirebaseLinks" }); + AccessFilterExpression.prototype.notExpression = null; /** - * Calls ListFirebaseLinks. - * @function listFirebaseLinks - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessFilterExpression accessFilter. + * @member {google.analytics.admin.v1beta.IAccessFilter|null|undefined} accessFilter + * @memberof google.analytics.admin.v1beta.AccessFilterExpression * @instance - * @param {google.analytics.admin.v1beta.IListFirebaseLinksRequest} request ListFirebaseLinksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + AccessFilterExpression.prototype.accessFilter = null; - /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createGoogleAdsLink}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef CreateGoogleAdsLinkCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.GoogleAdsLink} [response] GoogleAdsLink - */ + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Calls CreateGoogleAdsLink. - * @function createGoogleAdsLink - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessFilterExpression oneExpression. + * @member {"andGroup"|"orGroup"|"notExpression"|"accessFilter"|undefined} oneExpression + * @memberof google.analytics.admin.v1beta.AccessFilterExpression * @instance - * @param {google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest} request CreateGoogleAdsLinkRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreateGoogleAdsLinkCallback} callback Node-style callback called with the error, if any, and GoogleAdsLink - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AnalyticsAdminService.prototype.createGoogleAdsLink = function createGoogleAdsLink(request, callback) { - return this.rpcCall(createGoogleAdsLink, $root.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest, $root.google.analytics.admin.v1beta.GoogleAdsLink, request, callback); - }, "name", { value: "CreateGoogleAdsLink" }); + Object.defineProperty(AccessFilterExpression.prototype, "oneExpression", { + get: $util.oneOfGetter($oneOfFields = ["andGroup", "orGroup", "notExpression", "accessFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Calls CreateGoogleAdsLink. - * @function createGoogleAdsLink - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest} request CreateGoogleAdsLinkRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new AccessFilterExpression instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessFilterExpression + * @static + * @param {google.analytics.admin.v1beta.IAccessFilterExpression=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessFilterExpression} AccessFilterExpression instance */ + AccessFilterExpression.create = function create(properties) { + return new AccessFilterExpression(properties); + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateGoogleAdsLink}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef UpdateGoogleAdsLinkCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.GoogleAdsLink} [response] GoogleAdsLink + * Encodes the specified AccessFilterExpression message. Does not implicitly {@link google.analytics.admin.v1beta.AccessFilterExpression.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessFilterExpression + * @static + * @param {google.analytics.admin.v1beta.IAccessFilterExpression} message AccessFilterExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AccessFilterExpression.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.andGroup != null && Object.hasOwnProperty.call(message, "andGroup")) + $root.google.analytics.admin.v1beta.AccessFilterExpressionList.encode(message.andGroup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.orGroup != null && Object.hasOwnProperty.call(message, "orGroup")) + $root.google.analytics.admin.v1beta.AccessFilterExpressionList.encode(message.orGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.notExpression != null && Object.hasOwnProperty.call(message, "notExpression")) + $root.google.analytics.admin.v1beta.AccessFilterExpression.encode(message.notExpression, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.accessFilter != null && Object.hasOwnProperty.call(message, "accessFilter")) + $root.google.analytics.admin.v1beta.AccessFilter.encode(message.accessFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; /** - * Calls UpdateGoogleAdsLink. - * @function updateGoogleAdsLink - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest} request UpdateGoogleAdsLinkRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdateGoogleAdsLinkCallback} callback Node-style callback called with the error, if any, and GoogleAdsLink - * @returns {undefined} - * @variation 1 + * Encodes the specified AccessFilterExpression message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessFilterExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessFilterExpression + * @static + * @param {google.analytics.admin.v1beta.IAccessFilterExpression} message AccessFilterExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AnalyticsAdminService.prototype.updateGoogleAdsLink = function updateGoogleAdsLink(request, callback) { - return this.rpcCall(updateGoogleAdsLink, $root.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest, $root.google.analytics.admin.v1beta.GoogleAdsLink, request, callback); - }, "name", { value: "UpdateGoogleAdsLink" }); + AccessFilterExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls UpdateGoogleAdsLink. - * @function updateGoogleAdsLink - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest} request UpdateGoogleAdsLinkRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an AccessFilterExpression message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessFilterExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessFilterExpression} AccessFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AccessFilterExpression.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessFilterExpression(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.andGroup = $root.google.analytics.admin.v1beta.AccessFilterExpressionList.decode(reader, reader.uint32()); + break; + } + case 2: { + message.orGroup = $root.google.analytics.admin.v1beta.AccessFilterExpressionList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.notExpression = $root.google.analytics.admin.v1beta.AccessFilterExpression.decode(reader, reader.uint32()); + break; + } + case 4: { + message.accessFilter = $root.google.analytics.admin.v1beta.AccessFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|deleteGoogleAdsLink}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef DeleteGoogleAdsLinkCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Decodes an AccessFilterExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessFilterExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessFilterExpression} AccessFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AccessFilterExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls DeleteGoogleAdsLink. - * @function deleteGoogleAdsLink - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest} request DeleteGoogleAdsLinkRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.DeleteGoogleAdsLinkCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Verifies an AccessFilterExpression message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessFilterExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(AnalyticsAdminService.prototype.deleteGoogleAdsLink = function deleteGoogleAdsLink(request, callback) { - return this.rpcCall(deleteGoogleAdsLink, $root.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteGoogleAdsLink" }); + AccessFilterExpression.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.andGroup != null && message.hasOwnProperty("andGroup")) { + properties.oneExpression = 1; + { + var error = $root.google.analytics.admin.v1beta.AccessFilterExpressionList.verify(message.andGroup); + if (error) + return "andGroup." + error; + } + } + if (message.orGroup != null && message.hasOwnProperty("orGroup")) { + if (properties.oneExpression === 1) + return "oneExpression: multiple values"; + properties.oneExpression = 1; + { + var error = $root.google.analytics.admin.v1beta.AccessFilterExpressionList.verify(message.orGroup); + if (error) + return "orGroup." + error; + } + } + if (message.notExpression != null && message.hasOwnProperty("notExpression")) { + if (properties.oneExpression === 1) + return "oneExpression: multiple values"; + properties.oneExpression = 1; + { + var error = $root.google.analytics.admin.v1beta.AccessFilterExpression.verify(message.notExpression); + if (error) + return "notExpression." + error; + } + } + if (message.accessFilter != null && message.hasOwnProperty("accessFilter")) { + if (properties.oneExpression === 1) + return "oneExpression: multiple values"; + properties.oneExpression = 1; + { + var error = $root.google.analytics.admin.v1beta.AccessFilter.verify(message.accessFilter); + if (error) + return "accessFilter." + error; + } + } + return null; + }; /** - * Calls DeleteGoogleAdsLink. - * @function deleteGoogleAdsLink - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest} request DeleteGoogleAdsLinkRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates an AccessFilterExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessFilterExpression + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessFilterExpression} AccessFilterExpression */ + AccessFilterExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessFilterExpression) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessFilterExpression(); + if (object.andGroup != null) { + if (typeof object.andGroup !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessFilterExpression.andGroup: object expected"); + message.andGroup = $root.google.analytics.admin.v1beta.AccessFilterExpressionList.fromObject(object.andGroup); + } + if (object.orGroup != null) { + if (typeof object.orGroup !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessFilterExpression.orGroup: object expected"); + message.orGroup = $root.google.analytics.admin.v1beta.AccessFilterExpressionList.fromObject(object.orGroup); + } + if (object.notExpression != null) { + if (typeof object.notExpression !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessFilterExpression.notExpression: object expected"); + message.notExpression = $root.google.analytics.admin.v1beta.AccessFilterExpression.fromObject(object.notExpression); + } + if (object.accessFilter != null) { + if (typeof object.accessFilter !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessFilterExpression.accessFilter: object expected"); + message.accessFilter = $root.google.analytics.admin.v1beta.AccessFilter.fromObject(object.accessFilter); + } + return message; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listGoogleAdsLinks}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef ListGoogleAdsLinksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.ListGoogleAdsLinksResponse} [response] ListGoogleAdsLinksResponse + * Creates a plain object from an AccessFilterExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessFilterExpression + * @static + * @param {google.analytics.admin.v1beta.AccessFilterExpression} message AccessFilterExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + AccessFilterExpression.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.andGroup != null && message.hasOwnProperty("andGroup")) { + object.andGroup = $root.google.analytics.admin.v1beta.AccessFilterExpressionList.toObject(message.andGroup, options); + if (options.oneofs) + object.oneExpression = "andGroup"; + } + if (message.orGroup != null && message.hasOwnProperty("orGroup")) { + object.orGroup = $root.google.analytics.admin.v1beta.AccessFilterExpressionList.toObject(message.orGroup, options); + if (options.oneofs) + object.oneExpression = "orGroup"; + } + if (message.notExpression != null && message.hasOwnProperty("notExpression")) { + object.notExpression = $root.google.analytics.admin.v1beta.AccessFilterExpression.toObject(message.notExpression, options); + if (options.oneofs) + object.oneExpression = "notExpression"; + } + if (message.accessFilter != null && message.hasOwnProperty("accessFilter")) { + object.accessFilter = $root.google.analytics.admin.v1beta.AccessFilter.toObject(message.accessFilter, options); + if (options.oneofs) + object.oneExpression = "accessFilter"; + } + return object; + }; /** - * Calls ListGoogleAdsLinks. - * @function listGoogleAdsLinks - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IListGoogleAdsLinksRequest} request ListGoogleAdsLinksRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListGoogleAdsLinksCallback} callback Node-style callback called with the error, if any, and ListGoogleAdsLinksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AnalyticsAdminService.prototype.listGoogleAdsLinks = function listGoogleAdsLinks(request, callback) { - return this.rpcCall(listGoogleAdsLinks, $root.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest, $root.google.analytics.admin.v1beta.ListGoogleAdsLinksResponse, request, callback); - }, "name", { value: "ListGoogleAdsLinks" }); - - /** - * Calls ListGoogleAdsLinks. - * @function listGoogleAdsLinks - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * Converts this AccessFilterExpression to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessFilterExpression * @instance - * @param {google.analytics.admin.v1beta.IListGoogleAdsLinksRequest} request ListGoogleAdsLinksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + AccessFilterExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getDataSharingSettings}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef GetDataSharingSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.DataSharingSettings} [response] DataSharingSettings + * Gets the default type url for AccessFilterExpression + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessFilterExpression + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + AccessFilterExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessFilterExpression"; + }; - /** - * Calls GetDataSharingSettings. - * @function getDataSharingSettings - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IGetDataSharingSettingsRequest} request GetDataSharingSettingsRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetDataSharingSettingsCallback} callback Node-style callback called with the error, if any, and DataSharingSettings - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AnalyticsAdminService.prototype.getDataSharingSettings = function getDataSharingSettings(request, callback) { - return this.rpcCall(getDataSharingSettings, $root.google.analytics.admin.v1beta.GetDataSharingSettingsRequest, $root.google.analytics.admin.v1beta.DataSharingSettings, request, callback); - }, "name", { value: "GetDataSharingSettings" }); + return AccessFilterExpression; + })(); - /** - * Calls GetDataSharingSettings. - * @function getDataSharingSettings - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IGetDataSharingSettingsRequest} request GetDataSharingSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + v1beta.AccessFilterExpressionList = (function() { /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getMeasurementProtocolSecret}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef GetMeasurementProtocolSecretCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.MeasurementProtocolSecret} [response] MeasurementProtocolSecret + * Properties of an AccessFilterExpressionList. + * @memberof google.analytics.admin.v1beta + * @interface IAccessFilterExpressionList + * @property {Array.|null} [expressions] AccessFilterExpressionList expressions */ /** - * Calls GetMeasurementProtocolSecret. - * @function getMeasurementProtocolSecret - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest} request GetMeasurementProtocolSecretRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetMeasurementProtocolSecretCallback} callback Node-style callback called with the error, if any, and MeasurementProtocolSecret - * @returns {undefined} - * @variation 1 + * Constructs a new AccessFilterExpressionList. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessFilterExpressionList. + * @implements IAccessFilterExpressionList + * @constructor + * @param {google.analytics.admin.v1beta.IAccessFilterExpressionList=} [properties] Properties to set */ - Object.defineProperty(AnalyticsAdminService.prototype.getMeasurementProtocolSecret = function getMeasurementProtocolSecret(request, callback) { - return this.rpcCall(getMeasurementProtocolSecret, $root.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest, $root.google.analytics.admin.v1beta.MeasurementProtocolSecret, request, callback); - }, "name", { value: "GetMeasurementProtocolSecret" }); + function AccessFilterExpressionList(properties) { + this.expressions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls GetMeasurementProtocolSecret. - * @function getMeasurementProtocolSecret - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessFilterExpressionList expressions. + * @member {Array.} expressions + * @memberof google.analytics.admin.v1beta.AccessFilterExpressionList * @instance - * @param {google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest} request GetMeasurementProtocolSecretRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + AccessFilterExpressionList.prototype.expressions = $util.emptyArray; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listMeasurementProtocolSecrets}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef ListMeasurementProtocolSecretsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.ListMeasurementProtocolSecretsResponse} [response] ListMeasurementProtocolSecretsResponse + * Creates a new AccessFilterExpressionList instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessFilterExpressionList + * @static + * @param {google.analytics.admin.v1beta.IAccessFilterExpressionList=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessFilterExpressionList} AccessFilterExpressionList instance */ + AccessFilterExpressionList.create = function create(properties) { + return new AccessFilterExpressionList(properties); + }; /** - * Calls ListMeasurementProtocolSecrets. - * @function listMeasurementProtocolSecrets - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest} request ListMeasurementProtocolSecretsRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListMeasurementProtocolSecretsCallback} callback Node-style callback called with the error, if any, and ListMeasurementProtocolSecretsResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified AccessFilterExpressionList message. Does not implicitly {@link google.analytics.admin.v1beta.AccessFilterExpressionList.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessFilterExpressionList + * @static + * @param {google.analytics.admin.v1beta.IAccessFilterExpressionList} message AccessFilterExpressionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AnalyticsAdminService.prototype.listMeasurementProtocolSecrets = function listMeasurementProtocolSecrets(request, callback) { - return this.rpcCall(listMeasurementProtocolSecrets, $root.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest, $root.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsResponse, request, callback); - }, "name", { value: "ListMeasurementProtocolSecrets" }); + AccessFilterExpressionList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expressions != null && message.expressions.length) + for (var i = 0; i < message.expressions.length; ++i) + $root.google.analytics.admin.v1beta.AccessFilterExpression.encode(message.expressions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; /** - * Calls ListMeasurementProtocolSecrets. - * @function listMeasurementProtocolSecrets - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest} request ListMeasurementProtocolSecretsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified AccessFilterExpressionList message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessFilterExpressionList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessFilterExpressionList + * @static + * @param {google.analytics.admin.v1beta.IAccessFilterExpressionList} message AccessFilterExpressionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AccessFilterExpressionList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createMeasurementProtocolSecret}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef CreateMeasurementProtocolSecretCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.MeasurementProtocolSecret} [response] MeasurementProtocolSecret + * Decodes an AccessFilterExpressionList message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessFilterExpressionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessFilterExpressionList} AccessFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AccessFilterExpressionList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessFilterExpressionList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.expressions && message.expressions.length)) + message.expressions = []; + message.expressions.push($root.google.analytics.admin.v1beta.AccessFilterExpression.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls CreateMeasurementProtocolSecret. - * @function createMeasurementProtocolSecret - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest} request CreateMeasurementProtocolSecretRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreateMeasurementProtocolSecretCallback} callback Node-style callback called with the error, if any, and MeasurementProtocolSecret - * @returns {undefined} - * @variation 1 + * Decodes an AccessFilterExpressionList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessFilterExpressionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessFilterExpressionList} AccessFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(AnalyticsAdminService.prototype.createMeasurementProtocolSecret = function createMeasurementProtocolSecret(request, callback) { - return this.rpcCall(createMeasurementProtocolSecret, $root.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest, $root.google.analytics.admin.v1beta.MeasurementProtocolSecret, request, callback); - }, "name", { value: "CreateMeasurementProtocolSecret" }); + AccessFilterExpressionList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls CreateMeasurementProtocolSecret. - * @function createMeasurementProtocolSecret - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest} request CreateMeasurementProtocolSecretRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies an AccessFilterExpressionList message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessFilterExpressionList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + AccessFilterExpressionList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expressions != null && message.hasOwnProperty("expressions")) { + if (!Array.isArray(message.expressions)) + return "expressions: array expected"; + for (var i = 0; i < message.expressions.length; ++i) { + var error = $root.google.analytics.admin.v1beta.AccessFilterExpression.verify(message.expressions[i]); + if (error) + return "expressions." + error; + } + } + return null; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|deleteMeasurementProtocolSecret}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef DeleteMeasurementProtocolSecretCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Creates an AccessFilterExpressionList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessFilterExpressionList + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessFilterExpressionList} AccessFilterExpressionList */ + AccessFilterExpressionList.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessFilterExpressionList) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessFilterExpressionList(); + if (object.expressions) { + if (!Array.isArray(object.expressions)) + throw TypeError(".google.analytics.admin.v1beta.AccessFilterExpressionList.expressions: array expected"); + message.expressions = []; + for (var i = 0; i < object.expressions.length; ++i) { + if (typeof object.expressions[i] !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessFilterExpressionList.expressions: object expected"); + message.expressions[i] = $root.google.analytics.admin.v1beta.AccessFilterExpression.fromObject(object.expressions[i]); + } + } + return message; + }; /** - * Calls DeleteMeasurementProtocolSecret. - * @function deleteMeasurementProtocolSecret - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest} request DeleteMeasurementProtocolSecretRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.DeleteMeasurementProtocolSecretCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Creates a plain object from an AccessFilterExpressionList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessFilterExpressionList + * @static + * @param {google.analytics.admin.v1beta.AccessFilterExpressionList} message AccessFilterExpressionList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(AnalyticsAdminService.prototype.deleteMeasurementProtocolSecret = function deleteMeasurementProtocolSecret(request, callback) { - return this.rpcCall(deleteMeasurementProtocolSecret, $root.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteMeasurementProtocolSecret" }); + AccessFilterExpressionList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.expressions = []; + if (message.expressions && message.expressions.length) { + object.expressions = []; + for (var j = 0; j < message.expressions.length; ++j) + object.expressions[j] = $root.google.analytics.admin.v1beta.AccessFilterExpression.toObject(message.expressions[j], options); + } + return object; + }; /** - * Calls DeleteMeasurementProtocolSecret. - * @function deleteMeasurementProtocolSecret - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * Converts this AccessFilterExpressionList to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessFilterExpressionList * @instance - * @param {google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest} request DeleteMeasurementProtocolSecretRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + AccessFilterExpressionList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateMeasurementProtocolSecret}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef UpdateMeasurementProtocolSecretCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.MeasurementProtocolSecret} [response] MeasurementProtocolSecret + * Gets the default type url for AccessFilterExpressionList + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessFilterExpressionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + AccessFilterExpressionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessFilterExpressionList"; + }; - /** - * Calls UpdateMeasurementProtocolSecret. - * @function updateMeasurementProtocolSecret - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest} request UpdateMeasurementProtocolSecretRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdateMeasurementProtocolSecretCallback} callback Node-style callback called with the error, if any, and MeasurementProtocolSecret - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AnalyticsAdminService.prototype.updateMeasurementProtocolSecret = function updateMeasurementProtocolSecret(request, callback) { - return this.rpcCall(updateMeasurementProtocolSecret, $root.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest, $root.google.analytics.admin.v1beta.MeasurementProtocolSecret, request, callback); - }, "name", { value: "UpdateMeasurementProtocolSecret" }); + return AccessFilterExpressionList; + })(); - /** - * Calls UpdateMeasurementProtocolSecret. - * @function updateMeasurementProtocolSecret - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest} request UpdateMeasurementProtocolSecretRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + v1beta.AccessFilter = (function() { /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|acknowledgeUserDataCollection}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef AcknowledgeUserDataCollectionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse} [response] AcknowledgeUserDataCollectionResponse + * Properties of an AccessFilter. + * @memberof google.analytics.admin.v1beta + * @interface IAccessFilter + * @property {google.analytics.admin.v1beta.IAccessStringFilter|null} [stringFilter] AccessFilter stringFilter + * @property {google.analytics.admin.v1beta.IAccessInListFilter|null} [inListFilter] AccessFilter inListFilter + * @property {google.analytics.admin.v1beta.IAccessNumericFilter|null} [numericFilter] AccessFilter numericFilter + * @property {google.analytics.admin.v1beta.IAccessBetweenFilter|null} [betweenFilter] AccessFilter betweenFilter + * @property {string|null} [fieldName] AccessFilter fieldName */ /** - * Calls AcknowledgeUserDataCollection. - * @function acknowledgeUserDataCollection - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest} request AcknowledgeUserDataCollectionRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.AcknowledgeUserDataCollectionCallback} callback Node-style callback called with the error, if any, and AcknowledgeUserDataCollectionResponse - * @returns {undefined} - * @variation 1 + * Constructs a new AccessFilter. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessFilter. + * @implements IAccessFilter + * @constructor + * @param {google.analytics.admin.v1beta.IAccessFilter=} [properties] Properties to set */ - Object.defineProperty(AnalyticsAdminService.prototype.acknowledgeUserDataCollection = function acknowledgeUserDataCollection(request, callback) { - return this.rpcCall(acknowledgeUserDataCollection, $root.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest, $root.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse, request, callback); - }, "name", { value: "AcknowledgeUserDataCollection" }); + function AccessFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls AcknowledgeUserDataCollection. - * @function acknowledgeUserDataCollection - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessFilter stringFilter. + * @member {google.analytics.admin.v1beta.IAccessStringFilter|null|undefined} stringFilter + * @memberof google.analytics.admin.v1beta.AccessFilter * @instance - * @param {google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest} request AcknowledgeUserDataCollectionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|searchChangeHistoryEvents}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef SearchChangeHistoryEventsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.SearchChangeHistoryEventsResponse} [response] SearchChangeHistoryEventsResponse */ + AccessFilter.prototype.stringFilter = null; /** - * Calls SearchChangeHistoryEvents. - * @function searchChangeHistoryEvents - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessFilter inListFilter. + * @member {google.analytics.admin.v1beta.IAccessInListFilter|null|undefined} inListFilter + * @memberof google.analytics.admin.v1beta.AccessFilter * @instance - * @param {google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest} request SearchChangeHistoryEventsRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.SearchChangeHistoryEventsCallback} callback Node-style callback called with the error, if any, and SearchChangeHistoryEventsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AnalyticsAdminService.prototype.searchChangeHistoryEvents = function searchChangeHistoryEvents(request, callback) { - return this.rpcCall(searchChangeHistoryEvents, $root.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest, $root.google.analytics.admin.v1beta.SearchChangeHistoryEventsResponse, request, callback); - }, "name", { value: "SearchChangeHistoryEvents" }); + AccessFilter.prototype.inListFilter = null; /** - * Calls SearchChangeHistoryEvents. - * @function searchChangeHistoryEvents - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessFilter numericFilter. + * @member {google.analytics.admin.v1beta.IAccessNumericFilter|null|undefined} numericFilter + * @memberof google.analytics.admin.v1beta.AccessFilter * @instance - * @param {google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest} request SearchChangeHistoryEventsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + AccessFilter.prototype.numericFilter = null; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createConversionEvent}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef CreateConversionEventCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.ConversionEvent} [response] ConversionEvent + * AccessFilter betweenFilter. + * @member {google.analytics.admin.v1beta.IAccessBetweenFilter|null|undefined} betweenFilter + * @memberof google.analytics.admin.v1beta.AccessFilter + * @instance */ + AccessFilter.prototype.betweenFilter = null; /** - * Calls CreateConversionEvent. - * @function createConversionEvent - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessFilter fieldName. + * @member {string} fieldName + * @memberof google.analytics.admin.v1beta.AccessFilter * @instance - * @param {google.analytics.admin.v1beta.ICreateConversionEventRequest} request CreateConversionEventRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreateConversionEventCallback} callback Node-style callback called with the error, if any, and ConversionEvent - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AnalyticsAdminService.prototype.createConversionEvent = function createConversionEvent(request, callback) { - return this.rpcCall(createConversionEvent, $root.google.analytics.admin.v1beta.CreateConversionEventRequest, $root.google.analytics.admin.v1beta.ConversionEvent, request, callback); - }, "name", { value: "CreateConversionEvent" }); + AccessFilter.prototype.fieldName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Calls CreateConversionEvent. - * @function createConversionEvent - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessFilter oneFilter. + * @member {"stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"|undefined} oneFilter + * @memberof google.analytics.admin.v1beta.AccessFilter * @instance - * @param {google.analytics.admin.v1beta.ICreateConversionEventRequest} request CreateConversionEventRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Object.defineProperty(AccessFilter.prototype, "oneFilter", { + get: $util.oneOfGetter($oneOfFields = ["stringFilter", "inListFilter", "numericFilter", "betweenFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getConversionEvent}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef GetConversionEventCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.ConversionEvent} [response] ConversionEvent + * Creates a new AccessFilter instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessFilter=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessFilter} AccessFilter instance */ + AccessFilter.create = function create(properties) { + return new AccessFilter(properties); + }; /** - * Calls GetConversionEvent. - * @function getConversionEvent - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IGetConversionEventRequest} request GetConversionEventRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetConversionEventCallback} callback Node-style callback called with the error, if any, and ConversionEvent - * @returns {undefined} - * @variation 1 + * Encodes the specified AccessFilter message. Does not implicitly {@link google.analytics.admin.v1beta.AccessFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessFilter} message AccessFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AnalyticsAdminService.prototype.getConversionEvent = function getConversionEvent(request, callback) { - return this.rpcCall(getConversionEvent, $root.google.analytics.admin.v1beta.GetConversionEventRequest, $root.google.analytics.admin.v1beta.ConversionEvent, request, callback); - }, "name", { value: "GetConversionEvent" }); + AccessFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); + if (message.stringFilter != null && Object.hasOwnProperty.call(message, "stringFilter")) + $root.google.analytics.admin.v1beta.AccessStringFilter.encode(message.stringFilter, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inListFilter != null && Object.hasOwnProperty.call(message, "inListFilter")) + $root.google.analytics.admin.v1beta.AccessInListFilter.encode(message.inListFilter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.numericFilter != null && Object.hasOwnProperty.call(message, "numericFilter")) + $root.google.analytics.admin.v1beta.AccessNumericFilter.encode(message.numericFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.betweenFilter != null && Object.hasOwnProperty.call(message, "betweenFilter")) + $root.google.analytics.admin.v1beta.AccessBetweenFilter.encode(message.betweenFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; /** - * Calls GetConversionEvent. - * @function getConversionEvent - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IGetConversionEventRequest} request GetConversionEventRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified AccessFilter message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessFilter} message AccessFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AccessFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|deleteConversionEvent}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef DeleteConversionEventCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Decodes an AccessFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessFilter} AccessFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AccessFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.stringFilter = $root.google.analytics.admin.v1beta.AccessStringFilter.decode(reader, reader.uint32()); + break; + } + case 3: { + message.inListFilter = $root.google.analytics.admin.v1beta.AccessInListFilter.decode(reader, reader.uint32()); + break; + } + case 4: { + message.numericFilter = $root.google.analytics.admin.v1beta.AccessNumericFilter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.betweenFilter = $root.google.analytics.admin.v1beta.AccessBetweenFilter.decode(reader, reader.uint32()); + break; + } + case 1: { + message.fieldName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls DeleteConversionEvent. - * @function deleteConversionEvent - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IDeleteConversionEventRequest} request DeleteConversionEventRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.DeleteConversionEventCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Decodes an AccessFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessFilter} AccessFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(AnalyticsAdminService.prototype.deleteConversionEvent = function deleteConversionEvent(request, callback) { - return this.rpcCall(deleteConversionEvent, $root.google.analytics.admin.v1beta.DeleteConversionEventRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteConversionEvent" }); + AccessFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls DeleteConversionEvent. - * @function deleteConversionEvent - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IDeleteConversionEventRequest} request DeleteConversionEventRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies an AccessFilter message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + AccessFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stringFilter != null && message.hasOwnProperty("stringFilter")) { + properties.oneFilter = 1; + { + var error = $root.google.analytics.admin.v1beta.AccessStringFilter.verify(message.stringFilter); + if (error) + return "stringFilter." + error; + } + } + if (message.inListFilter != null && message.hasOwnProperty("inListFilter")) { + if (properties.oneFilter === 1) + return "oneFilter: multiple values"; + properties.oneFilter = 1; + { + var error = $root.google.analytics.admin.v1beta.AccessInListFilter.verify(message.inListFilter); + if (error) + return "inListFilter." + error; + } + } + if (message.numericFilter != null && message.hasOwnProperty("numericFilter")) { + if (properties.oneFilter === 1) + return "oneFilter: multiple values"; + properties.oneFilter = 1; + { + var error = $root.google.analytics.admin.v1beta.AccessNumericFilter.verify(message.numericFilter); + if (error) + return "numericFilter." + error; + } + } + if (message.betweenFilter != null && message.hasOwnProperty("betweenFilter")) { + if (properties.oneFilter === 1) + return "oneFilter: multiple values"; + properties.oneFilter = 1; + { + var error = $root.google.analytics.admin.v1beta.AccessBetweenFilter.verify(message.betweenFilter); + if (error) + return "betweenFilter." + error; + } + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + return null; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listConversionEvents}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef ListConversionEventsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.ListConversionEventsResponse} [response] ListConversionEventsResponse + * Creates an AccessFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessFilter} AccessFilter + */ + AccessFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessFilter) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessFilter(); + if (object.stringFilter != null) { + if (typeof object.stringFilter !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessFilter.stringFilter: object expected"); + message.stringFilter = $root.google.analytics.admin.v1beta.AccessStringFilter.fromObject(object.stringFilter); + } + if (object.inListFilter != null) { + if (typeof object.inListFilter !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessFilter.inListFilter: object expected"); + message.inListFilter = $root.google.analytics.admin.v1beta.AccessInListFilter.fromObject(object.inListFilter); + } + if (object.numericFilter != null) { + if (typeof object.numericFilter !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessFilter.numericFilter: object expected"); + message.numericFilter = $root.google.analytics.admin.v1beta.AccessNumericFilter.fromObject(object.numericFilter); + } + if (object.betweenFilter != null) { + if (typeof object.betweenFilter !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessFilter.betweenFilter: object expected"); + message.betweenFilter = $root.google.analytics.admin.v1beta.AccessBetweenFilter.fromObject(object.betweenFilter); + } + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + return message; + }; + + /** + * Creates a plain object from an AccessFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessFilter + * @static + * @param {google.analytics.admin.v1beta.AccessFilter} message AccessFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + AccessFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.fieldName = ""; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + if (message.stringFilter != null && message.hasOwnProperty("stringFilter")) { + object.stringFilter = $root.google.analytics.admin.v1beta.AccessStringFilter.toObject(message.stringFilter, options); + if (options.oneofs) + object.oneFilter = "stringFilter"; + } + if (message.inListFilter != null && message.hasOwnProperty("inListFilter")) { + object.inListFilter = $root.google.analytics.admin.v1beta.AccessInListFilter.toObject(message.inListFilter, options); + if (options.oneofs) + object.oneFilter = "inListFilter"; + } + if (message.numericFilter != null && message.hasOwnProperty("numericFilter")) { + object.numericFilter = $root.google.analytics.admin.v1beta.AccessNumericFilter.toObject(message.numericFilter, options); + if (options.oneofs) + object.oneFilter = "numericFilter"; + } + if (message.betweenFilter != null && message.hasOwnProperty("betweenFilter")) { + object.betweenFilter = $root.google.analytics.admin.v1beta.AccessBetweenFilter.toObject(message.betweenFilter, options); + if (options.oneofs) + object.oneFilter = "betweenFilter"; + } + return object; + }; /** - * Calls ListConversionEvents. - * @function listConversionEvents - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * Converts this AccessFilter to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessFilter * @instance - * @param {google.analytics.admin.v1beta.IListConversionEventsRequest} request ListConversionEventsRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListConversionEventsCallback} callback Node-style callback called with the error, if any, and ListConversionEventsResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(AnalyticsAdminService.prototype.listConversionEvents = function listConversionEvents(request, callback) { - return this.rpcCall(listConversionEvents, $root.google.analytics.admin.v1beta.ListConversionEventsRequest, $root.google.analytics.admin.v1beta.ListConversionEventsResponse, request, callback); - }, "name", { value: "ListConversionEvents" }); + AccessFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls ListConversionEvents. - * @function listConversionEvents - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IListConversionEventsRequest} request ListConversionEventsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for AccessFilter + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + AccessFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessFilter"; + }; + + return AccessFilter; + })(); + + v1beta.AccessStringFilter = (function() { /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createCustomDimension}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef CreateCustomDimensionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.CustomDimension} [response] CustomDimension + * Properties of an AccessStringFilter. + * @memberof google.analytics.admin.v1beta + * @interface IAccessStringFilter + * @property {google.analytics.admin.v1beta.AccessStringFilter.MatchType|null} [matchType] AccessStringFilter matchType + * @property {string|null} [value] AccessStringFilter value + * @property {boolean|null} [caseSensitive] AccessStringFilter caseSensitive */ /** - * Calls CreateCustomDimension. - * @function createCustomDimension - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.ICreateCustomDimensionRequest} request CreateCustomDimensionRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreateCustomDimensionCallback} callback Node-style callback called with the error, if any, and CustomDimension - * @returns {undefined} - * @variation 1 + * Constructs a new AccessStringFilter. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessStringFilter. + * @implements IAccessStringFilter + * @constructor + * @param {google.analytics.admin.v1beta.IAccessStringFilter=} [properties] Properties to set */ - Object.defineProperty(AnalyticsAdminService.prototype.createCustomDimension = function createCustomDimension(request, callback) { - return this.rpcCall(createCustomDimension, $root.google.analytics.admin.v1beta.CreateCustomDimensionRequest, $root.google.analytics.admin.v1beta.CustomDimension, request, callback); - }, "name", { value: "CreateCustomDimension" }); + function AccessStringFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls CreateCustomDimension. - * @function createCustomDimension - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessStringFilter matchType. + * @member {google.analytics.admin.v1beta.AccessStringFilter.MatchType} matchType + * @memberof google.analytics.admin.v1beta.AccessStringFilter * @instance - * @param {google.analytics.admin.v1beta.ICreateCustomDimensionRequest} request CreateCustomDimensionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + AccessStringFilter.prototype.matchType = 0; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateCustomDimension}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef UpdateCustomDimensionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.CustomDimension} [response] CustomDimension + * AccessStringFilter value. + * @member {string} value + * @memberof google.analytics.admin.v1beta.AccessStringFilter + * @instance */ + AccessStringFilter.prototype.value = ""; /** - * Calls UpdateCustomDimension. - * @function updateCustomDimension - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessStringFilter caseSensitive. + * @member {boolean} caseSensitive + * @memberof google.analytics.admin.v1beta.AccessStringFilter * @instance - * @param {google.analytics.admin.v1beta.IUpdateCustomDimensionRequest} request UpdateCustomDimensionRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdateCustomDimensionCallback} callback Node-style callback called with the error, if any, and CustomDimension - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AnalyticsAdminService.prototype.updateCustomDimension = function updateCustomDimension(request, callback) { - return this.rpcCall(updateCustomDimension, $root.google.analytics.admin.v1beta.UpdateCustomDimensionRequest, $root.google.analytics.admin.v1beta.CustomDimension, request, callback); - }, "name", { value: "UpdateCustomDimension" }); + AccessStringFilter.prototype.caseSensitive = false; /** - * Calls UpdateCustomDimension. - * @function updateCustomDimension - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IUpdateCustomDimensionRequest} request UpdateCustomDimensionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new AccessStringFilter instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessStringFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessStringFilter=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessStringFilter} AccessStringFilter instance */ + AccessStringFilter.create = function create(properties) { + return new AccessStringFilter(properties); + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listCustomDimensions}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef ListCustomDimensionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.ListCustomDimensionsResponse} [response] ListCustomDimensionsResponse + * Encodes the specified AccessStringFilter message. Does not implicitly {@link google.analytics.admin.v1beta.AccessStringFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessStringFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessStringFilter} message AccessStringFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AccessStringFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matchType != null && Object.hasOwnProperty.call(message, "matchType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.matchType); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.caseSensitive != null && Object.hasOwnProperty.call(message, "caseSensitive")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.caseSensitive); + return writer; + }; /** - * Calls ListCustomDimensions. - * @function listCustomDimensions - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IListCustomDimensionsRequest} request ListCustomDimensionsRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListCustomDimensionsCallback} callback Node-style callback called with the error, if any, and ListCustomDimensionsResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified AccessStringFilter message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessStringFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessStringFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessStringFilter} message AccessStringFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AnalyticsAdminService.prototype.listCustomDimensions = function listCustomDimensions(request, callback) { - return this.rpcCall(listCustomDimensions, $root.google.analytics.admin.v1beta.ListCustomDimensionsRequest, $root.google.analytics.admin.v1beta.ListCustomDimensionsResponse, request, callback); - }, "name", { value: "ListCustomDimensions" }); + AccessStringFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ListCustomDimensions. - * @function listCustomDimensions - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IListCustomDimensionsRequest} request ListCustomDimensionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an AccessStringFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessStringFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessStringFilter} AccessStringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AccessStringFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessStringFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.matchType = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + case 3: { + message.caseSensitive = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|archiveCustomDimension}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef ArchiveCustomDimensionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Decodes an AccessStringFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessStringFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessStringFilter} AccessStringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AccessStringFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ArchiveCustomDimension. - * @function archiveCustomDimension - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IArchiveCustomDimensionRequest} request ArchiveCustomDimensionRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ArchiveCustomDimensionCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Verifies an AccessStringFilter message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessStringFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(AnalyticsAdminService.prototype.archiveCustomDimension = function archiveCustomDimension(request, callback) { - return this.rpcCall(archiveCustomDimension, $root.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "ArchiveCustomDimension" }); + AccessStringFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.matchType != null && message.hasOwnProperty("matchType")) + switch (message.matchType) { + default: + return "matchType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive")) + if (typeof message.caseSensitive !== "boolean") + return "caseSensitive: boolean expected"; + return null; + }; /** - * Calls ArchiveCustomDimension. - * @function archiveCustomDimension - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IArchiveCustomDimensionRequest} request ArchiveCustomDimensionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates an AccessStringFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessStringFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessStringFilter} AccessStringFilter */ + AccessStringFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessStringFilter) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessStringFilter(); + switch (object.matchType) { + default: + if (typeof object.matchType === "number") { + message.matchType = object.matchType; + break; + } + break; + case "MATCH_TYPE_UNSPECIFIED": + case 0: + message.matchType = 0; + break; + case "EXACT": + case 1: + message.matchType = 1; + break; + case "BEGINS_WITH": + case 2: + message.matchType = 2; + break; + case "ENDS_WITH": + case 3: + message.matchType = 3; + break; + case "CONTAINS": + case 4: + message.matchType = 4; + break; + case "FULL_REGEXP": + case 5: + message.matchType = 5; + break; + case "PARTIAL_REGEXP": + case 6: + message.matchType = 6; + break; + } + if (object.value != null) + message.value = String(object.value); + if (object.caseSensitive != null) + message.caseSensitive = Boolean(object.caseSensitive); + return message; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getCustomDimension}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef GetCustomDimensionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.CustomDimension} [response] CustomDimension + * Creates a plain object from an AccessStringFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessStringFilter + * @static + * @param {google.analytics.admin.v1beta.AccessStringFilter} message AccessStringFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + AccessStringFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.matchType = options.enums === String ? "MATCH_TYPE_UNSPECIFIED" : 0; + object.value = ""; + object.caseSensitive = false; + } + if (message.matchType != null && message.hasOwnProperty("matchType")) + object.matchType = options.enums === String ? $root.google.analytics.admin.v1beta.AccessStringFilter.MatchType[message.matchType] === undefined ? message.matchType : $root.google.analytics.admin.v1beta.AccessStringFilter.MatchType[message.matchType] : message.matchType; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive")) + object.caseSensitive = message.caseSensitive; + return object; + }; /** - * Calls GetCustomDimension. - * @function getCustomDimension - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * Converts this AccessStringFilter to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessStringFilter * @instance - * @param {google.analytics.admin.v1beta.IGetCustomDimensionRequest} request GetCustomDimensionRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetCustomDimensionCallback} callback Node-style callback called with the error, if any, and CustomDimension - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(AnalyticsAdminService.prototype.getCustomDimension = function getCustomDimension(request, callback) { - return this.rpcCall(getCustomDimension, $root.google.analytics.admin.v1beta.GetCustomDimensionRequest, $root.google.analytics.admin.v1beta.CustomDimension, request, callback); - }, "name", { value: "GetCustomDimension" }); + AccessStringFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls GetCustomDimension. - * @function getCustomDimension - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IGetCustomDimensionRequest} request GetCustomDimensionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for AccessStringFilter + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessStringFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + AccessStringFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessStringFilter"; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createCustomMetric}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef CreateCustomMetricCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.CustomMetric} [response] CustomMetric + * MatchType enum. + * @name google.analytics.admin.v1beta.AccessStringFilter.MatchType + * @enum {number} + * @property {number} MATCH_TYPE_UNSPECIFIED=0 MATCH_TYPE_UNSPECIFIED value + * @property {number} EXACT=1 EXACT value + * @property {number} BEGINS_WITH=2 BEGINS_WITH value + * @property {number} ENDS_WITH=3 ENDS_WITH value + * @property {number} CONTAINS=4 CONTAINS value + * @property {number} FULL_REGEXP=5 FULL_REGEXP value + * @property {number} PARTIAL_REGEXP=6 PARTIAL_REGEXP value */ + AccessStringFilter.MatchType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MATCH_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXACT"] = 1; + values[valuesById[2] = "BEGINS_WITH"] = 2; + values[valuesById[3] = "ENDS_WITH"] = 3; + values[valuesById[4] = "CONTAINS"] = 4; + values[valuesById[5] = "FULL_REGEXP"] = 5; + values[valuesById[6] = "PARTIAL_REGEXP"] = 6; + return values; + })(); - /** - * Calls CreateCustomMetric. - * @function createCustomMetric - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.ICreateCustomMetricRequest} request CreateCustomMetricRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreateCustomMetricCallback} callback Node-style callback called with the error, if any, and CustomMetric - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AnalyticsAdminService.prototype.createCustomMetric = function createCustomMetric(request, callback) { - return this.rpcCall(createCustomMetric, $root.google.analytics.admin.v1beta.CreateCustomMetricRequest, $root.google.analytics.admin.v1beta.CustomMetric, request, callback); - }, "name", { value: "CreateCustomMetric" }); + return AccessStringFilter; + })(); - /** - * Calls CreateCustomMetric. - * @function createCustomMetric - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.ICreateCustomMetricRequest} request CreateCustomMetricRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + v1beta.AccessInListFilter = (function() { /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateCustomMetric}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef UpdateCustomMetricCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.CustomMetric} [response] CustomMetric + * Properties of an AccessInListFilter. + * @memberof google.analytics.admin.v1beta + * @interface IAccessInListFilter + * @property {Array.|null} [values] AccessInListFilter values + * @property {boolean|null} [caseSensitive] AccessInListFilter caseSensitive */ /** - * Calls UpdateCustomMetric. - * @function updateCustomMetric - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IUpdateCustomMetricRequest} request UpdateCustomMetricRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdateCustomMetricCallback} callback Node-style callback called with the error, if any, and CustomMetric - * @returns {undefined} - * @variation 1 + * Constructs a new AccessInListFilter. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessInListFilter. + * @implements IAccessInListFilter + * @constructor + * @param {google.analytics.admin.v1beta.IAccessInListFilter=} [properties] Properties to set */ - Object.defineProperty(AnalyticsAdminService.prototype.updateCustomMetric = function updateCustomMetric(request, callback) { - return this.rpcCall(updateCustomMetric, $root.google.analytics.admin.v1beta.UpdateCustomMetricRequest, $root.google.analytics.admin.v1beta.CustomMetric, request, callback); - }, "name", { value: "UpdateCustomMetric" }); + function AccessInListFilter(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls UpdateCustomMetric. - * @function updateCustomMetric - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessInListFilter values. + * @member {Array.} values + * @memberof google.analytics.admin.v1beta.AccessInListFilter * @instance - * @param {google.analytics.admin.v1beta.IUpdateCustomMetricRequest} request UpdateCustomMetricRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listCustomMetrics}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef ListCustomMetricsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.ListCustomMetricsResponse} [response] ListCustomMetricsResponse */ + AccessInListFilter.prototype.values = $util.emptyArray; /** - * Calls ListCustomMetrics. - * @function listCustomMetrics - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessInListFilter caseSensitive. + * @member {boolean} caseSensitive + * @memberof google.analytics.admin.v1beta.AccessInListFilter * @instance - * @param {google.analytics.admin.v1beta.IListCustomMetricsRequest} request ListCustomMetricsRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListCustomMetricsCallback} callback Node-style callback called with the error, if any, and ListCustomMetricsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AnalyticsAdminService.prototype.listCustomMetrics = function listCustomMetrics(request, callback) { - return this.rpcCall(listCustomMetrics, $root.google.analytics.admin.v1beta.ListCustomMetricsRequest, $root.google.analytics.admin.v1beta.ListCustomMetricsResponse, request, callback); - }, "name", { value: "ListCustomMetrics" }); + AccessInListFilter.prototype.caseSensitive = false; /** - * Calls ListCustomMetrics. - * @function listCustomMetrics - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IListCustomMetricsRequest} request ListCustomMetricsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new AccessInListFilter instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessInListFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessInListFilter=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessInListFilter} AccessInListFilter instance */ + AccessInListFilter.create = function create(properties) { + return new AccessInListFilter(properties); + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|archiveCustomMetric}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef ArchiveCustomMetricCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Encodes the specified AccessInListFilter message. Does not implicitly {@link google.analytics.admin.v1beta.AccessInListFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessInListFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessInListFilter} message AccessInListFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AccessInListFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); + if (message.caseSensitive != null && Object.hasOwnProperty.call(message, "caseSensitive")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.caseSensitive); + return writer; + }; /** - * Calls ArchiveCustomMetric. - * @function archiveCustomMetric - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IArchiveCustomMetricRequest} request ArchiveCustomMetricRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ArchiveCustomMetricCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Encodes the specified AccessInListFilter message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessInListFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessInListFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessInListFilter} message AccessInListFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AnalyticsAdminService.prototype.archiveCustomMetric = function archiveCustomMetric(request, callback) { - return this.rpcCall(archiveCustomMetric, $root.google.analytics.admin.v1beta.ArchiveCustomMetricRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "ArchiveCustomMetric" }); + AccessInListFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ArchiveCustomMetric. - * @function archiveCustomMetric - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IArchiveCustomMetricRequest} request ArchiveCustomMetricRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an AccessInListFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessInListFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessInListFilter} AccessInListFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AccessInListFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessInListFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + case 2: { + message.caseSensitive = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getCustomMetric}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef GetCustomMetricCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.CustomMetric} [response] CustomMetric + * Decodes an AccessInListFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessInListFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessInListFilter} AccessInListFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AccessInListFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetCustomMetric. - * @function getCustomMetric - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IGetCustomMetricRequest} request GetCustomMetricRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetCustomMetricCallback} callback Node-style callback called with the error, if any, and CustomMetric - * @returns {undefined} - * @variation 1 + * Verifies an AccessInListFilter message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessInListFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(AnalyticsAdminService.prototype.getCustomMetric = function getCustomMetric(request, callback) { - return this.rpcCall(getCustomMetric, $root.google.analytics.admin.v1beta.GetCustomMetricRequest, $root.google.analytics.admin.v1beta.CustomMetric, request, callback); - }, "name", { value: "GetCustomMetric" }); + AccessInListFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive")) + if (typeof message.caseSensitive !== "boolean") + return "caseSensitive: boolean expected"; + return null; + }; /** - * Calls GetCustomMetric. - * @function getCustomMetric - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IGetCustomMetricRequest} request GetCustomMetricRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates an AccessInListFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessInListFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessInListFilter} AccessInListFilter */ + AccessInListFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessInListFilter) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessInListFilter(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.analytics.admin.v1beta.AccessInListFilter.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + if (object.caseSensitive != null) + message.caseSensitive = Boolean(object.caseSensitive); + return message; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getDataRetentionSettings}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef GetDataRetentionSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.DataRetentionSettings} [response] DataRetentionSettings + * Creates a plain object from an AccessInListFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessInListFilter + * @static + * @param {google.analytics.admin.v1beta.AccessInListFilter} message AccessInListFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + AccessInListFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) + object.caseSensitive = false; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive")) + object.caseSensitive = message.caseSensitive; + return object; + }; /** - * Calls GetDataRetentionSettings. - * @function getDataRetentionSettings - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * Converts this AccessInListFilter to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessInListFilter * @instance - * @param {google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest} request GetDataRetentionSettingsRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetDataRetentionSettingsCallback} callback Node-style callback called with the error, if any, and DataRetentionSettings - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(AnalyticsAdminService.prototype.getDataRetentionSettings = function getDataRetentionSettings(request, callback) { - return this.rpcCall(getDataRetentionSettings, $root.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest, $root.google.analytics.admin.v1beta.DataRetentionSettings, request, callback); - }, "name", { value: "GetDataRetentionSettings" }); + AccessInListFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls GetDataRetentionSettings. - * @function getDataRetentionSettings - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest} request GetDataRetentionSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for AccessInListFilter + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessInListFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + AccessInListFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessInListFilter"; + }; - /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateDataRetentionSettings}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef UpdateDataRetentionSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.DataRetentionSettings} [response] DataRetentionSettings - */ + return AccessInListFilter; + })(); - /** - * Calls UpdateDataRetentionSettings. - * @function updateDataRetentionSettings - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest} request UpdateDataRetentionSettingsRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdateDataRetentionSettingsCallback} callback Node-style callback called with the error, if any, and DataRetentionSettings - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AnalyticsAdminService.prototype.updateDataRetentionSettings = function updateDataRetentionSettings(request, callback) { - return this.rpcCall(updateDataRetentionSettings, $root.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest, $root.google.analytics.admin.v1beta.DataRetentionSettings, request, callback); - }, "name", { value: "UpdateDataRetentionSettings" }); + v1beta.AccessNumericFilter = (function() { /** - * Calls UpdateDataRetentionSettings. - * @function updateDataRetentionSettings - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest} request UpdateDataRetentionSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of an AccessNumericFilter. + * @memberof google.analytics.admin.v1beta + * @interface IAccessNumericFilter + * @property {google.analytics.admin.v1beta.AccessNumericFilter.Operation|null} [operation] AccessNumericFilter operation + * @property {google.analytics.admin.v1beta.INumericValue|null} [value] AccessNumericFilter value */ /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createDataStream}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef CreateDataStreamCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.DataStream} [response] DataStream + * Constructs a new AccessNumericFilter. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessNumericFilter. + * @implements IAccessNumericFilter + * @constructor + * @param {google.analytics.admin.v1beta.IAccessNumericFilter=} [properties] Properties to set */ + function AccessNumericFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls CreateDataStream. - * @function createDataStream - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessNumericFilter operation. + * @member {google.analytics.admin.v1beta.AccessNumericFilter.Operation} operation + * @memberof google.analytics.admin.v1beta.AccessNumericFilter * @instance - * @param {google.analytics.admin.v1beta.ICreateDataStreamRequest} request CreateDataStreamRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreateDataStreamCallback} callback Node-style callback called with the error, if any, and DataStream - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AnalyticsAdminService.prototype.createDataStream = function createDataStream(request, callback) { - return this.rpcCall(createDataStream, $root.google.analytics.admin.v1beta.CreateDataStreamRequest, $root.google.analytics.admin.v1beta.DataStream, request, callback); - }, "name", { value: "CreateDataStream" }); + AccessNumericFilter.prototype.operation = 0; /** - * Calls CreateDataStream. - * @function createDataStream - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessNumericFilter value. + * @member {google.analytics.admin.v1beta.INumericValue|null|undefined} value + * @memberof google.analytics.admin.v1beta.AccessNumericFilter * @instance - * @param {google.analytics.admin.v1beta.ICreateDataStreamRequest} request CreateDataStreamRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|deleteDataStream}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef DeleteDataStreamCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty */ + AccessNumericFilter.prototype.value = null; /** - * Calls DeleteDataStream. - * @function deleteDataStream - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IDeleteDataStreamRequest} request DeleteDataStreamRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.DeleteDataStreamCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Creates a new AccessNumericFilter instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessNumericFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessNumericFilter=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessNumericFilter} AccessNumericFilter instance */ - Object.defineProperty(AnalyticsAdminService.prototype.deleteDataStream = function deleteDataStream(request, callback) { - return this.rpcCall(deleteDataStream, $root.google.analytics.admin.v1beta.DeleteDataStreamRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteDataStream" }); + AccessNumericFilter.create = function create(properties) { + return new AccessNumericFilter(properties); + }; /** - * Calls DeleteDataStream. - * @function deleteDataStream - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IDeleteDataStreamRequest} request DeleteDataStreamRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified AccessNumericFilter message. Does not implicitly {@link google.analytics.admin.v1beta.AccessNumericFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessNumericFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessNumericFilter} message AccessNumericFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AccessNumericFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.operation); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.analytics.admin.v1beta.NumericValue.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateDataStream}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef UpdateDataStreamCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.DataStream} [response] DataStream + * Encodes the specified AccessNumericFilter message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessNumericFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessNumericFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessNumericFilter} message AccessNumericFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AccessNumericFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls UpdateDataStream. - * @function updateDataStream - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IUpdateDataStreamRequest} request UpdateDataStreamRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdateDataStreamCallback} callback Node-style callback called with the error, if any, and DataStream - * @returns {undefined} - * @variation 1 + * Decodes an AccessNumericFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessNumericFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessNumericFilter} AccessNumericFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(AnalyticsAdminService.prototype.updateDataStream = function updateDataStream(request, callback) { - return this.rpcCall(updateDataStream, $root.google.analytics.admin.v1beta.UpdateDataStreamRequest, $root.google.analytics.admin.v1beta.DataStream, request, callback); - }, "name", { value: "UpdateDataStream" }); - + AccessNumericFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessNumericFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.operation = reader.int32(); + break; + } + case 2: { + message.value = $root.google.analytics.admin.v1beta.NumericValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** - * Calls UpdateDataStream. - * @function updateDataStream - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IUpdateDataStreamRequest} request UpdateDataStreamRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an AccessNumericFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessNumericFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessNumericFilter} AccessNumericFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AccessNumericFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listDataStreams}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef ListDataStreamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.ListDataStreamsResponse} [response] ListDataStreamsResponse + * Verifies an AccessNumericFilter message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessNumericFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + AccessNumericFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + switch (message.operation) { + default: + return "operation: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.analytics.admin.v1beta.NumericValue.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; /** - * Calls ListDataStreams. - * @function listDataStreams - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1beta.IListDataStreamsRequest} request ListDataStreamsRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListDataStreamsCallback} callback Node-style callback called with the error, if any, and ListDataStreamsResponse - * @returns {undefined} - * @variation 1 + * Creates an AccessNumericFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessNumericFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessNumericFilter} AccessNumericFilter */ - Object.defineProperty(AnalyticsAdminService.prototype.listDataStreams = function listDataStreams(request, callback) { - return this.rpcCall(listDataStreams, $root.google.analytics.admin.v1beta.ListDataStreamsRequest, $root.google.analytics.admin.v1beta.ListDataStreamsResponse, request, callback); - }, "name", { value: "ListDataStreams" }); + AccessNumericFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessNumericFilter) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessNumericFilter(); + switch (object.operation) { + default: + if (typeof object.operation === "number") { + message.operation = object.operation; + break; + } + break; + case "OPERATION_UNSPECIFIED": + case 0: + message.operation = 0; + break; + case "EQUAL": + case 1: + message.operation = 1; + break; + case "LESS_THAN": + case 2: + message.operation = 2; + break; + case "LESS_THAN_OR_EQUAL": + case 3: + message.operation = 3; + break; + case "GREATER_THAN": + case 4: + message.operation = 4; + break; + case "GREATER_THAN_OR_EQUAL": + case 5: + message.operation = 5; + break; + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessNumericFilter.value: object expected"); + message.value = $root.google.analytics.admin.v1beta.NumericValue.fromObject(object.value); + } + return message; + }; /** - * Calls ListDataStreams. - * @function listDataStreams - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * Creates a plain object from an AccessNumericFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessNumericFilter + * @static + * @param {google.analytics.admin.v1beta.AccessNumericFilter} message AccessNumericFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessNumericFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operation = options.enums === String ? "OPERATION_UNSPECIFIED" : 0; + object.value = null; + } + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = options.enums === String ? $root.google.analytics.admin.v1beta.AccessNumericFilter.Operation[message.operation] === undefined ? message.operation : $root.google.analytics.admin.v1beta.AccessNumericFilter.Operation[message.operation] : message.operation; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.analytics.admin.v1beta.NumericValue.toObject(message.value, options); + return object; + }; + + /** + * Converts this AccessNumericFilter to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessNumericFilter * @instance - * @param {google.analytics.admin.v1beta.IListDataStreamsRequest} request ListDataStreamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + AccessNumericFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getDataStream}. - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService - * @typedef GetDataStreamCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1beta.DataStream} [response] DataStream + * Gets the default type url for AccessNumericFilter + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessNumericFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + AccessNumericFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessNumericFilter"; + }; /** - * Calls GetDataStream. - * @function getDataStream - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * Operation enum. + * @name google.analytics.admin.v1beta.AccessNumericFilter.Operation + * @enum {number} + * @property {number} OPERATION_UNSPECIFIED=0 OPERATION_UNSPECIFIED value + * @property {number} EQUAL=1 EQUAL value + * @property {number} LESS_THAN=2 LESS_THAN value + * @property {number} LESS_THAN_OR_EQUAL=3 LESS_THAN_OR_EQUAL value + * @property {number} GREATER_THAN=4 GREATER_THAN value + * @property {number} GREATER_THAN_OR_EQUAL=5 GREATER_THAN_OR_EQUAL value + */ + AccessNumericFilter.Operation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "EQUAL"] = 1; + values[valuesById[2] = "LESS_THAN"] = 2; + values[valuesById[3] = "LESS_THAN_OR_EQUAL"] = 3; + values[valuesById[4] = "GREATER_THAN"] = 4; + values[valuesById[5] = "GREATER_THAN_OR_EQUAL"] = 5; + return values; + })(); + + return AccessNumericFilter; + })(); + + v1beta.AccessBetweenFilter = (function() { + + /** + * Properties of an AccessBetweenFilter. + * @memberof google.analytics.admin.v1beta + * @interface IAccessBetweenFilter + * @property {google.analytics.admin.v1beta.INumericValue|null} [fromValue] AccessBetweenFilter fromValue + * @property {google.analytics.admin.v1beta.INumericValue|null} [toValue] AccessBetweenFilter toValue + */ + + /** + * Constructs a new AccessBetweenFilter. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessBetweenFilter. + * @implements IAccessBetweenFilter + * @constructor + * @param {google.analytics.admin.v1beta.IAccessBetweenFilter=} [properties] Properties to set + */ + function AccessBetweenFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessBetweenFilter fromValue. + * @member {google.analytics.admin.v1beta.INumericValue|null|undefined} fromValue + * @memberof google.analytics.admin.v1beta.AccessBetweenFilter * @instance - * @param {google.analytics.admin.v1beta.IGetDataStreamRequest} request GetDataStreamRequest message or plain object - * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetDataStreamCallback} callback Node-style callback called with the error, if any, and DataStream - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AnalyticsAdminService.prototype.getDataStream = function getDataStream(request, callback) { - return this.rpcCall(getDataStream, $root.google.analytics.admin.v1beta.GetDataStreamRequest, $root.google.analytics.admin.v1beta.DataStream, request, callback); - }, "name", { value: "GetDataStream" }); + AccessBetweenFilter.prototype.fromValue = null; /** - * Calls GetDataStream. - * @function getDataStream - * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * AccessBetweenFilter toValue. + * @member {google.analytics.admin.v1beta.INumericValue|null|undefined} toValue + * @memberof google.analytics.admin.v1beta.AccessBetweenFilter * @instance - * @param {google.analytics.admin.v1beta.IGetDataStreamRequest} request GetDataStreamRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + AccessBetweenFilter.prototype.toValue = null; - return AnalyticsAdminService; + /** + * Creates a new AccessBetweenFilter instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessBetweenFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessBetweenFilter=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessBetweenFilter} AccessBetweenFilter instance + */ + AccessBetweenFilter.create = function create(properties) { + return new AccessBetweenFilter(properties); + }; + + /** + * Encodes the specified AccessBetweenFilter message. Does not implicitly {@link google.analytics.admin.v1beta.AccessBetweenFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessBetweenFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessBetweenFilter} message AccessBetweenFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessBetweenFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fromValue != null && Object.hasOwnProperty.call(message, "fromValue")) + $root.google.analytics.admin.v1beta.NumericValue.encode(message.fromValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.toValue != null && Object.hasOwnProperty.call(message, "toValue")) + $root.google.analytics.admin.v1beta.NumericValue.encode(message.toValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessBetweenFilter message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessBetweenFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessBetweenFilter + * @static + * @param {google.analytics.admin.v1beta.IAccessBetweenFilter} message AccessBetweenFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessBetweenFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessBetweenFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessBetweenFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessBetweenFilter} AccessBetweenFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessBetweenFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessBetweenFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fromValue = $root.google.analytics.admin.v1beta.NumericValue.decode(reader, reader.uint32()); + break; + } + case 2: { + message.toValue = $root.google.analytics.admin.v1beta.NumericValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessBetweenFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessBetweenFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessBetweenFilter} AccessBetweenFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessBetweenFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessBetweenFilter message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessBetweenFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessBetweenFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fromValue != null && message.hasOwnProperty("fromValue")) { + var error = $root.google.analytics.admin.v1beta.NumericValue.verify(message.fromValue); + if (error) + return "fromValue." + error; + } + if (message.toValue != null && message.hasOwnProperty("toValue")) { + var error = $root.google.analytics.admin.v1beta.NumericValue.verify(message.toValue); + if (error) + return "toValue." + error; + } + return null; + }; + + /** + * Creates an AccessBetweenFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessBetweenFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessBetweenFilter} AccessBetweenFilter + */ + AccessBetweenFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessBetweenFilter) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessBetweenFilter(); + if (object.fromValue != null) { + if (typeof object.fromValue !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessBetweenFilter.fromValue: object expected"); + message.fromValue = $root.google.analytics.admin.v1beta.NumericValue.fromObject(object.fromValue); + } + if (object.toValue != null) { + if (typeof object.toValue !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessBetweenFilter.toValue: object expected"); + message.toValue = $root.google.analytics.admin.v1beta.NumericValue.fromObject(object.toValue); + } + return message; + }; + + /** + * Creates a plain object from an AccessBetweenFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessBetweenFilter + * @static + * @param {google.analytics.admin.v1beta.AccessBetweenFilter} message AccessBetweenFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessBetweenFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fromValue = null; + object.toValue = null; + } + if (message.fromValue != null && message.hasOwnProperty("fromValue")) + object.fromValue = $root.google.analytics.admin.v1beta.NumericValue.toObject(message.fromValue, options); + if (message.toValue != null && message.hasOwnProperty("toValue")) + object.toValue = $root.google.analytics.admin.v1beta.NumericValue.toObject(message.toValue, options); + return object; + }; + + /** + * Converts this AccessBetweenFilter to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessBetweenFilter + * @instance + * @returns {Object.} JSON object + */ + AccessBetweenFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessBetweenFilter + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessBetweenFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessBetweenFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessBetweenFilter"; + }; + + return AccessBetweenFilter; + })(); + + v1beta.NumericValue = (function() { + + /** + * Properties of a NumericValue. + * @memberof google.analytics.admin.v1beta + * @interface INumericValue + * @property {number|Long|null} [int64Value] NumericValue int64Value + * @property {number|null} [doubleValue] NumericValue doubleValue + */ + + /** + * Constructs a new NumericValue. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents a NumericValue. + * @implements INumericValue + * @constructor + * @param {google.analytics.admin.v1beta.INumericValue=} [properties] Properties to set + */ + function NumericValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NumericValue int64Value. + * @member {number|Long|null|undefined} int64Value + * @memberof google.analytics.admin.v1beta.NumericValue + * @instance + */ + NumericValue.prototype.int64Value = null; + + /** + * NumericValue doubleValue. + * @member {number|null|undefined} doubleValue + * @memberof google.analytics.admin.v1beta.NumericValue + * @instance + */ + NumericValue.prototype.doubleValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NumericValue oneValue. + * @member {"int64Value"|"doubleValue"|undefined} oneValue + * @memberof google.analytics.admin.v1beta.NumericValue + * @instance + */ + Object.defineProperty(NumericValue.prototype, "oneValue", { + get: $util.oneOfGetter($oneOfFields = ["int64Value", "doubleValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NumericValue instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.NumericValue + * @static + * @param {google.analytics.admin.v1beta.INumericValue=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.NumericValue} NumericValue instance + */ + NumericValue.create = function create(properties) { + return new NumericValue(properties); + }; + + /** + * Encodes the specified NumericValue message. Does not implicitly {@link google.analytics.admin.v1beta.NumericValue.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.NumericValue + * @static + * @param {google.analytics.admin.v1beta.INumericValue} message NumericValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumericValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.int64Value != null && Object.hasOwnProperty.call(message, "int64Value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.int64Value); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.doubleValue); + return writer; + }; + + /** + * Encodes the specified NumericValue message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.NumericValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.NumericValue + * @static + * @param {google.analytics.admin.v1beta.INumericValue} message NumericValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumericValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NumericValue message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.NumericValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.NumericValue} NumericValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumericValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.NumericValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.int64Value = reader.int64(); + break; + } + case 2: { + message.doubleValue = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NumericValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.NumericValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.NumericValue} NumericValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumericValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NumericValue message. + * @function verify + * @memberof google.analytics.admin.v1beta.NumericValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NumericValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.int64Value != null && message.hasOwnProperty("int64Value")) { + properties.oneValue = 1; + if (!$util.isInteger(message.int64Value) && !(message.int64Value && $util.isInteger(message.int64Value.low) && $util.isInteger(message.int64Value.high))) + return "int64Value: integer|Long expected"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + if (properties.oneValue === 1) + return "oneValue: multiple values"; + properties.oneValue = 1; + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + } + return null; + }; + + /** + * Creates a NumericValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.NumericValue + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.NumericValue} NumericValue + */ + NumericValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.NumericValue) + return object; + var message = new $root.google.analytics.admin.v1beta.NumericValue(); + if (object.int64Value != null) + if ($util.Long) + (message.int64Value = $util.Long.fromValue(object.int64Value)).unsigned = false; + else if (typeof object.int64Value === "string") + message.int64Value = parseInt(object.int64Value, 10); + else if (typeof object.int64Value === "number") + message.int64Value = object.int64Value; + else if (typeof object.int64Value === "object") + message.int64Value = new $util.LongBits(object.int64Value.low >>> 0, object.int64Value.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + return message; + }; + + /** + * Creates a plain object from a NumericValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.NumericValue + * @static + * @param {google.analytics.admin.v1beta.NumericValue} message NumericValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NumericValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.int64Value != null && message.hasOwnProperty("int64Value")) { + if (typeof message.int64Value === "number") + object.int64Value = options.longs === String ? String(message.int64Value) : message.int64Value; + else + object.int64Value = options.longs === String ? $util.Long.prototype.toString.call(message.int64Value) : options.longs === Number ? new $util.LongBits(message.int64Value.low >>> 0, message.int64Value.high >>> 0).toNumber() : message.int64Value; + if (options.oneofs) + object.oneValue = "int64Value"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (options.oneofs) + object.oneValue = "doubleValue"; + } + return object; + }; + + /** + * Converts this NumericValue to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.NumericValue + * @instance + * @returns {Object.} JSON object + */ + NumericValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NumericValue + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.NumericValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NumericValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.NumericValue"; + }; + + return NumericValue; + })(); + + v1beta.AccessOrderBy = (function() { + + /** + * Properties of an AccessOrderBy. + * @memberof google.analytics.admin.v1beta + * @interface IAccessOrderBy + * @property {google.analytics.admin.v1beta.AccessOrderBy.IMetricOrderBy|null} [metric] AccessOrderBy metric + * @property {google.analytics.admin.v1beta.AccessOrderBy.IDimensionOrderBy|null} [dimension] AccessOrderBy dimension + * @property {boolean|null} [desc] AccessOrderBy desc + */ + + /** + * Constructs a new AccessOrderBy. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessOrderBy. + * @implements IAccessOrderBy + * @constructor + * @param {google.analytics.admin.v1beta.IAccessOrderBy=} [properties] Properties to set + */ + function AccessOrderBy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessOrderBy metric. + * @member {google.analytics.admin.v1beta.AccessOrderBy.IMetricOrderBy|null|undefined} metric + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @instance + */ + AccessOrderBy.prototype.metric = null; + + /** + * AccessOrderBy dimension. + * @member {google.analytics.admin.v1beta.AccessOrderBy.IDimensionOrderBy|null|undefined} dimension + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @instance + */ + AccessOrderBy.prototype.dimension = null; + + /** + * AccessOrderBy desc. + * @member {boolean} desc + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @instance + */ + AccessOrderBy.prototype.desc = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AccessOrderBy oneOrderBy. + * @member {"metric"|"dimension"|undefined} oneOrderBy + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @instance + */ + Object.defineProperty(AccessOrderBy.prototype, "oneOrderBy", { + get: $util.oneOfGetter($oneOfFields = ["metric", "dimension"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccessOrderBy instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @static + * @param {google.analytics.admin.v1beta.IAccessOrderBy=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessOrderBy} AccessOrderBy instance + */ + AccessOrderBy.create = function create(properties) { + return new AccessOrderBy(properties); + }; + + /** + * Encodes the specified AccessOrderBy message. Does not implicitly {@link google.analytics.admin.v1beta.AccessOrderBy.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @static + * @param {google.analytics.admin.v1beta.IAccessOrderBy} message AccessOrderBy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessOrderBy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) + $root.google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy.encode(message.metric, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dimension != null && Object.hasOwnProperty.call(message, "dimension")) + $root.google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.encode(message.dimension, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.desc != null && Object.hasOwnProperty.call(message, "desc")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.desc); + return writer; + }; + + /** + * Encodes the specified AccessOrderBy message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessOrderBy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @static + * @param {google.analytics.admin.v1beta.IAccessOrderBy} message AccessOrderBy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessOrderBy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessOrderBy message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessOrderBy} AccessOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessOrderBy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessOrderBy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metric = $root.google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.dimension = $root.google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.desc = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessOrderBy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessOrderBy} AccessOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessOrderBy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessOrderBy message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessOrderBy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.metric != null && message.hasOwnProperty("metric")) { + properties.oneOrderBy = 1; + { + var error = $root.google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy.verify(message.metric); + if (error) + return "metric." + error; + } + } + if (message.dimension != null && message.hasOwnProperty("dimension")) { + if (properties.oneOrderBy === 1) + return "oneOrderBy: multiple values"; + properties.oneOrderBy = 1; + { + var error = $root.google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.verify(message.dimension); + if (error) + return "dimension." + error; + } + } + if (message.desc != null && message.hasOwnProperty("desc")) + if (typeof message.desc !== "boolean") + return "desc: boolean expected"; + return null; + }; + + /** + * Creates an AccessOrderBy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessOrderBy} AccessOrderBy + */ + AccessOrderBy.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessOrderBy) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessOrderBy(); + if (object.metric != null) { + if (typeof object.metric !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessOrderBy.metric: object expected"); + message.metric = $root.google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy.fromObject(object.metric); + } + if (object.dimension != null) { + if (typeof object.dimension !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessOrderBy.dimension: object expected"); + message.dimension = $root.google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.fromObject(object.dimension); + } + if (object.desc != null) + message.desc = Boolean(object.desc); + return message; + }; + + /** + * Creates a plain object from an AccessOrderBy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @static + * @param {google.analytics.admin.v1beta.AccessOrderBy} message AccessOrderBy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessOrderBy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.desc = false; + if (message.metric != null && message.hasOwnProperty("metric")) { + object.metric = $root.google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy.toObject(message.metric, options); + if (options.oneofs) + object.oneOrderBy = "metric"; + } + if (message.dimension != null && message.hasOwnProperty("dimension")) { + object.dimension = $root.google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.toObject(message.dimension, options); + if (options.oneofs) + object.oneOrderBy = "dimension"; + } + if (message.desc != null && message.hasOwnProperty("desc")) + object.desc = message.desc; + return object; + }; + + /** + * Converts this AccessOrderBy to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @instance + * @returns {Object.} JSON object + */ + AccessOrderBy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessOrderBy + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessOrderBy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessOrderBy"; + }; + + AccessOrderBy.MetricOrderBy = (function() { + + /** + * Properties of a MetricOrderBy. + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @interface IMetricOrderBy + * @property {string|null} [metricName] MetricOrderBy metricName + */ + + /** + * Constructs a new MetricOrderBy. + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @classdesc Represents a MetricOrderBy. + * @implements IMetricOrderBy + * @constructor + * @param {google.analytics.admin.v1beta.AccessOrderBy.IMetricOrderBy=} [properties] Properties to set + */ + function MetricOrderBy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricOrderBy metricName. + * @member {string} metricName + * @memberof google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy + * @instance + */ + MetricOrderBy.prototype.metricName = ""; + + /** + * Creates a new MetricOrderBy instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy + * @static + * @param {google.analytics.admin.v1beta.AccessOrderBy.IMetricOrderBy=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy} MetricOrderBy instance + */ + MetricOrderBy.create = function create(properties) { + return new MetricOrderBy(properties); + }; + + /** + * Encodes the specified MetricOrderBy message. Does not implicitly {@link google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy + * @static + * @param {google.analytics.admin.v1beta.AccessOrderBy.IMetricOrderBy} message MetricOrderBy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricOrderBy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); + return writer; + }; + + /** + * Encodes the specified MetricOrderBy message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy + * @static + * @param {google.analytics.admin.v1beta.AccessOrderBy.IMetricOrderBy} message MetricOrderBy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricOrderBy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricOrderBy message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy} MetricOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricOrderBy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metricName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricOrderBy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy} MetricOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricOrderBy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricOrderBy message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricOrderBy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metricName != null && message.hasOwnProperty("metricName")) + if (!$util.isString(message.metricName)) + return "metricName: string expected"; + return null; + }; + + /** + * Creates a MetricOrderBy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy} MetricOrderBy + */ + MetricOrderBy.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy(); + if (object.metricName != null) + message.metricName = String(object.metricName); + return message; + }; + + /** + * Creates a plain object from a MetricOrderBy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy + * @static + * @param {google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy} message MetricOrderBy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricOrderBy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metricName = ""; + if (message.metricName != null && message.hasOwnProperty("metricName")) + object.metricName = message.metricName; + return object; + }; + + /** + * Converts this MetricOrderBy to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy + * @instance + * @returns {Object.} JSON object + */ + MetricOrderBy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricOrderBy + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricOrderBy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessOrderBy.MetricOrderBy"; + }; + + return MetricOrderBy; + })(); + + AccessOrderBy.DimensionOrderBy = (function() { + + /** + * Properties of a DimensionOrderBy. + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @interface IDimensionOrderBy + * @property {string|null} [dimensionName] DimensionOrderBy dimensionName + * @property {google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.OrderType|null} [orderType] DimensionOrderBy orderType + */ + + /** + * Constructs a new DimensionOrderBy. + * @memberof google.analytics.admin.v1beta.AccessOrderBy + * @classdesc Represents a DimensionOrderBy. + * @implements IDimensionOrderBy + * @constructor + * @param {google.analytics.admin.v1beta.AccessOrderBy.IDimensionOrderBy=} [properties] Properties to set + */ + function DimensionOrderBy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DimensionOrderBy dimensionName. + * @member {string} dimensionName + * @memberof google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy + * @instance + */ + DimensionOrderBy.prototype.dimensionName = ""; + + /** + * DimensionOrderBy orderType. + * @member {google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.OrderType} orderType + * @memberof google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy + * @instance + */ + DimensionOrderBy.prototype.orderType = 0; + + /** + * Creates a new DimensionOrderBy instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy + * @static + * @param {google.analytics.admin.v1beta.AccessOrderBy.IDimensionOrderBy=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy} DimensionOrderBy instance + */ + DimensionOrderBy.create = function create(properties) { + return new DimensionOrderBy(properties); + }; + + /** + * Encodes the specified DimensionOrderBy message. Does not implicitly {@link google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy + * @static + * @param {google.analytics.admin.v1beta.AccessOrderBy.IDimensionOrderBy} message DimensionOrderBy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionOrderBy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dimensionName != null && Object.hasOwnProperty.call(message, "dimensionName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dimensionName); + if (message.orderType != null && Object.hasOwnProperty.call(message, "orderType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.orderType); + return writer; + }; + + /** + * Encodes the specified DimensionOrderBy message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy + * @static + * @param {google.analytics.admin.v1beta.AccessOrderBy.IDimensionOrderBy} message DimensionOrderBy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionOrderBy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DimensionOrderBy message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy} DimensionOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionOrderBy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dimensionName = reader.string(); + break; + } + case 2: { + message.orderType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DimensionOrderBy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy} DimensionOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionOrderBy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DimensionOrderBy message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DimensionOrderBy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dimensionName != null && message.hasOwnProperty("dimensionName")) + if (!$util.isString(message.dimensionName)) + return "dimensionName: string expected"; + if (message.orderType != null && message.hasOwnProperty("orderType")) + switch (message.orderType) { + default: + return "orderType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a DimensionOrderBy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy} DimensionOrderBy + */ + DimensionOrderBy.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy(); + if (object.dimensionName != null) + message.dimensionName = String(object.dimensionName); + switch (object.orderType) { + default: + if (typeof object.orderType === "number") { + message.orderType = object.orderType; + break; + } + break; + case "ORDER_TYPE_UNSPECIFIED": + case 0: + message.orderType = 0; + break; + case "ALPHANUMERIC": + case 1: + message.orderType = 1; + break; + case "CASE_INSENSITIVE_ALPHANUMERIC": + case 2: + message.orderType = 2; + break; + case "NUMERIC": + case 3: + message.orderType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a DimensionOrderBy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy + * @static + * @param {google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy} message DimensionOrderBy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DimensionOrderBy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dimensionName = ""; + object.orderType = options.enums === String ? "ORDER_TYPE_UNSPECIFIED" : 0; + } + if (message.dimensionName != null && message.hasOwnProperty("dimensionName")) + object.dimensionName = message.dimensionName; + if (message.orderType != null && message.hasOwnProperty("orderType")) + object.orderType = options.enums === String ? $root.google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.OrderType[message.orderType] === undefined ? message.orderType : $root.google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.OrderType[message.orderType] : message.orderType; + return object; + }; + + /** + * Converts this DimensionOrderBy to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy + * @instance + * @returns {Object.} JSON object + */ + DimensionOrderBy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DimensionOrderBy + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DimensionOrderBy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy"; + }; + + /** + * OrderType enum. + * @name google.analytics.admin.v1beta.AccessOrderBy.DimensionOrderBy.OrderType + * @enum {number} + * @property {number} ORDER_TYPE_UNSPECIFIED=0 ORDER_TYPE_UNSPECIFIED value + * @property {number} ALPHANUMERIC=1 ALPHANUMERIC value + * @property {number} CASE_INSENSITIVE_ALPHANUMERIC=2 CASE_INSENSITIVE_ALPHANUMERIC value + * @property {number} NUMERIC=3 NUMERIC value + */ + DimensionOrderBy.OrderType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORDER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALPHANUMERIC"] = 1; + values[valuesById[2] = "CASE_INSENSITIVE_ALPHANUMERIC"] = 2; + values[valuesById[3] = "NUMERIC"] = 3; + return values; + })(); + + return DimensionOrderBy; + })(); + + return AccessOrderBy; + })(); + + v1beta.AccessDimensionHeader = (function() { + + /** + * Properties of an AccessDimensionHeader. + * @memberof google.analytics.admin.v1beta + * @interface IAccessDimensionHeader + * @property {string|null} [dimensionName] AccessDimensionHeader dimensionName + */ + + /** + * Constructs a new AccessDimensionHeader. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessDimensionHeader. + * @implements IAccessDimensionHeader + * @constructor + * @param {google.analytics.admin.v1beta.IAccessDimensionHeader=} [properties] Properties to set + */ + function AccessDimensionHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessDimensionHeader dimensionName. + * @member {string} dimensionName + * @memberof google.analytics.admin.v1beta.AccessDimensionHeader + * @instance + */ + AccessDimensionHeader.prototype.dimensionName = ""; + + /** + * Creates a new AccessDimensionHeader instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessDimensionHeader + * @static + * @param {google.analytics.admin.v1beta.IAccessDimensionHeader=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessDimensionHeader} AccessDimensionHeader instance + */ + AccessDimensionHeader.create = function create(properties) { + return new AccessDimensionHeader(properties); + }; + + /** + * Encodes the specified AccessDimensionHeader message. Does not implicitly {@link google.analytics.admin.v1beta.AccessDimensionHeader.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessDimensionHeader + * @static + * @param {google.analytics.admin.v1beta.IAccessDimensionHeader} message AccessDimensionHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessDimensionHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dimensionName != null && Object.hasOwnProperty.call(message, "dimensionName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dimensionName); + return writer; + }; + + /** + * Encodes the specified AccessDimensionHeader message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessDimensionHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessDimensionHeader + * @static + * @param {google.analytics.admin.v1beta.IAccessDimensionHeader} message AccessDimensionHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessDimensionHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessDimensionHeader message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessDimensionHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessDimensionHeader} AccessDimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessDimensionHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessDimensionHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dimensionName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessDimensionHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessDimensionHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessDimensionHeader} AccessDimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessDimensionHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessDimensionHeader message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessDimensionHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessDimensionHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dimensionName != null && message.hasOwnProperty("dimensionName")) + if (!$util.isString(message.dimensionName)) + return "dimensionName: string expected"; + return null; + }; + + /** + * Creates an AccessDimensionHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessDimensionHeader + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessDimensionHeader} AccessDimensionHeader + */ + AccessDimensionHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessDimensionHeader) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessDimensionHeader(); + if (object.dimensionName != null) + message.dimensionName = String(object.dimensionName); + return message; + }; + + /** + * Creates a plain object from an AccessDimensionHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessDimensionHeader + * @static + * @param {google.analytics.admin.v1beta.AccessDimensionHeader} message AccessDimensionHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessDimensionHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dimensionName = ""; + if (message.dimensionName != null && message.hasOwnProperty("dimensionName")) + object.dimensionName = message.dimensionName; + return object; + }; + + /** + * Converts this AccessDimensionHeader to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessDimensionHeader + * @instance + * @returns {Object.} JSON object + */ + AccessDimensionHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessDimensionHeader + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessDimensionHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessDimensionHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessDimensionHeader"; + }; + + return AccessDimensionHeader; + })(); + + v1beta.AccessMetricHeader = (function() { + + /** + * Properties of an AccessMetricHeader. + * @memberof google.analytics.admin.v1beta + * @interface IAccessMetricHeader + * @property {string|null} [metricName] AccessMetricHeader metricName + */ + + /** + * Constructs a new AccessMetricHeader. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessMetricHeader. + * @implements IAccessMetricHeader + * @constructor + * @param {google.analytics.admin.v1beta.IAccessMetricHeader=} [properties] Properties to set + */ + function AccessMetricHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessMetricHeader metricName. + * @member {string} metricName + * @memberof google.analytics.admin.v1beta.AccessMetricHeader + * @instance + */ + AccessMetricHeader.prototype.metricName = ""; + + /** + * Creates a new AccessMetricHeader instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessMetricHeader + * @static + * @param {google.analytics.admin.v1beta.IAccessMetricHeader=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessMetricHeader} AccessMetricHeader instance + */ + AccessMetricHeader.create = function create(properties) { + return new AccessMetricHeader(properties); + }; + + /** + * Encodes the specified AccessMetricHeader message. Does not implicitly {@link google.analytics.admin.v1beta.AccessMetricHeader.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessMetricHeader + * @static + * @param {google.analytics.admin.v1beta.IAccessMetricHeader} message AccessMetricHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessMetricHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); + return writer; + }; + + /** + * Encodes the specified AccessMetricHeader message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessMetricHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessMetricHeader + * @static + * @param {google.analytics.admin.v1beta.IAccessMetricHeader} message AccessMetricHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessMetricHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessMetricHeader message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessMetricHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessMetricHeader} AccessMetricHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessMetricHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessMetricHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metricName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessMetricHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessMetricHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessMetricHeader} AccessMetricHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessMetricHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessMetricHeader message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessMetricHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessMetricHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metricName != null && message.hasOwnProperty("metricName")) + if (!$util.isString(message.metricName)) + return "metricName: string expected"; + return null; + }; + + /** + * Creates an AccessMetricHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessMetricHeader + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessMetricHeader} AccessMetricHeader + */ + AccessMetricHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessMetricHeader) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessMetricHeader(); + if (object.metricName != null) + message.metricName = String(object.metricName); + return message; + }; + + /** + * Creates a plain object from an AccessMetricHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessMetricHeader + * @static + * @param {google.analytics.admin.v1beta.AccessMetricHeader} message AccessMetricHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessMetricHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metricName = ""; + if (message.metricName != null && message.hasOwnProperty("metricName")) + object.metricName = message.metricName; + return object; + }; + + /** + * Converts this AccessMetricHeader to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessMetricHeader + * @instance + * @returns {Object.} JSON object + */ + AccessMetricHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessMetricHeader + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessMetricHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessMetricHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessMetricHeader"; + }; + + return AccessMetricHeader; + })(); + + v1beta.AccessRow = (function() { + + /** + * Properties of an AccessRow. + * @memberof google.analytics.admin.v1beta + * @interface IAccessRow + * @property {Array.|null} [dimensionValues] AccessRow dimensionValues + * @property {Array.|null} [metricValues] AccessRow metricValues + */ + + /** + * Constructs a new AccessRow. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessRow. + * @implements IAccessRow + * @constructor + * @param {google.analytics.admin.v1beta.IAccessRow=} [properties] Properties to set + */ + function AccessRow(properties) { + this.dimensionValues = []; + this.metricValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessRow dimensionValues. + * @member {Array.} dimensionValues + * @memberof google.analytics.admin.v1beta.AccessRow + * @instance + */ + AccessRow.prototype.dimensionValues = $util.emptyArray; + + /** + * AccessRow metricValues. + * @member {Array.} metricValues + * @memberof google.analytics.admin.v1beta.AccessRow + * @instance + */ + AccessRow.prototype.metricValues = $util.emptyArray; + + /** + * Creates a new AccessRow instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessRow + * @static + * @param {google.analytics.admin.v1beta.IAccessRow=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessRow} AccessRow instance + */ + AccessRow.create = function create(properties) { + return new AccessRow(properties); + }; + + /** + * Encodes the specified AccessRow message. Does not implicitly {@link google.analytics.admin.v1beta.AccessRow.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessRow + * @static + * @param {google.analytics.admin.v1beta.IAccessRow} message AccessRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessRow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dimensionValues != null && message.dimensionValues.length) + for (var i = 0; i < message.dimensionValues.length; ++i) + $root.google.analytics.admin.v1beta.AccessDimensionValue.encode(message.dimensionValues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metricValues != null && message.metricValues.length) + for (var i = 0; i < message.metricValues.length; ++i) + $root.google.analytics.admin.v1beta.AccessMetricValue.encode(message.metricValues[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessRow message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessRow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessRow + * @static + * @param {google.analytics.admin.v1beta.IAccessRow} message AccessRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessRow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessRow message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessRow} AccessRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessRow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessRow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dimensionValues && message.dimensionValues.length)) + message.dimensionValues = []; + message.dimensionValues.push($root.google.analytics.admin.v1beta.AccessDimensionValue.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.metricValues && message.metricValues.length)) + message.metricValues = []; + message.metricValues.push($root.google.analytics.admin.v1beta.AccessMetricValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessRow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessRow} AccessRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessRow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessRow message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessRow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessRow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dimensionValues != null && message.hasOwnProperty("dimensionValues")) { + if (!Array.isArray(message.dimensionValues)) + return "dimensionValues: array expected"; + for (var i = 0; i < message.dimensionValues.length; ++i) { + var error = $root.google.analytics.admin.v1beta.AccessDimensionValue.verify(message.dimensionValues[i]); + if (error) + return "dimensionValues." + error; + } + } + if (message.metricValues != null && message.hasOwnProperty("metricValues")) { + if (!Array.isArray(message.metricValues)) + return "metricValues: array expected"; + for (var i = 0; i < message.metricValues.length; ++i) { + var error = $root.google.analytics.admin.v1beta.AccessMetricValue.verify(message.metricValues[i]); + if (error) + return "metricValues." + error; + } + } + return null; + }; + + /** + * Creates an AccessRow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessRow + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessRow} AccessRow + */ + AccessRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessRow) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessRow(); + if (object.dimensionValues) { + if (!Array.isArray(object.dimensionValues)) + throw TypeError(".google.analytics.admin.v1beta.AccessRow.dimensionValues: array expected"); + message.dimensionValues = []; + for (var i = 0; i < object.dimensionValues.length; ++i) { + if (typeof object.dimensionValues[i] !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessRow.dimensionValues: object expected"); + message.dimensionValues[i] = $root.google.analytics.admin.v1beta.AccessDimensionValue.fromObject(object.dimensionValues[i]); + } + } + if (object.metricValues) { + if (!Array.isArray(object.metricValues)) + throw TypeError(".google.analytics.admin.v1beta.AccessRow.metricValues: array expected"); + message.metricValues = []; + for (var i = 0; i < object.metricValues.length; ++i) { + if (typeof object.metricValues[i] !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessRow.metricValues: object expected"); + message.metricValues[i] = $root.google.analytics.admin.v1beta.AccessMetricValue.fromObject(object.metricValues[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AccessRow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessRow + * @static + * @param {google.analytics.admin.v1beta.AccessRow} message AccessRow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessRow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dimensionValues = []; + object.metricValues = []; + } + if (message.dimensionValues && message.dimensionValues.length) { + object.dimensionValues = []; + for (var j = 0; j < message.dimensionValues.length; ++j) + object.dimensionValues[j] = $root.google.analytics.admin.v1beta.AccessDimensionValue.toObject(message.dimensionValues[j], options); + } + if (message.metricValues && message.metricValues.length) { + object.metricValues = []; + for (var j = 0; j < message.metricValues.length; ++j) + object.metricValues[j] = $root.google.analytics.admin.v1beta.AccessMetricValue.toObject(message.metricValues[j], options); + } + return object; + }; + + /** + * Converts this AccessRow to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessRow + * @instance + * @returns {Object.} JSON object + */ + AccessRow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessRow + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessRow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessRow"; + }; + + return AccessRow; + })(); + + v1beta.AccessDimensionValue = (function() { + + /** + * Properties of an AccessDimensionValue. + * @memberof google.analytics.admin.v1beta + * @interface IAccessDimensionValue + * @property {string|null} [value] AccessDimensionValue value + */ + + /** + * Constructs a new AccessDimensionValue. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessDimensionValue. + * @implements IAccessDimensionValue + * @constructor + * @param {google.analytics.admin.v1beta.IAccessDimensionValue=} [properties] Properties to set + */ + function AccessDimensionValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessDimensionValue value. + * @member {string} value + * @memberof google.analytics.admin.v1beta.AccessDimensionValue + * @instance + */ + AccessDimensionValue.prototype.value = ""; + + /** + * Creates a new AccessDimensionValue instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessDimensionValue + * @static + * @param {google.analytics.admin.v1beta.IAccessDimensionValue=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessDimensionValue} AccessDimensionValue instance + */ + AccessDimensionValue.create = function create(properties) { + return new AccessDimensionValue(properties); + }; + + /** + * Encodes the specified AccessDimensionValue message. Does not implicitly {@link google.analytics.admin.v1beta.AccessDimensionValue.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessDimensionValue + * @static + * @param {google.analytics.admin.v1beta.IAccessDimensionValue} message AccessDimensionValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessDimensionValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified AccessDimensionValue message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessDimensionValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessDimensionValue + * @static + * @param {google.analytics.admin.v1beta.IAccessDimensionValue} message AccessDimensionValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessDimensionValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessDimensionValue message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessDimensionValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessDimensionValue} AccessDimensionValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessDimensionValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessDimensionValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessDimensionValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessDimensionValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessDimensionValue} AccessDimensionValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessDimensionValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessDimensionValue message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessDimensionValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessDimensionValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an AccessDimensionValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessDimensionValue + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessDimensionValue} AccessDimensionValue + */ + AccessDimensionValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessDimensionValue) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessDimensionValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an AccessDimensionValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessDimensionValue + * @static + * @param {google.analytics.admin.v1beta.AccessDimensionValue} message AccessDimensionValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessDimensionValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this AccessDimensionValue to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessDimensionValue + * @instance + * @returns {Object.} JSON object + */ + AccessDimensionValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessDimensionValue + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessDimensionValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessDimensionValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessDimensionValue"; + }; + + return AccessDimensionValue; + })(); + + v1beta.AccessMetricValue = (function() { + + /** + * Properties of an AccessMetricValue. + * @memberof google.analytics.admin.v1beta + * @interface IAccessMetricValue + * @property {string|null} [value] AccessMetricValue value + */ + + /** + * Constructs a new AccessMetricValue. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessMetricValue. + * @implements IAccessMetricValue + * @constructor + * @param {google.analytics.admin.v1beta.IAccessMetricValue=} [properties] Properties to set + */ + function AccessMetricValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessMetricValue value. + * @member {string} value + * @memberof google.analytics.admin.v1beta.AccessMetricValue + * @instance + */ + AccessMetricValue.prototype.value = ""; + + /** + * Creates a new AccessMetricValue instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessMetricValue + * @static + * @param {google.analytics.admin.v1beta.IAccessMetricValue=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessMetricValue} AccessMetricValue instance + */ + AccessMetricValue.create = function create(properties) { + return new AccessMetricValue(properties); + }; + + /** + * Encodes the specified AccessMetricValue message. Does not implicitly {@link google.analytics.admin.v1beta.AccessMetricValue.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessMetricValue + * @static + * @param {google.analytics.admin.v1beta.IAccessMetricValue} message AccessMetricValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessMetricValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified AccessMetricValue message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessMetricValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessMetricValue + * @static + * @param {google.analytics.admin.v1beta.IAccessMetricValue} message AccessMetricValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessMetricValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessMetricValue message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessMetricValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessMetricValue} AccessMetricValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessMetricValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessMetricValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessMetricValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessMetricValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessMetricValue} AccessMetricValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessMetricValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessMetricValue message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessMetricValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessMetricValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an AccessMetricValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessMetricValue + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessMetricValue} AccessMetricValue + */ + AccessMetricValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessMetricValue) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessMetricValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an AccessMetricValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessMetricValue + * @static + * @param {google.analytics.admin.v1beta.AccessMetricValue} message AccessMetricValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessMetricValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this AccessMetricValue to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessMetricValue + * @instance + * @returns {Object.} JSON object + */ + AccessMetricValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessMetricValue + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessMetricValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessMetricValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessMetricValue"; + }; + + return AccessMetricValue; + })(); + + v1beta.AccessQuota = (function() { + + /** + * Properties of an AccessQuota. + * @memberof google.analytics.admin.v1beta + * @interface IAccessQuota + * @property {google.analytics.admin.v1beta.IAccessQuotaStatus|null} [tokensPerDay] AccessQuota tokensPerDay + * @property {google.analytics.admin.v1beta.IAccessQuotaStatus|null} [tokensPerHour] AccessQuota tokensPerHour + * @property {google.analytics.admin.v1beta.IAccessQuotaStatus|null} [concurrentRequests] AccessQuota concurrentRequests + * @property {google.analytics.admin.v1beta.IAccessQuotaStatus|null} [serverErrorsPerProjectPerHour] AccessQuota serverErrorsPerProjectPerHour + * @property {google.analytics.admin.v1beta.IAccessQuotaStatus|null} [tokensPerProjectPerHour] AccessQuota tokensPerProjectPerHour + */ + + /** + * Constructs a new AccessQuota. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessQuota. + * @implements IAccessQuota + * @constructor + * @param {google.analytics.admin.v1beta.IAccessQuota=} [properties] Properties to set + */ + function AccessQuota(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessQuota tokensPerDay. + * @member {google.analytics.admin.v1beta.IAccessQuotaStatus|null|undefined} tokensPerDay + * @memberof google.analytics.admin.v1beta.AccessQuota + * @instance + */ + AccessQuota.prototype.tokensPerDay = null; + + /** + * AccessQuota tokensPerHour. + * @member {google.analytics.admin.v1beta.IAccessQuotaStatus|null|undefined} tokensPerHour + * @memberof google.analytics.admin.v1beta.AccessQuota + * @instance + */ + AccessQuota.prototype.tokensPerHour = null; + + /** + * AccessQuota concurrentRequests. + * @member {google.analytics.admin.v1beta.IAccessQuotaStatus|null|undefined} concurrentRequests + * @memberof google.analytics.admin.v1beta.AccessQuota + * @instance + */ + AccessQuota.prototype.concurrentRequests = null; + + /** + * AccessQuota serverErrorsPerProjectPerHour. + * @member {google.analytics.admin.v1beta.IAccessQuotaStatus|null|undefined} serverErrorsPerProjectPerHour + * @memberof google.analytics.admin.v1beta.AccessQuota + * @instance + */ + AccessQuota.prototype.serverErrorsPerProjectPerHour = null; + + /** + * AccessQuota tokensPerProjectPerHour. + * @member {google.analytics.admin.v1beta.IAccessQuotaStatus|null|undefined} tokensPerProjectPerHour + * @memberof google.analytics.admin.v1beta.AccessQuota + * @instance + */ + AccessQuota.prototype.tokensPerProjectPerHour = null; + + /** + * Creates a new AccessQuota instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessQuota + * @static + * @param {google.analytics.admin.v1beta.IAccessQuota=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessQuota} AccessQuota instance + */ + AccessQuota.create = function create(properties) { + return new AccessQuota(properties); + }; + + /** + * Encodes the specified AccessQuota message. Does not implicitly {@link google.analytics.admin.v1beta.AccessQuota.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessQuota + * @static + * @param {google.analytics.admin.v1beta.IAccessQuota} message AccessQuota message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessQuota.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokensPerDay != null && Object.hasOwnProperty.call(message, "tokensPerDay")) + $root.google.analytics.admin.v1beta.AccessQuotaStatus.encode(message.tokensPerDay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tokensPerHour != null && Object.hasOwnProperty.call(message, "tokensPerHour")) + $root.google.analytics.admin.v1beta.AccessQuotaStatus.encode(message.tokensPerHour, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.concurrentRequests != null && Object.hasOwnProperty.call(message, "concurrentRequests")) + $root.google.analytics.admin.v1beta.AccessQuotaStatus.encode(message.concurrentRequests, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serverErrorsPerProjectPerHour != null && Object.hasOwnProperty.call(message, "serverErrorsPerProjectPerHour")) + $root.google.analytics.admin.v1beta.AccessQuotaStatus.encode(message.serverErrorsPerProjectPerHour, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tokensPerProjectPerHour != null && Object.hasOwnProperty.call(message, "tokensPerProjectPerHour")) + $root.google.analytics.admin.v1beta.AccessQuotaStatus.encode(message.tokensPerProjectPerHour, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessQuota message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessQuota.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessQuota + * @static + * @param {google.analytics.admin.v1beta.IAccessQuota} message AccessQuota message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessQuota.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessQuota message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessQuota + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessQuota} AccessQuota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessQuota.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessQuota(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tokensPerDay = $root.google.analytics.admin.v1beta.AccessQuotaStatus.decode(reader, reader.uint32()); + break; + } + case 2: { + message.tokensPerHour = $root.google.analytics.admin.v1beta.AccessQuotaStatus.decode(reader, reader.uint32()); + break; + } + case 3: { + message.concurrentRequests = $root.google.analytics.admin.v1beta.AccessQuotaStatus.decode(reader, reader.uint32()); + break; + } + case 4: { + message.serverErrorsPerProjectPerHour = $root.google.analytics.admin.v1beta.AccessQuotaStatus.decode(reader, reader.uint32()); + break; + } + case 5: { + message.tokensPerProjectPerHour = $root.google.analytics.admin.v1beta.AccessQuotaStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessQuota message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessQuota + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessQuota} AccessQuota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessQuota.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessQuota message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessQuota + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessQuota.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokensPerDay != null && message.hasOwnProperty("tokensPerDay")) { + var error = $root.google.analytics.admin.v1beta.AccessQuotaStatus.verify(message.tokensPerDay); + if (error) + return "tokensPerDay." + error; + } + if (message.tokensPerHour != null && message.hasOwnProperty("tokensPerHour")) { + var error = $root.google.analytics.admin.v1beta.AccessQuotaStatus.verify(message.tokensPerHour); + if (error) + return "tokensPerHour." + error; + } + if (message.concurrentRequests != null && message.hasOwnProperty("concurrentRequests")) { + var error = $root.google.analytics.admin.v1beta.AccessQuotaStatus.verify(message.concurrentRequests); + if (error) + return "concurrentRequests." + error; + } + if (message.serverErrorsPerProjectPerHour != null && message.hasOwnProperty("serverErrorsPerProjectPerHour")) { + var error = $root.google.analytics.admin.v1beta.AccessQuotaStatus.verify(message.serverErrorsPerProjectPerHour); + if (error) + return "serverErrorsPerProjectPerHour." + error; + } + if (message.tokensPerProjectPerHour != null && message.hasOwnProperty("tokensPerProjectPerHour")) { + var error = $root.google.analytics.admin.v1beta.AccessQuotaStatus.verify(message.tokensPerProjectPerHour); + if (error) + return "tokensPerProjectPerHour." + error; + } + return null; + }; + + /** + * Creates an AccessQuota message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessQuota + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessQuota} AccessQuota + */ + AccessQuota.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessQuota) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessQuota(); + if (object.tokensPerDay != null) { + if (typeof object.tokensPerDay !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessQuota.tokensPerDay: object expected"); + message.tokensPerDay = $root.google.analytics.admin.v1beta.AccessQuotaStatus.fromObject(object.tokensPerDay); + } + if (object.tokensPerHour != null) { + if (typeof object.tokensPerHour !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessQuota.tokensPerHour: object expected"); + message.tokensPerHour = $root.google.analytics.admin.v1beta.AccessQuotaStatus.fromObject(object.tokensPerHour); + } + if (object.concurrentRequests != null) { + if (typeof object.concurrentRequests !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessQuota.concurrentRequests: object expected"); + message.concurrentRequests = $root.google.analytics.admin.v1beta.AccessQuotaStatus.fromObject(object.concurrentRequests); + } + if (object.serverErrorsPerProjectPerHour != null) { + if (typeof object.serverErrorsPerProjectPerHour !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessQuota.serverErrorsPerProjectPerHour: object expected"); + message.serverErrorsPerProjectPerHour = $root.google.analytics.admin.v1beta.AccessQuotaStatus.fromObject(object.serverErrorsPerProjectPerHour); + } + if (object.tokensPerProjectPerHour != null) { + if (typeof object.tokensPerProjectPerHour !== "object") + throw TypeError(".google.analytics.admin.v1beta.AccessQuota.tokensPerProjectPerHour: object expected"); + message.tokensPerProjectPerHour = $root.google.analytics.admin.v1beta.AccessQuotaStatus.fromObject(object.tokensPerProjectPerHour); + } + return message; + }; + + /** + * Creates a plain object from an AccessQuota message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessQuota + * @static + * @param {google.analytics.admin.v1beta.AccessQuota} message AccessQuota + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessQuota.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tokensPerDay = null; + object.tokensPerHour = null; + object.concurrentRequests = null; + object.serverErrorsPerProjectPerHour = null; + object.tokensPerProjectPerHour = null; + } + if (message.tokensPerDay != null && message.hasOwnProperty("tokensPerDay")) + object.tokensPerDay = $root.google.analytics.admin.v1beta.AccessQuotaStatus.toObject(message.tokensPerDay, options); + if (message.tokensPerHour != null && message.hasOwnProperty("tokensPerHour")) + object.tokensPerHour = $root.google.analytics.admin.v1beta.AccessQuotaStatus.toObject(message.tokensPerHour, options); + if (message.concurrentRequests != null && message.hasOwnProperty("concurrentRequests")) + object.concurrentRequests = $root.google.analytics.admin.v1beta.AccessQuotaStatus.toObject(message.concurrentRequests, options); + if (message.serverErrorsPerProjectPerHour != null && message.hasOwnProperty("serverErrorsPerProjectPerHour")) + object.serverErrorsPerProjectPerHour = $root.google.analytics.admin.v1beta.AccessQuotaStatus.toObject(message.serverErrorsPerProjectPerHour, options); + if (message.tokensPerProjectPerHour != null && message.hasOwnProperty("tokensPerProjectPerHour")) + object.tokensPerProjectPerHour = $root.google.analytics.admin.v1beta.AccessQuotaStatus.toObject(message.tokensPerProjectPerHour, options); + return object; + }; + + /** + * Converts this AccessQuota to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessQuota + * @instance + * @returns {Object.} JSON object + */ + AccessQuota.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessQuota + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessQuota + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessQuota.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessQuota"; + }; + + return AccessQuota; + })(); + + v1beta.AccessQuotaStatus = (function() { + + /** + * Properties of an AccessQuotaStatus. + * @memberof google.analytics.admin.v1beta + * @interface IAccessQuotaStatus + * @property {number|null} [consumed] AccessQuotaStatus consumed + * @property {number|null} [remaining] AccessQuotaStatus remaining + */ + + /** + * Constructs a new AccessQuotaStatus. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AccessQuotaStatus. + * @implements IAccessQuotaStatus + * @constructor + * @param {google.analytics.admin.v1beta.IAccessQuotaStatus=} [properties] Properties to set + */ + function AccessQuotaStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessQuotaStatus consumed. + * @member {number} consumed + * @memberof google.analytics.admin.v1beta.AccessQuotaStatus + * @instance + */ + AccessQuotaStatus.prototype.consumed = 0; + + /** + * AccessQuotaStatus remaining. + * @member {number} remaining + * @memberof google.analytics.admin.v1beta.AccessQuotaStatus + * @instance + */ + AccessQuotaStatus.prototype.remaining = 0; + + /** + * Creates a new AccessQuotaStatus instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.AccessQuotaStatus + * @static + * @param {google.analytics.admin.v1beta.IAccessQuotaStatus=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.AccessQuotaStatus} AccessQuotaStatus instance + */ + AccessQuotaStatus.create = function create(properties) { + return new AccessQuotaStatus(properties); + }; + + /** + * Encodes the specified AccessQuotaStatus message. Does not implicitly {@link google.analytics.admin.v1beta.AccessQuotaStatus.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.AccessQuotaStatus + * @static + * @param {google.analytics.admin.v1beta.IAccessQuotaStatus} message AccessQuotaStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessQuotaStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consumed != null && Object.hasOwnProperty.call(message, "consumed")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.consumed); + if (message.remaining != null && Object.hasOwnProperty.call(message, "remaining")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.remaining); + return writer; + }; + + /** + * Encodes the specified AccessQuotaStatus message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.AccessQuotaStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.AccessQuotaStatus + * @static + * @param {google.analytics.admin.v1beta.IAccessQuotaStatus} message AccessQuotaStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessQuotaStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessQuotaStatus message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.AccessQuotaStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.AccessQuotaStatus} AccessQuotaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessQuotaStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.AccessQuotaStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.consumed = reader.int32(); + break; + } + case 2: { + message.remaining = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessQuotaStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.AccessQuotaStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.AccessQuotaStatus} AccessQuotaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessQuotaStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessQuotaStatus message. + * @function verify + * @memberof google.analytics.admin.v1beta.AccessQuotaStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessQuotaStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consumed != null && message.hasOwnProperty("consumed")) + if (!$util.isInteger(message.consumed)) + return "consumed: integer expected"; + if (message.remaining != null && message.hasOwnProperty("remaining")) + if (!$util.isInteger(message.remaining)) + return "remaining: integer expected"; + return null; + }; + + /** + * Creates an AccessQuotaStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.AccessQuotaStatus + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.AccessQuotaStatus} AccessQuotaStatus + */ + AccessQuotaStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.AccessQuotaStatus) + return object; + var message = new $root.google.analytics.admin.v1beta.AccessQuotaStatus(); + if (object.consumed != null) + message.consumed = object.consumed | 0; + if (object.remaining != null) + message.remaining = object.remaining | 0; + return message; + }; + + /** + * Creates a plain object from an AccessQuotaStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.AccessQuotaStatus + * @static + * @param {google.analytics.admin.v1beta.AccessQuotaStatus} message AccessQuotaStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessQuotaStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.consumed = 0; + object.remaining = 0; + } + if (message.consumed != null && message.hasOwnProperty("consumed")) + object.consumed = message.consumed; + if (message.remaining != null && message.hasOwnProperty("remaining")) + object.remaining = message.remaining; + return object; + }; + + /** + * Converts this AccessQuotaStatus to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.AccessQuotaStatus + * @instance + * @returns {Object.} JSON object + */ + AccessQuotaStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessQuotaStatus + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.AccessQuotaStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessQuotaStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.AccessQuotaStatus"; + }; + + return AccessQuotaStatus; + })(); + + v1beta.AnalyticsAdminService = (function() { + + /** + * Constructs a new AnalyticsAdminService service. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents an AnalyticsAdminService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AnalyticsAdminService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AnalyticsAdminService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AnalyticsAdminService; + + /** + * Creates new AnalyticsAdminService service using the specified rpc implementation. + * @function create + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AnalyticsAdminService} RPC service. Useful where requests and/or responses are streamed. + */ + AnalyticsAdminService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getAccount}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef GetAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.Account} [response] Account + */ + + /** + * Calls GetAccount. + * @function getAccount + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetAccountRequest} request GetAccountRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetAccountCallback} callback Node-style callback called with the error, if any, and Account + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.getAccount = function getAccount(request, callback) { + return this.rpcCall(getAccount, $root.google.analytics.admin.v1beta.GetAccountRequest, $root.google.analytics.admin.v1beta.Account, request, callback); + }, "name", { value: "GetAccount" }); + + /** + * Calls GetAccount. + * @function getAccount + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetAccountRequest} request GetAccountRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listAccounts}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef ListAccountsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.ListAccountsResponse} [response] ListAccountsResponse + */ + + /** + * Calls ListAccounts. + * @function listAccounts + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListAccountsRequest} request ListAccountsRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListAccountsCallback} callback Node-style callback called with the error, if any, and ListAccountsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.listAccounts = function listAccounts(request, callback) { + return this.rpcCall(listAccounts, $root.google.analytics.admin.v1beta.ListAccountsRequest, $root.google.analytics.admin.v1beta.ListAccountsResponse, request, callback); + }, "name", { value: "ListAccounts" }); + + /** + * Calls ListAccounts. + * @function listAccounts + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListAccountsRequest} request ListAccountsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|deleteAccount}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef DeleteAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAccount. + * @function deleteAccount + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IDeleteAccountRequest} request DeleteAccountRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.DeleteAccountCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.deleteAccount = function deleteAccount(request, callback) { + return this.rpcCall(deleteAccount, $root.google.analytics.admin.v1beta.DeleteAccountRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAccount" }); + + /** + * Calls DeleteAccount. + * @function deleteAccount + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IDeleteAccountRequest} request DeleteAccountRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateAccount}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef UpdateAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.Account} [response] Account + */ + + /** + * Calls UpdateAccount. + * @function updateAccount + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdateAccountRequest} request UpdateAccountRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdateAccountCallback} callback Node-style callback called with the error, if any, and Account + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.updateAccount = function updateAccount(request, callback) { + return this.rpcCall(updateAccount, $root.google.analytics.admin.v1beta.UpdateAccountRequest, $root.google.analytics.admin.v1beta.Account, request, callback); + }, "name", { value: "UpdateAccount" }); + + /** + * Calls UpdateAccount. + * @function updateAccount + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdateAccountRequest} request UpdateAccountRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|provisionAccountTicket}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef ProvisionAccountTicketCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.ProvisionAccountTicketResponse} [response] ProvisionAccountTicketResponse + */ + + /** + * Calls ProvisionAccountTicket. + * @function provisionAccountTicket + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IProvisionAccountTicketRequest} request ProvisionAccountTicketRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ProvisionAccountTicketCallback} callback Node-style callback called with the error, if any, and ProvisionAccountTicketResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.provisionAccountTicket = function provisionAccountTicket(request, callback) { + return this.rpcCall(provisionAccountTicket, $root.google.analytics.admin.v1beta.ProvisionAccountTicketRequest, $root.google.analytics.admin.v1beta.ProvisionAccountTicketResponse, request, callback); + }, "name", { value: "ProvisionAccountTicket" }); + + /** + * Calls ProvisionAccountTicket. + * @function provisionAccountTicket + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IProvisionAccountTicketRequest} request ProvisionAccountTicketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listAccountSummaries}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef ListAccountSummariesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.ListAccountSummariesResponse} [response] ListAccountSummariesResponse + */ + + /** + * Calls ListAccountSummaries. + * @function listAccountSummaries + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListAccountSummariesRequest} request ListAccountSummariesRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListAccountSummariesCallback} callback Node-style callback called with the error, if any, and ListAccountSummariesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.listAccountSummaries = function listAccountSummaries(request, callback) { + return this.rpcCall(listAccountSummaries, $root.google.analytics.admin.v1beta.ListAccountSummariesRequest, $root.google.analytics.admin.v1beta.ListAccountSummariesResponse, request, callback); + }, "name", { value: "ListAccountSummaries" }); + + /** + * Calls ListAccountSummaries. + * @function listAccountSummaries + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListAccountSummariesRequest} request ListAccountSummariesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getProperty}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef GetPropertyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.Property} [response] Property + */ + + /** + * Calls GetProperty. + * @function getProperty + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetPropertyRequest} request GetPropertyRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetPropertyCallback} callback Node-style callback called with the error, if any, and Property + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.getProperty = function getProperty(request, callback) { + return this.rpcCall(getProperty, $root.google.analytics.admin.v1beta.GetPropertyRequest, $root.google.analytics.admin.v1beta.Property, request, callback); + }, "name", { value: "GetProperty" }); + + /** + * Calls GetProperty. + * @function getProperty + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetPropertyRequest} request GetPropertyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listProperties}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef ListPropertiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.ListPropertiesResponse} [response] ListPropertiesResponse + */ + + /** + * Calls ListProperties. + * @function listProperties + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListPropertiesRequest} request ListPropertiesRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListPropertiesCallback} callback Node-style callback called with the error, if any, and ListPropertiesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.listProperties = function listProperties(request, callback) { + return this.rpcCall(listProperties, $root.google.analytics.admin.v1beta.ListPropertiesRequest, $root.google.analytics.admin.v1beta.ListPropertiesResponse, request, callback); + }, "name", { value: "ListProperties" }); + + /** + * Calls ListProperties. + * @function listProperties + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListPropertiesRequest} request ListPropertiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createProperty}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef CreatePropertyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.Property} [response] Property + */ + + /** + * Calls CreateProperty. + * @function createProperty + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreatePropertyRequest} request CreatePropertyRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreatePropertyCallback} callback Node-style callback called with the error, if any, and Property + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.createProperty = function createProperty(request, callback) { + return this.rpcCall(createProperty, $root.google.analytics.admin.v1beta.CreatePropertyRequest, $root.google.analytics.admin.v1beta.Property, request, callback); + }, "name", { value: "CreateProperty" }); + + /** + * Calls CreateProperty. + * @function createProperty + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreatePropertyRequest} request CreatePropertyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|deleteProperty}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef DeletePropertyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.Property} [response] Property + */ + + /** + * Calls DeleteProperty. + * @function deleteProperty + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IDeletePropertyRequest} request DeletePropertyRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.DeletePropertyCallback} callback Node-style callback called with the error, if any, and Property + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.deleteProperty = function deleteProperty(request, callback) { + return this.rpcCall(deleteProperty, $root.google.analytics.admin.v1beta.DeletePropertyRequest, $root.google.analytics.admin.v1beta.Property, request, callback); + }, "name", { value: "DeleteProperty" }); + + /** + * Calls DeleteProperty. + * @function deleteProperty + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IDeletePropertyRequest} request DeletePropertyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateProperty}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef UpdatePropertyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.Property} [response] Property + */ + + /** + * Calls UpdateProperty. + * @function updateProperty + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdatePropertyRequest} request UpdatePropertyRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdatePropertyCallback} callback Node-style callback called with the error, if any, and Property + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.updateProperty = function updateProperty(request, callback) { + return this.rpcCall(updateProperty, $root.google.analytics.admin.v1beta.UpdatePropertyRequest, $root.google.analytics.admin.v1beta.Property, request, callback); + }, "name", { value: "UpdateProperty" }); + + /** + * Calls UpdateProperty. + * @function updateProperty + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdatePropertyRequest} request UpdatePropertyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createFirebaseLink}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef CreateFirebaseLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.FirebaseLink} [response] FirebaseLink + */ + + /** + * Calls CreateFirebaseLink. + * @function createFirebaseLink + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreateFirebaseLinkRequest} request CreateFirebaseLinkRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreateFirebaseLinkCallback} callback Node-style callback called with the error, if any, and FirebaseLink + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.createFirebaseLink = function createFirebaseLink(request, callback) { + return this.rpcCall(createFirebaseLink, $root.google.analytics.admin.v1beta.CreateFirebaseLinkRequest, $root.google.analytics.admin.v1beta.FirebaseLink, request, callback); + }, "name", { value: "CreateFirebaseLink" }); + + /** + * Calls CreateFirebaseLink. + * @function createFirebaseLink + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreateFirebaseLinkRequest} request CreateFirebaseLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|deleteFirebaseLink}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef DeleteFirebaseLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteFirebaseLink. + * @function deleteFirebaseLink + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest} request DeleteFirebaseLinkRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.DeleteFirebaseLinkCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.deleteFirebaseLink = function deleteFirebaseLink(request, callback) { + return this.rpcCall(deleteFirebaseLink, $root.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteFirebaseLink" }); + + /** + * Calls DeleteFirebaseLink. + * @function deleteFirebaseLink + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest} request DeleteFirebaseLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listFirebaseLinks}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef ListFirebaseLinksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.ListFirebaseLinksResponse} [response] ListFirebaseLinksResponse + */ + + /** + * Calls ListFirebaseLinks. + * @function listFirebaseLinks + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListFirebaseLinksRequest} request ListFirebaseLinksRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListFirebaseLinksCallback} callback Node-style callback called with the error, if any, and ListFirebaseLinksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.listFirebaseLinks = function listFirebaseLinks(request, callback) { + return this.rpcCall(listFirebaseLinks, $root.google.analytics.admin.v1beta.ListFirebaseLinksRequest, $root.google.analytics.admin.v1beta.ListFirebaseLinksResponse, request, callback); + }, "name", { value: "ListFirebaseLinks" }); + + /** + * Calls ListFirebaseLinks. + * @function listFirebaseLinks + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListFirebaseLinksRequest} request ListFirebaseLinksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createGoogleAdsLink}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef CreateGoogleAdsLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.GoogleAdsLink} [response] GoogleAdsLink + */ + + /** + * Calls CreateGoogleAdsLink. + * @function createGoogleAdsLink + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest} request CreateGoogleAdsLinkRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreateGoogleAdsLinkCallback} callback Node-style callback called with the error, if any, and GoogleAdsLink + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.createGoogleAdsLink = function createGoogleAdsLink(request, callback) { + return this.rpcCall(createGoogleAdsLink, $root.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest, $root.google.analytics.admin.v1beta.GoogleAdsLink, request, callback); + }, "name", { value: "CreateGoogleAdsLink" }); + + /** + * Calls CreateGoogleAdsLink. + * @function createGoogleAdsLink + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest} request CreateGoogleAdsLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateGoogleAdsLink}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef UpdateGoogleAdsLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.GoogleAdsLink} [response] GoogleAdsLink + */ + + /** + * Calls UpdateGoogleAdsLink. + * @function updateGoogleAdsLink + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest} request UpdateGoogleAdsLinkRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdateGoogleAdsLinkCallback} callback Node-style callback called with the error, if any, and GoogleAdsLink + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.updateGoogleAdsLink = function updateGoogleAdsLink(request, callback) { + return this.rpcCall(updateGoogleAdsLink, $root.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest, $root.google.analytics.admin.v1beta.GoogleAdsLink, request, callback); + }, "name", { value: "UpdateGoogleAdsLink" }); + + /** + * Calls UpdateGoogleAdsLink. + * @function updateGoogleAdsLink + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest} request UpdateGoogleAdsLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|deleteGoogleAdsLink}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef DeleteGoogleAdsLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteGoogleAdsLink. + * @function deleteGoogleAdsLink + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest} request DeleteGoogleAdsLinkRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.DeleteGoogleAdsLinkCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.deleteGoogleAdsLink = function deleteGoogleAdsLink(request, callback) { + return this.rpcCall(deleteGoogleAdsLink, $root.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteGoogleAdsLink" }); + + /** + * Calls DeleteGoogleAdsLink. + * @function deleteGoogleAdsLink + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest} request DeleteGoogleAdsLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listGoogleAdsLinks}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef ListGoogleAdsLinksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.ListGoogleAdsLinksResponse} [response] ListGoogleAdsLinksResponse + */ + + /** + * Calls ListGoogleAdsLinks. + * @function listGoogleAdsLinks + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListGoogleAdsLinksRequest} request ListGoogleAdsLinksRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListGoogleAdsLinksCallback} callback Node-style callback called with the error, if any, and ListGoogleAdsLinksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.listGoogleAdsLinks = function listGoogleAdsLinks(request, callback) { + return this.rpcCall(listGoogleAdsLinks, $root.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest, $root.google.analytics.admin.v1beta.ListGoogleAdsLinksResponse, request, callback); + }, "name", { value: "ListGoogleAdsLinks" }); + + /** + * Calls ListGoogleAdsLinks. + * @function listGoogleAdsLinks + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListGoogleAdsLinksRequest} request ListGoogleAdsLinksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getDataSharingSettings}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef GetDataSharingSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.DataSharingSettings} [response] DataSharingSettings + */ + + /** + * Calls GetDataSharingSettings. + * @function getDataSharingSettings + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetDataSharingSettingsRequest} request GetDataSharingSettingsRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetDataSharingSettingsCallback} callback Node-style callback called with the error, if any, and DataSharingSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.getDataSharingSettings = function getDataSharingSettings(request, callback) { + return this.rpcCall(getDataSharingSettings, $root.google.analytics.admin.v1beta.GetDataSharingSettingsRequest, $root.google.analytics.admin.v1beta.DataSharingSettings, request, callback); + }, "name", { value: "GetDataSharingSettings" }); + + /** + * Calls GetDataSharingSettings. + * @function getDataSharingSettings + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetDataSharingSettingsRequest} request GetDataSharingSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getMeasurementProtocolSecret}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef GetMeasurementProtocolSecretCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.MeasurementProtocolSecret} [response] MeasurementProtocolSecret + */ + + /** + * Calls GetMeasurementProtocolSecret. + * @function getMeasurementProtocolSecret + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest} request GetMeasurementProtocolSecretRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetMeasurementProtocolSecretCallback} callback Node-style callback called with the error, if any, and MeasurementProtocolSecret + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.getMeasurementProtocolSecret = function getMeasurementProtocolSecret(request, callback) { + return this.rpcCall(getMeasurementProtocolSecret, $root.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest, $root.google.analytics.admin.v1beta.MeasurementProtocolSecret, request, callback); + }, "name", { value: "GetMeasurementProtocolSecret" }); + + /** + * Calls GetMeasurementProtocolSecret. + * @function getMeasurementProtocolSecret + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest} request GetMeasurementProtocolSecretRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listMeasurementProtocolSecrets}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef ListMeasurementProtocolSecretsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.ListMeasurementProtocolSecretsResponse} [response] ListMeasurementProtocolSecretsResponse + */ + + /** + * Calls ListMeasurementProtocolSecrets. + * @function listMeasurementProtocolSecrets + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest} request ListMeasurementProtocolSecretsRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListMeasurementProtocolSecretsCallback} callback Node-style callback called with the error, if any, and ListMeasurementProtocolSecretsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.listMeasurementProtocolSecrets = function listMeasurementProtocolSecrets(request, callback) { + return this.rpcCall(listMeasurementProtocolSecrets, $root.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest, $root.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsResponse, request, callback); + }, "name", { value: "ListMeasurementProtocolSecrets" }); + + /** + * Calls ListMeasurementProtocolSecrets. + * @function listMeasurementProtocolSecrets + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest} request ListMeasurementProtocolSecretsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createMeasurementProtocolSecret}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef CreateMeasurementProtocolSecretCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.MeasurementProtocolSecret} [response] MeasurementProtocolSecret + */ + + /** + * Calls CreateMeasurementProtocolSecret. + * @function createMeasurementProtocolSecret + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest} request CreateMeasurementProtocolSecretRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreateMeasurementProtocolSecretCallback} callback Node-style callback called with the error, if any, and MeasurementProtocolSecret + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.createMeasurementProtocolSecret = function createMeasurementProtocolSecret(request, callback) { + return this.rpcCall(createMeasurementProtocolSecret, $root.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest, $root.google.analytics.admin.v1beta.MeasurementProtocolSecret, request, callback); + }, "name", { value: "CreateMeasurementProtocolSecret" }); + + /** + * Calls CreateMeasurementProtocolSecret. + * @function createMeasurementProtocolSecret + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest} request CreateMeasurementProtocolSecretRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|deleteMeasurementProtocolSecret}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef DeleteMeasurementProtocolSecretCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteMeasurementProtocolSecret. + * @function deleteMeasurementProtocolSecret + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest} request DeleteMeasurementProtocolSecretRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.DeleteMeasurementProtocolSecretCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.deleteMeasurementProtocolSecret = function deleteMeasurementProtocolSecret(request, callback) { + return this.rpcCall(deleteMeasurementProtocolSecret, $root.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteMeasurementProtocolSecret" }); + + /** + * Calls DeleteMeasurementProtocolSecret. + * @function deleteMeasurementProtocolSecret + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest} request DeleteMeasurementProtocolSecretRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateMeasurementProtocolSecret}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef UpdateMeasurementProtocolSecretCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.MeasurementProtocolSecret} [response] MeasurementProtocolSecret + */ + + /** + * Calls UpdateMeasurementProtocolSecret. + * @function updateMeasurementProtocolSecret + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest} request UpdateMeasurementProtocolSecretRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdateMeasurementProtocolSecretCallback} callback Node-style callback called with the error, if any, and MeasurementProtocolSecret + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.updateMeasurementProtocolSecret = function updateMeasurementProtocolSecret(request, callback) { + return this.rpcCall(updateMeasurementProtocolSecret, $root.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest, $root.google.analytics.admin.v1beta.MeasurementProtocolSecret, request, callback); + }, "name", { value: "UpdateMeasurementProtocolSecret" }); + + /** + * Calls UpdateMeasurementProtocolSecret. + * @function updateMeasurementProtocolSecret + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest} request UpdateMeasurementProtocolSecretRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|acknowledgeUserDataCollection}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef AcknowledgeUserDataCollectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse} [response] AcknowledgeUserDataCollectionResponse + */ + + /** + * Calls AcknowledgeUserDataCollection. + * @function acknowledgeUserDataCollection + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest} request AcknowledgeUserDataCollectionRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.AcknowledgeUserDataCollectionCallback} callback Node-style callback called with the error, if any, and AcknowledgeUserDataCollectionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.acknowledgeUserDataCollection = function acknowledgeUserDataCollection(request, callback) { + return this.rpcCall(acknowledgeUserDataCollection, $root.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest, $root.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse, request, callback); + }, "name", { value: "AcknowledgeUserDataCollection" }); + + /** + * Calls AcknowledgeUserDataCollection. + * @function acknowledgeUserDataCollection + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest} request AcknowledgeUserDataCollectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|searchChangeHistoryEvents}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef SearchChangeHistoryEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.SearchChangeHistoryEventsResponse} [response] SearchChangeHistoryEventsResponse + */ + + /** + * Calls SearchChangeHistoryEvents. + * @function searchChangeHistoryEvents + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest} request SearchChangeHistoryEventsRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.SearchChangeHistoryEventsCallback} callback Node-style callback called with the error, if any, and SearchChangeHistoryEventsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.searchChangeHistoryEvents = function searchChangeHistoryEvents(request, callback) { + return this.rpcCall(searchChangeHistoryEvents, $root.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest, $root.google.analytics.admin.v1beta.SearchChangeHistoryEventsResponse, request, callback); + }, "name", { value: "SearchChangeHistoryEvents" }); + + /** + * Calls SearchChangeHistoryEvents. + * @function searchChangeHistoryEvents + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest} request SearchChangeHistoryEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createConversionEvent}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef CreateConversionEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.ConversionEvent} [response] ConversionEvent + */ + + /** + * Calls CreateConversionEvent. + * @function createConversionEvent + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreateConversionEventRequest} request CreateConversionEventRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreateConversionEventCallback} callback Node-style callback called with the error, if any, and ConversionEvent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.createConversionEvent = function createConversionEvent(request, callback) { + return this.rpcCall(createConversionEvent, $root.google.analytics.admin.v1beta.CreateConversionEventRequest, $root.google.analytics.admin.v1beta.ConversionEvent, request, callback); + }, "name", { value: "CreateConversionEvent" }); + + /** + * Calls CreateConversionEvent. + * @function createConversionEvent + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreateConversionEventRequest} request CreateConversionEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getConversionEvent}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef GetConversionEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.ConversionEvent} [response] ConversionEvent + */ + + /** + * Calls GetConversionEvent. + * @function getConversionEvent + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetConversionEventRequest} request GetConversionEventRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetConversionEventCallback} callback Node-style callback called with the error, if any, and ConversionEvent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.getConversionEvent = function getConversionEvent(request, callback) { + return this.rpcCall(getConversionEvent, $root.google.analytics.admin.v1beta.GetConversionEventRequest, $root.google.analytics.admin.v1beta.ConversionEvent, request, callback); + }, "name", { value: "GetConversionEvent" }); + + /** + * Calls GetConversionEvent. + * @function getConversionEvent + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetConversionEventRequest} request GetConversionEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|deleteConversionEvent}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef DeleteConversionEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteConversionEvent. + * @function deleteConversionEvent + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IDeleteConversionEventRequest} request DeleteConversionEventRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.DeleteConversionEventCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.deleteConversionEvent = function deleteConversionEvent(request, callback) { + return this.rpcCall(deleteConversionEvent, $root.google.analytics.admin.v1beta.DeleteConversionEventRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteConversionEvent" }); + + /** + * Calls DeleteConversionEvent. + * @function deleteConversionEvent + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IDeleteConversionEventRequest} request DeleteConversionEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listConversionEvents}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef ListConversionEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.ListConversionEventsResponse} [response] ListConversionEventsResponse + */ + + /** + * Calls ListConversionEvents. + * @function listConversionEvents + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListConversionEventsRequest} request ListConversionEventsRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListConversionEventsCallback} callback Node-style callback called with the error, if any, and ListConversionEventsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.listConversionEvents = function listConversionEvents(request, callback) { + return this.rpcCall(listConversionEvents, $root.google.analytics.admin.v1beta.ListConversionEventsRequest, $root.google.analytics.admin.v1beta.ListConversionEventsResponse, request, callback); + }, "name", { value: "ListConversionEvents" }); + + /** + * Calls ListConversionEvents. + * @function listConversionEvents + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListConversionEventsRequest} request ListConversionEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createCustomDimension}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef CreateCustomDimensionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.CustomDimension} [response] CustomDimension + */ + + /** + * Calls CreateCustomDimension. + * @function createCustomDimension + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreateCustomDimensionRequest} request CreateCustomDimensionRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreateCustomDimensionCallback} callback Node-style callback called with the error, if any, and CustomDimension + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.createCustomDimension = function createCustomDimension(request, callback) { + return this.rpcCall(createCustomDimension, $root.google.analytics.admin.v1beta.CreateCustomDimensionRequest, $root.google.analytics.admin.v1beta.CustomDimension, request, callback); + }, "name", { value: "CreateCustomDimension" }); + + /** + * Calls CreateCustomDimension. + * @function createCustomDimension + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreateCustomDimensionRequest} request CreateCustomDimensionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateCustomDimension}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef UpdateCustomDimensionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.CustomDimension} [response] CustomDimension + */ + + /** + * Calls UpdateCustomDimension. + * @function updateCustomDimension + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdateCustomDimensionRequest} request UpdateCustomDimensionRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdateCustomDimensionCallback} callback Node-style callback called with the error, if any, and CustomDimension + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.updateCustomDimension = function updateCustomDimension(request, callback) { + return this.rpcCall(updateCustomDimension, $root.google.analytics.admin.v1beta.UpdateCustomDimensionRequest, $root.google.analytics.admin.v1beta.CustomDimension, request, callback); + }, "name", { value: "UpdateCustomDimension" }); + + /** + * Calls UpdateCustomDimension. + * @function updateCustomDimension + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdateCustomDimensionRequest} request UpdateCustomDimensionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listCustomDimensions}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef ListCustomDimensionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.ListCustomDimensionsResponse} [response] ListCustomDimensionsResponse + */ + + /** + * Calls ListCustomDimensions. + * @function listCustomDimensions + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListCustomDimensionsRequest} request ListCustomDimensionsRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListCustomDimensionsCallback} callback Node-style callback called with the error, if any, and ListCustomDimensionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.listCustomDimensions = function listCustomDimensions(request, callback) { + return this.rpcCall(listCustomDimensions, $root.google.analytics.admin.v1beta.ListCustomDimensionsRequest, $root.google.analytics.admin.v1beta.ListCustomDimensionsResponse, request, callback); + }, "name", { value: "ListCustomDimensions" }); + + /** + * Calls ListCustomDimensions. + * @function listCustomDimensions + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListCustomDimensionsRequest} request ListCustomDimensionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|archiveCustomDimension}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef ArchiveCustomDimensionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls ArchiveCustomDimension. + * @function archiveCustomDimension + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IArchiveCustomDimensionRequest} request ArchiveCustomDimensionRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ArchiveCustomDimensionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.archiveCustomDimension = function archiveCustomDimension(request, callback) { + return this.rpcCall(archiveCustomDimension, $root.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "ArchiveCustomDimension" }); + + /** + * Calls ArchiveCustomDimension. + * @function archiveCustomDimension + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IArchiveCustomDimensionRequest} request ArchiveCustomDimensionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getCustomDimension}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef GetCustomDimensionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.CustomDimension} [response] CustomDimension + */ + + /** + * Calls GetCustomDimension. + * @function getCustomDimension + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetCustomDimensionRequest} request GetCustomDimensionRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetCustomDimensionCallback} callback Node-style callback called with the error, if any, and CustomDimension + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.getCustomDimension = function getCustomDimension(request, callback) { + return this.rpcCall(getCustomDimension, $root.google.analytics.admin.v1beta.GetCustomDimensionRequest, $root.google.analytics.admin.v1beta.CustomDimension, request, callback); + }, "name", { value: "GetCustomDimension" }); + + /** + * Calls GetCustomDimension. + * @function getCustomDimension + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetCustomDimensionRequest} request GetCustomDimensionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createCustomMetric}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef CreateCustomMetricCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.CustomMetric} [response] CustomMetric + */ + + /** + * Calls CreateCustomMetric. + * @function createCustomMetric + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreateCustomMetricRequest} request CreateCustomMetricRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreateCustomMetricCallback} callback Node-style callback called with the error, if any, and CustomMetric + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.createCustomMetric = function createCustomMetric(request, callback) { + return this.rpcCall(createCustomMetric, $root.google.analytics.admin.v1beta.CreateCustomMetricRequest, $root.google.analytics.admin.v1beta.CustomMetric, request, callback); + }, "name", { value: "CreateCustomMetric" }); + + /** + * Calls CreateCustomMetric. + * @function createCustomMetric + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreateCustomMetricRequest} request CreateCustomMetricRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateCustomMetric}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef UpdateCustomMetricCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.CustomMetric} [response] CustomMetric + */ + + /** + * Calls UpdateCustomMetric. + * @function updateCustomMetric + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdateCustomMetricRequest} request UpdateCustomMetricRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdateCustomMetricCallback} callback Node-style callback called with the error, if any, and CustomMetric + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.updateCustomMetric = function updateCustomMetric(request, callback) { + return this.rpcCall(updateCustomMetric, $root.google.analytics.admin.v1beta.UpdateCustomMetricRequest, $root.google.analytics.admin.v1beta.CustomMetric, request, callback); + }, "name", { value: "UpdateCustomMetric" }); + + /** + * Calls UpdateCustomMetric. + * @function updateCustomMetric + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdateCustomMetricRequest} request UpdateCustomMetricRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listCustomMetrics}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef ListCustomMetricsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.ListCustomMetricsResponse} [response] ListCustomMetricsResponse + */ + + /** + * Calls ListCustomMetrics. + * @function listCustomMetrics + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListCustomMetricsRequest} request ListCustomMetricsRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListCustomMetricsCallback} callback Node-style callback called with the error, if any, and ListCustomMetricsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.listCustomMetrics = function listCustomMetrics(request, callback) { + return this.rpcCall(listCustomMetrics, $root.google.analytics.admin.v1beta.ListCustomMetricsRequest, $root.google.analytics.admin.v1beta.ListCustomMetricsResponse, request, callback); + }, "name", { value: "ListCustomMetrics" }); + + /** + * Calls ListCustomMetrics. + * @function listCustomMetrics + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListCustomMetricsRequest} request ListCustomMetricsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|archiveCustomMetric}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef ArchiveCustomMetricCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls ArchiveCustomMetric. + * @function archiveCustomMetric + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IArchiveCustomMetricRequest} request ArchiveCustomMetricRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ArchiveCustomMetricCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.archiveCustomMetric = function archiveCustomMetric(request, callback) { + return this.rpcCall(archiveCustomMetric, $root.google.analytics.admin.v1beta.ArchiveCustomMetricRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "ArchiveCustomMetric" }); + + /** + * Calls ArchiveCustomMetric. + * @function archiveCustomMetric + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IArchiveCustomMetricRequest} request ArchiveCustomMetricRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getCustomMetric}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef GetCustomMetricCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.CustomMetric} [response] CustomMetric + */ + + /** + * Calls GetCustomMetric. + * @function getCustomMetric + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetCustomMetricRequest} request GetCustomMetricRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetCustomMetricCallback} callback Node-style callback called with the error, if any, and CustomMetric + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.getCustomMetric = function getCustomMetric(request, callback) { + return this.rpcCall(getCustomMetric, $root.google.analytics.admin.v1beta.GetCustomMetricRequest, $root.google.analytics.admin.v1beta.CustomMetric, request, callback); + }, "name", { value: "GetCustomMetric" }); + + /** + * Calls GetCustomMetric. + * @function getCustomMetric + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetCustomMetricRequest} request GetCustomMetricRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getDataRetentionSettings}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef GetDataRetentionSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.DataRetentionSettings} [response] DataRetentionSettings + */ + + /** + * Calls GetDataRetentionSettings. + * @function getDataRetentionSettings + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest} request GetDataRetentionSettingsRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetDataRetentionSettingsCallback} callback Node-style callback called with the error, if any, and DataRetentionSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.getDataRetentionSettings = function getDataRetentionSettings(request, callback) { + return this.rpcCall(getDataRetentionSettings, $root.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest, $root.google.analytics.admin.v1beta.DataRetentionSettings, request, callback); + }, "name", { value: "GetDataRetentionSettings" }); + + /** + * Calls GetDataRetentionSettings. + * @function getDataRetentionSettings + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest} request GetDataRetentionSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateDataRetentionSettings}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef UpdateDataRetentionSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.DataRetentionSettings} [response] DataRetentionSettings + */ + + /** + * Calls UpdateDataRetentionSettings. + * @function updateDataRetentionSettings + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest} request UpdateDataRetentionSettingsRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdateDataRetentionSettingsCallback} callback Node-style callback called with the error, if any, and DataRetentionSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.updateDataRetentionSettings = function updateDataRetentionSettings(request, callback) { + return this.rpcCall(updateDataRetentionSettings, $root.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest, $root.google.analytics.admin.v1beta.DataRetentionSettings, request, callback); + }, "name", { value: "UpdateDataRetentionSettings" }); + + /** + * Calls UpdateDataRetentionSettings. + * @function updateDataRetentionSettings + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest} request UpdateDataRetentionSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|createDataStream}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef CreateDataStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.DataStream} [response] DataStream + */ + + /** + * Calls CreateDataStream. + * @function createDataStream + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreateDataStreamRequest} request CreateDataStreamRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.CreateDataStreamCallback} callback Node-style callback called with the error, if any, and DataStream + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.createDataStream = function createDataStream(request, callback) { + return this.rpcCall(createDataStream, $root.google.analytics.admin.v1beta.CreateDataStreamRequest, $root.google.analytics.admin.v1beta.DataStream, request, callback); + }, "name", { value: "CreateDataStream" }); + + /** + * Calls CreateDataStream. + * @function createDataStream + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.ICreateDataStreamRequest} request CreateDataStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|deleteDataStream}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef DeleteDataStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDataStream. + * @function deleteDataStream + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IDeleteDataStreamRequest} request DeleteDataStreamRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.DeleteDataStreamCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.deleteDataStream = function deleteDataStream(request, callback) { + return this.rpcCall(deleteDataStream, $root.google.analytics.admin.v1beta.DeleteDataStreamRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDataStream" }); + + /** + * Calls DeleteDataStream. + * @function deleteDataStream + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IDeleteDataStreamRequest} request DeleteDataStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|updateDataStream}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef UpdateDataStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.DataStream} [response] DataStream + */ + + /** + * Calls UpdateDataStream. + * @function updateDataStream + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdateDataStreamRequest} request UpdateDataStreamRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.UpdateDataStreamCallback} callback Node-style callback called with the error, if any, and DataStream + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.updateDataStream = function updateDataStream(request, callback) { + return this.rpcCall(updateDataStream, $root.google.analytics.admin.v1beta.UpdateDataStreamRequest, $root.google.analytics.admin.v1beta.DataStream, request, callback); + }, "name", { value: "UpdateDataStream" }); + + /** + * Calls UpdateDataStream. + * @function updateDataStream + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IUpdateDataStreamRequest} request UpdateDataStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|listDataStreams}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef ListDataStreamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.ListDataStreamsResponse} [response] ListDataStreamsResponse + */ + + /** + * Calls ListDataStreams. + * @function listDataStreams + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListDataStreamsRequest} request ListDataStreamsRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.ListDataStreamsCallback} callback Node-style callback called with the error, if any, and ListDataStreamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.listDataStreams = function listDataStreams(request, callback) { + return this.rpcCall(listDataStreams, $root.google.analytics.admin.v1beta.ListDataStreamsRequest, $root.google.analytics.admin.v1beta.ListDataStreamsResponse, request, callback); + }, "name", { value: "ListDataStreams" }); + + /** + * Calls ListDataStreams. + * @function listDataStreams + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IListDataStreamsRequest} request ListDataStreamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|getDataStream}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef GetDataStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.DataStream} [response] DataStream + */ + + /** + * Calls GetDataStream. + * @function getDataStream + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetDataStreamRequest} request GetDataStreamRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.GetDataStreamCallback} callback Node-style callback called with the error, if any, and DataStream + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.getDataStream = function getDataStream(request, callback) { + return this.rpcCall(getDataStream, $root.google.analytics.admin.v1beta.GetDataStreamRequest, $root.google.analytics.admin.v1beta.DataStream, request, callback); + }, "name", { value: "GetDataStream" }); + + /** + * Calls GetDataStream. + * @function getDataStream + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IGetDataStreamRequest} request GetDataStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.admin.v1beta.AnalyticsAdminService|runAccessReport}. + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @typedef RunAccessReportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1beta.RunAccessReportResponse} [response] RunAccessReportResponse + */ + + /** + * Calls RunAccessReport. + * @function runAccessReport + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IRunAccessReportRequest} request RunAccessReportRequest message or plain object + * @param {google.analytics.admin.v1beta.AnalyticsAdminService.RunAccessReportCallback} callback Node-style callback called with the error, if any, and RunAccessReportResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.runAccessReport = function runAccessReport(request, callback) { + return this.rpcCall(runAccessReport, $root.google.analytics.admin.v1beta.RunAccessReportRequest, $root.google.analytics.admin.v1beta.RunAccessReportResponse, request, callback); + }, "name", { value: "RunAccessReport" }); + + /** + * Calls RunAccessReport. + * @function runAccessReport + * @memberof google.analytics.admin.v1beta.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1beta.IRunAccessReportRequest} request RunAccessReportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AnalyticsAdminService; + })(); + + v1beta.RunAccessReportRequest = (function() { + + /** + * Properties of a RunAccessReportRequest. + * @memberof google.analytics.admin.v1beta + * @interface IRunAccessReportRequest + * @property {string|null} [entity] RunAccessReportRequest entity + * @property {Array.|null} [dimensions] RunAccessReportRequest dimensions + * @property {Array.|null} [metrics] RunAccessReportRequest metrics + * @property {Array.|null} [dateRanges] RunAccessReportRequest dateRanges + * @property {google.analytics.admin.v1beta.IAccessFilterExpression|null} [dimensionFilter] RunAccessReportRequest dimensionFilter + * @property {google.analytics.admin.v1beta.IAccessFilterExpression|null} [metricFilter] RunAccessReportRequest metricFilter + * @property {number|Long|null} [offset] RunAccessReportRequest offset + * @property {number|Long|null} [limit] RunAccessReportRequest limit + * @property {string|null} [timeZone] RunAccessReportRequest timeZone + * @property {Array.|null} [orderBys] RunAccessReportRequest orderBys + * @property {boolean|null} [returnEntityQuota] RunAccessReportRequest returnEntityQuota + */ + + /** + * Constructs a new RunAccessReportRequest. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents a RunAccessReportRequest. + * @implements IRunAccessReportRequest + * @constructor + * @param {google.analytics.admin.v1beta.IRunAccessReportRequest=} [properties] Properties to set + */ + function RunAccessReportRequest(properties) { + this.dimensions = []; + this.metrics = []; + this.dateRanges = []; + this.orderBys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunAccessReportRequest entity. + * @member {string} entity + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @instance + */ + RunAccessReportRequest.prototype.entity = ""; + + /** + * RunAccessReportRequest dimensions. + * @member {Array.} dimensions + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @instance + */ + RunAccessReportRequest.prototype.dimensions = $util.emptyArray; + + /** + * RunAccessReportRequest metrics. + * @member {Array.} metrics + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @instance + */ + RunAccessReportRequest.prototype.metrics = $util.emptyArray; + + /** + * RunAccessReportRequest dateRanges. + * @member {Array.} dateRanges + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @instance + */ + RunAccessReportRequest.prototype.dateRanges = $util.emptyArray; + + /** + * RunAccessReportRequest dimensionFilter. + * @member {google.analytics.admin.v1beta.IAccessFilterExpression|null|undefined} dimensionFilter + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @instance + */ + RunAccessReportRequest.prototype.dimensionFilter = null; + + /** + * RunAccessReportRequest metricFilter. + * @member {google.analytics.admin.v1beta.IAccessFilterExpression|null|undefined} metricFilter + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @instance + */ + RunAccessReportRequest.prototype.metricFilter = null; + + /** + * RunAccessReportRequest offset. + * @member {number|Long} offset + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @instance + */ + RunAccessReportRequest.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RunAccessReportRequest limit. + * @member {number|Long} limit + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @instance + */ + RunAccessReportRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RunAccessReportRequest timeZone. + * @member {string} timeZone + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @instance + */ + RunAccessReportRequest.prototype.timeZone = ""; + + /** + * RunAccessReportRequest orderBys. + * @member {Array.} orderBys + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @instance + */ + RunAccessReportRequest.prototype.orderBys = $util.emptyArray; + + /** + * RunAccessReportRequest returnEntityQuota. + * @member {boolean} returnEntityQuota + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @instance + */ + RunAccessReportRequest.prototype.returnEntityQuota = false; + + /** + * Creates a new RunAccessReportRequest instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @static + * @param {google.analytics.admin.v1beta.IRunAccessReportRequest=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.RunAccessReportRequest} RunAccessReportRequest instance + */ + RunAccessReportRequest.create = function create(properties) { + return new RunAccessReportRequest(properties); + }; + + /** + * Encodes the specified RunAccessReportRequest message. Does not implicitly {@link google.analytics.admin.v1beta.RunAccessReportRequest.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @static + * @param {google.analytics.admin.v1beta.IRunAccessReportRequest} message RunAccessReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAccessReportRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entity); + if (message.dimensions != null && message.dimensions.length) + for (var i = 0; i < message.dimensions.length; ++i) + $root.google.analytics.admin.v1beta.AccessDimension.encode(message.dimensions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + $root.google.analytics.admin.v1beta.AccessMetric.encode(message.metrics[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dateRanges != null && message.dateRanges.length) + for (var i = 0; i < message.dateRanges.length; ++i) + $root.google.analytics.admin.v1beta.AccessDateRange.encode(message.dateRanges[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.dimensionFilter != null && Object.hasOwnProperty.call(message, "dimensionFilter")) + $root.google.analytics.admin.v1beta.AccessFilterExpression.encode(message.dimensionFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.metricFilter != null && Object.hasOwnProperty.call(message, "metricFilter")) + $root.google.analytics.admin.v1beta.AccessFilterExpression.encode(message.metricFilter, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.offset); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.limit); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.timeZone); + if (message.orderBys != null && message.orderBys.length) + for (var i = 0; i < message.orderBys.length; ++i) + $root.google.analytics.admin.v1beta.AccessOrderBy.encode(message.orderBys[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.returnEntityQuota != null && Object.hasOwnProperty.call(message, "returnEntityQuota")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.returnEntityQuota); + return writer; + }; + + /** + * Encodes the specified RunAccessReportRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.RunAccessReportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @static + * @param {google.analytics.admin.v1beta.IRunAccessReportRequest} message RunAccessReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAccessReportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAccessReportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.RunAccessReportRequest} RunAccessReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAccessReportRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.RunAccessReportRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entity = reader.string(); + break; + } + case 2: { + if (!(message.dimensions && message.dimensions.length)) + message.dimensions = []; + message.dimensions.push($root.google.analytics.admin.v1beta.AccessDimension.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.analytics.admin.v1beta.AccessMetric.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.dateRanges && message.dateRanges.length)) + message.dateRanges = []; + message.dateRanges.push($root.google.analytics.admin.v1beta.AccessDateRange.decode(reader, reader.uint32())); + break; + } + case 5: { + message.dimensionFilter = $root.google.analytics.admin.v1beta.AccessFilterExpression.decode(reader, reader.uint32()); + break; + } + case 6: { + message.metricFilter = $root.google.analytics.admin.v1beta.AccessFilterExpression.decode(reader, reader.uint32()); + break; + } + case 7: { + message.offset = reader.int64(); + break; + } + case 8: { + message.limit = reader.int64(); + break; + } + case 9: { + message.timeZone = reader.string(); + break; + } + case 10: { + if (!(message.orderBys && message.orderBys.length)) + message.orderBys = []; + message.orderBys.push($root.google.analytics.admin.v1beta.AccessOrderBy.decode(reader, reader.uint32())); + break; + } + case 11: { + message.returnEntityQuota = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAccessReportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.RunAccessReportRequest} RunAccessReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAccessReportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAccessReportRequest message. + * @function verify + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAccessReportRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entity != null && message.hasOwnProperty("entity")) + if (!$util.isString(message.entity)) + return "entity: string expected"; + if (message.dimensions != null && message.hasOwnProperty("dimensions")) { + if (!Array.isArray(message.dimensions)) + return "dimensions: array expected"; + for (var i = 0; i < message.dimensions.length; ++i) { + var error = $root.google.analytics.admin.v1beta.AccessDimension.verify(message.dimensions[i]); + if (error) + return "dimensions." + error; + } + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) { + var error = $root.google.analytics.admin.v1beta.AccessMetric.verify(message.metrics[i]); + if (error) + return "metrics." + error; + } + } + if (message.dateRanges != null && message.hasOwnProperty("dateRanges")) { + if (!Array.isArray(message.dateRanges)) + return "dateRanges: array expected"; + for (var i = 0; i < message.dateRanges.length; ++i) { + var error = $root.google.analytics.admin.v1beta.AccessDateRange.verify(message.dateRanges[i]); + if (error) + return "dateRanges." + error; + } + } + if (message.dimensionFilter != null && message.hasOwnProperty("dimensionFilter")) { + var error = $root.google.analytics.admin.v1beta.AccessFilterExpression.verify(message.dimensionFilter); + if (error) + return "dimensionFilter." + error; + } + if (message.metricFilter != null && message.hasOwnProperty("metricFilter")) { + var error = $root.google.analytics.admin.v1beta.AccessFilterExpression.verify(message.metricFilter); + if (error) + return "metricFilter." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) + return "offset: integer|Long expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) + return "limit: integer|Long expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.orderBys != null && message.hasOwnProperty("orderBys")) { + if (!Array.isArray(message.orderBys)) + return "orderBys: array expected"; + for (var i = 0; i < message.orderBys.length; ++i) { + var error = $root.google.analytics.admin.v1beta.AccessOrderBy.verify(message.orderBys[i]); + if (error) + return "orderBys." + error; + } + } + if (message.returnEntityQuota != null && message.hasOwnProperty("returnEntityQuota")) + if (typeof message.returnEntityQuota !== "boolean") + return "returnEntityQuota: boolean expected"; + return null; + }; + + /** + * Creates a RunAccessReportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.RunAccessReportRequest} RunAccessReportRequest + */ + RunAccessReportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.RunAccessReportRequest) + return object; + var message = new $root.google.analytics.admin.v1beta.RunAccessReportRequest(); + if (object.entity != null) + message.entity = String(object.entity); + if (object.dimensions) { + if (!Array.isArray(object.dimensions)) + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportRequest.dimensions: array expected"); + message.dimensions = []; + for (var i = 0; i < object.dimensions.length; ++i) { + if (typeof object.dimensions[i] !== "object") + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportRequest.dimensions: object expected"); + message.dimensions[i] = $root.google.analytics.admin.v1beta.AccessDimension.fromObject(object.dimensions[i]); + } + } + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportRequest.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportRequest.metrics: object expected"); + message.metrics[i] = $root.google.analytics.admin.v1beta.AccessMetric.fromObject(object.metrics[i]); + } + } + if (object.dateRanges) { + if (!Array.isArray(object.dateRanges)) + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportRequest.dateRanges: array expected"); + message.dateRanges = []; + for (var i = 0; i < object.dateRanges.length; ++i) { + if (typeof object.dateRanges[i] !== "object") + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportRequest.dateRanges: object expected"); + message.dateRanges[i] = $root.google.analytics.admin.v1beta.AccessDateRange.fromObject(object.dateRanges[i]); + } + } + if (object.dimensionFilter != null) { + if (typeof object.dimensionFilter !== "object") + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportRequest.dimensionFilter: object expected"); + message.dimensionFilter = $root.google.analytics.admin.v1beta.AccessFilterExpression.fromObject(object.dimensionFilter); + } + if (object.metricFilter != null) { + if (typeof object.metricFilter !== "object") + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportRequest.metricFilter: object expected"); + message.metricFilter = $root.google.analytics.admin.v1beta.AccessFilterExpression.fromObject(object.metricFilter); + } + if (object.offset != null) + if ($util.Long) + (message.offset = $util.Long.fromValue(object.offset)).unsigned = false; + else if (typeof object.offset === "string") + message.offset = parseInt(object.offset, 10); + else if (typeof object.offset === "number") + message.offset = object.offset; + else if (typeof object.offset === "object") + message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(); + if (object.limit != null) + if ($util.Long) + (message.limit = $util.Long.fromValue(object.limit)).unsigned = false; + else if (typeof object.limit === "string") + message.limit = parseInt(object.limit, 10); + else if (typeof object.limit === "number") + message.limit = object.limit; + else if (typeof object.limit === "object") + message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.orderBys) { + if (!Array.isArray(object.orderBys)) + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportRequest.orderBys: array expected"); + message.orderBys = []; + for (var i = 0; i < object.orderBys.length; ++i) { + if (typeof object.orderBys[i] !== "object") + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportRequest.orderBys: object expected"); + message.orderBys[i] = $root.google.analytics.admin.v1beta.AccessOrderBy.fromObject(object.orderBys[i]); + } + } + if (object.returnEntityQuota != null) + message.returnEntityQuota = Boolean(object.returnEntityQuota); + return message; + }; + + /** + * Creates a plain object from a RunAccessReportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @static + * @param {google.analytics.admin.v1beta.RunAccessReportRequest} message RunAccessReportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAccessReportRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dimensions = []; + object.metrics = []; + object.dateRanges = []; + object.orderBys = []; + } + if (options.defaults) { + object.entity = ""; + object.dimensionFilter = null; + object.metricFilter = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offset = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.limit = options.longs === String ? "0" : 0; + object.timeZone = ""; + object.returnEntityQuota = false; + } + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = message.entity; + if (message.dimensions && message.dimensions.length) { + object.dimensions = []; + for (var j = 0; j < message.dimensions.length; ++j) + object.dimensions[j] = $root.google.analytics.admin.v1beta.AccessDimension.toObject(message.dimensions[j], options); + } + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) + object.metrics[j] = $root.google.analytics.admin.v1beta.AccessMetric.toObject(message.metrics[j], options); + } + if (message.dateRanges && message.dateRanges.length) { + object.dateRanges = []; + for (var j = 0; j < message.dateRanges.length; ++j) + object.dateRanges[j] = $root.google.analytics.admin.v1beta.AccessDateRange.toObject(message.dateRanges[j], options); + } + if (message.dimensionFilter != null && message.hasOwnProperty("dimensionFilter")) + object.dimensionFilter = $root.google.analytics.admin.v1beta.AccessFilterExpression.toObject(message.dimensionFilter, options); + if (message.metricFilter != null && message.hasOwnProperty("metricFilter")) + object.metricFilter = $root.google.analytics.admin.v1beta.AccessFilterExpression.toObject(message.metricFilter, options); + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset === "number") + object.offset = options.longs === String ? String(message.offset) : message.offset; + else + object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber() : message.offset; + if (message.limit != null && message.hasOwnProperty("limit")) + if (typeof message.limit === "number") + object.limit = options.longs === String ? String(message.limit) : message.limit; + else + object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber() : message.limit; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.orderBys && message.orderBys.length) { + object.orderBys = []; + for (var j = 0; j < message.orderBys.length; ++j) + object.orderBys[j] = $root.google.analytics.admin.v1beta.AccessOrderBy.toObject(message.orderBys[j], options); + } + if (message.returnEntityQuota != null && message.hasOwnProperty("returnEntityQuota")) + object.returnEntityQuota = message.returnEntityQuota; + return object; + }; + + /** + * Converts this RunAccessReportRequest to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @instance + * @returns {Object.} JSON object + */ + RunAccessReportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunAccessReportRequest + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.RunAccessReportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunAccessReportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.RunAccessReportRequest"; + }; + + return RunAccessReportRequest; + })(); + + v1beta.RunAccessReportResponse = (function() { + + /** + * Properties of a RunAccessReportResponse. + * @memberof google.analytics.admin.v1beta + * @interface IRunAccessReportResponse + * @property {Array.|null} [dimensionHeaders] RunAccessReportResponse dimensionHeaders + * @property {Array.|null} [metricHeaders] RunAccessReportResponse metricHeaders + * @property {Array.|null} [rows] RunAccessReportResponse rows + * @property {number|null} [rowCount] RunAccessReportResponse rowCount + * @property {google.analytics.admin.v1beta.IAccessQuota|null} [quota] RunAccessReportResponse quota + */ + + /** + * Constructs a new RunAccessReportResponse. + * @memberof google.analytics.admin.v1beta + * @classdesc Represents a RunAccessReportResponse. + * @implements IRunAccessReportResponse + * @constructor + * @param {google.analytics.admin.v1beta.IRunAccessReportResponse=} [properties] Properties to set + */ + function RunAccessReportResponse(properties) { + this.dimensionHeaders = []; + this.metricHeaders = []; + this.rows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunAccessReportResponse dimensionHeaders. + * @member {Array.} dimensionHeaders + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @instance + */ + RunAccessReportResponse.prototype.dimensionHeaders = $util.emptyArray; + + /** + * RunAccessReportResponse metricHeaders. + * @member {Array.} metricHeaders + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @instance + */ + RunAccessReportResponse.prototype.metricHeaders = $util.emptyArray; + + /** + * RunAccessReportResponse rows. + * @member {Array.} rows + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @instance + */ + RunAccessReportResponse.prototype.rows = $util.emptyArray; + + /** + * RunAccessReportResponse rowCount. + * @member {number} rowCount + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @instance + */ + RunAccessReportResponse.prototype.rowCount = 0; + + /** + * RunAccessReportResponse quota. + * @member {google.analytics.admin.v1beta.IAccessQuota|null|undefined} quota + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @instance + */ + RunAccessReportResponse.prototype.quota = null; + + /** + * Creates a new RunAccessReportResponse instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @static + * @param {google.analytics.admin.v1beta.IRunAccessReportResponse=} [properties] Properties to set + * @returns {google.analytics.admin.v1beta.RunAccessReportResponse} RunAccessReportResponse instance + */ + RunAccessReportResponse.create = function create(properties) { + return new RunAccessReportResponse(properties); + }; + + /** + * Encodes the specified RunAccessReportResponse message. Does not implicitly {@link google.analytics.admin.v1beta.RunAccessReportResponse.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @static + * @param {google.analytics.admin.v1beta.IRunAccessReportResponse} message RunAccessReportResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAccessReportResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dimensionHeaders != null && message.dimensionHeaders.length) + for (var i = 0; i < message.dimensionHeaders.length; ++i) + $root.google.analytics.admin.v1beta.AccessDimensionHeader.encode(message.dimensionHeaders[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metricHeaders != null && message.metricHeaders.length) + for (var i = 0; i < message.metricHeaders.length; ++i) + $root.google.analytics.admin.v1beta.AccessMetricHeader.encode(message.metricHeaders[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.analytics.admin.v1beta.AccessRow.encode(message.rows[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.rowCount); + if (message.quota != null && Object.hasOwnProperty.call(message, "quota")) + $root.google.analytics.admin.v1beta.AccessQuota.encode(message.quota, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunAccessReportResponse message, length delimited. Does not implicitly {@link google.analytics.admin.v1beta.RunAccessReportResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @static + * @param {google.analytics.admin.v1beta.IRunAccessReportResponse} message RunAccessReportResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAccessReportResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAccessReportResponse message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1beta.RunAccessReportResponse} RunAccessReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAccessReportResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1beta.RunAccessReportResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dimensionHeaders && message.dimensionHeaders.length)) + message.dimensionHeaders = []; + message.dimensionHeaders.push($root.google.analytics.admin.v1beta.AccessDimensionHeader.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.metricHeaders && message.metricHeaders.length)) + message.metricHeaders = []; + message.metricHeaders.push($root.google.analytics.admin.v1beta.AccessMetricHeader.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.analytics.admin.v1beta.AccessRow.decode(reader, reader.uint32())); + break; + } + case 4: { + message.rowCount = reader.int32(); + break; + } + case 5: { + message.quota = $root.google.analytics.admin.v1beta.AccessQuota.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAccessReportResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1beta.RunAccessReportResponse} RunAccessReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAccessReportResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAccessReportResponse message. + * @function verify + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAccessReportResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dimensionHeaders != null && message.hasOwnProperty("dimensionHeaders")) { + if (!Array.isArray(message.dimensionHeaders)) + return "dimensionHeaders: array expected"; + for (var i = 0; i < message.dimensionHeaders.length; ++i) { + var error = $root.google.analytics.admin.v1beta.AccessDimensionHeader.verify(message.dimensionHeaders[i]); + if (error) + return "dimensionHeaders." + error; + } + } + if (message.metricHeaders != null && message.hasOwnProperty("metricHeaders")) { + if (!Array.isArray(message.metricHeaders)) + return "metricHeaders: array expected"; + for (var i = 0; i < message.metricHeaders.length; ++i) { + var error = $root.google.analytics.admin.v1beta.AccessMetricHeader.verify(message.metricHeaders[i]); + if (error) + return "metricHeaders." + error; + } + } + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.analytics.admin.v1beta.AccessRow.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount)) + return "rowCount: integer expected"; + if (message.quota != null && message.hasOwnProperty("quota")) { + var error = $root.google.analytics.admin.v1beta.AccessQuota.verify(message.quota); + if (error) + return "quota." + error; + } + return null; + }; + + /** + * Creates a RunAccessReportResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1beta.RunAccessReportResponse} RunAccessReportResponse + */ + RunAccessReportResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1beta.RunAccessReportResponse) + return object; + var message = new $root.google.analytics.admin.v1beta.RunAccessReportResponse(); + if (object.dimensionHeaders) { + if (!Array.isArray(object.dimensionHeaders)) + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportResponse.dimensionHeaders: array expected"); + message.dimensionHeaders = []; + for (var i = 0; i < object.dimensionHeaders.length; ++i) { + if (typeof object.dimensionHeaders[i] !== "object") + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportResponse.dimensionHeaders: object expected"); + message.dimensionHeaders[i] = $root.google.analytics.admin.v1beta.AccessDimensionHeader.fromObject(object.dimensionHeaders[i]); + } + } + if (object.metricHeaders) { + if (!Array.isArray(object.metricHeaders)) + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportResponse.metricHeaders: array expected"); + message.metricHeaders = []; + for (var i = 0; i < object.metricHeaders.length; ++i) { + if (typeof object.metricHeaders[i] !== "object") + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportResponse.metricHeaders: object expected"); + message.metricHeaders[i] = $root.google.analytics.admin.v1beta.AccessMetricHeader.fromObject(object.metricHeaders[i]); + } + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportResponse.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportResponse.rows: object expected"); + message.rows[i] = $root.google.analytics.admin.v1beta.AccessRow.fromObject(object.rows[i]); + } + } + if (object.rowCount != null) + message.rowCount = object.rowCount | 0; + if (object.quota != null) { + if (typeof object.quota !== "object") + throw TypeError(".google.analytics.admin.v1beta.RunAccessReportResponse.quota: object expected"); + message.quota = $root.google.analytics.admin.v1beta.AccessQuota.fromObject(object.quota); + } + return message; + }; + + /** + * Creates a plain object from a RunAccessReportResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @static + * @param {google.analytics.admin.v1beta.RunAccessReportResponse} message RunAccessReportResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAccessReportResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dimensionHeaders = []; + object.metricHeaders = []; + object.rows = []; + } + if (options.defaults) { + object.rowCount = 0; + object.quota = null; + } + if (message.dimensionHeaders && message.dimensionHeaders.length) { + object.dimensionHeaders = []; + for (var j = 0; j < message.dimensionHeaders.length; ++j) + object.dimensionHeaders[j] = $root.google.analytics.admin.v1beta.AccessDimensionHeader.toObject(message.dimensionHeaders[j], options); + } + if (message.metricHeaders && message.metricHeaders.length) { + object.metricHeaders = []; + for (var j = 0; j < message.metricHeaders.length; ++j) + object.metricHeaders[j] = $root.google.analytics.admin.v1beta.AccessMetricHeader.toObject(message.metricHeaders[j], options); + } + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.analytics.admin.v1beta.AccessRow.toObject(message.rows[j], options); + } + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + object.rowCount = message.rowCount; + if (message.quota != null && message.hasOwnProperty("quota")) + object.quota = $root.google.analytics.admin.v1beta.AccessQuota.toObject(message.quota, options); + return object; + }; + + /** + * Converts this RunAccessReportResponse to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @instance + * @returns {Object.} JSON object + */ + RunAccessReportResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunAccessReportResponse + * @function getTypeUrl + * @memberof google.analytics.admin.v1beta.RunAccessReportResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunAccessReportResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1beta.RunAccessReportResponse"; + }; + + return RunAccessReportResponse; })(); v1beta.GetAccountRequest = (function() { diff --git a/packages/google-analytics-admin/protos/protos.json b/packages/google-analytics-admin/protos/protos.json index 158fedb467f..5b0cc7256f7 100644 --- a/packages/google-analytics-admin/protos/protos.json +++ b/packages/google-analytics-admin/protos/protos.json @@ -6681,6 +6681,343 @@ "java_package": "com.google.analytics.admin.v1beta" }, "nested": { + "AccessDimension": { + "fields": { + "dimensionName": { + "type": "string", + "id": 1 + } + } + }, + "AccessMetric": { + "fields": { + "metricName": { + "type": "string", + "id": 1 + } + } + }, + "AccessDateRange": { + "fields": { + "startDate": { + "type": "string", + "id": 1 + }, + "endDate": { + "type": "string", + "id": 2 + } + } + }, + "AccessFilterExpression": { + "oneofs": { + "oneExpression": { + "oneof": [ + "andGroup", + "orGroup", + "notExpression", + "accessFilter" + ] + } + }, + "fields": { + "andGroup": { + "type": "AccessFilterExpressionList", + "id": 1 + }, + "orGroup": { + "type": "AccessFilterExpressionList", + "id": 2 + }, + "notExpression": { + "type": "AccessFilterExpression", + "id": 3 + }, + "accessFilter": { + "type": "AccessFilter", + "id": 4 + } + } + }, + "AccessFilterExpressionList": { + "fields": { + "expressions": { + "rule": "repeated", + "type": "AccessFilterExpression", + "id": 1 + } + } + }, + "AccessFilter": { + "oneofs": { + "oneFilter": { + "oneof": [ + "stringFilter", + "inListFilter", + "numericFilter", + "betweenFilter" + ] + } + }, + "fields": { + "stringFilter": { + "type": "AccessStringFilter", + "id": 2 + }, + "inListFilter": { + "type": "AccessInListFilter", + "id": 3 + }, + "numericFilter": { + "type": "AccessNumericFilter", + "id": 4 + }, + "betweenFilter": { + "type": "AccessBetweenFilter", + "id": 5 + }, + "fieldName": { + "type": "string", + "id": 1 + } + } + }, + "AccessStringFilter": { + "fields": { + "matchType": { + "type": "MatchType", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + }, + "caseSensitive": { + "type": "bool", + "id": 3 + } + }, + "nested": { + "MatchType": { + "values": { + "MATCH_TYPE_UNSPECIFIED": 0, + "EXACT": 1, + "BEGINS_WITH": 2, + "ENDS_WITH": 3, + "CONTAINS": 4, + "FULL_REGEXP": 5, + "PARTIAL_REGEXP": 6 + } + } + } + }, + "AccessInListFilter": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "caseSensitive": { + "type": "bool", + "id": 2 + } + } + }, + "AccessNumericFilter": { + "fields": { + "operation": { + "type": "Operation", + "id": 1 + }, + "value": { + "type": "NumericValue", + "id": 2 + } + }, + "nested": { + "Operation": { + "values": { + "OPERATION_UNSPECIFIED": 0, + "EQUAL": 1, + "LESS_THAN": 2, + "LESS_THAN_OR_EQUAL": 3, + "GREATER_THAN": 4, + "GREATER_THAN_OR_EQUAL": 5 + } + } + } + }, + "AccessBetweenFilter": { + "fields": { + "fromValue": { + "type": "NumericValue", + "id": 1 + }, + "toValue": { + "type": "NumericValue", + "id": 2 + } + } + }, + "NumericValue": { + "oneofs": { + "oneValue": { + "oneof": [ + "int64Value", + "doubleValue" + ] + } + }, + "fields": { + "int64Value": { + "type": "int64", + "id": 1 + }, + "doubleValue": { + "type": "double", + "id": 2 + } + } + }, + "AccessOrderBy": { + "oneofs": { + "oneOrderBy": { + "oneof": [ + "metric", + "dimension" + ] + } + }, + "fields": { + "metric": { + "type": "MetricOrderBy", + "id": 1 + }, + "dimension": { + "type": "DimensionOrderBy", + "id": 2 + }, + "desc": { + "type": "bool", + "id": 3 + } + }, + "nested": { + "MetricOrderBy": { + "fields": { + "metricName": { + "type": "string", + "id": 1 + } + } + }, + "DimensionOrderBy": { + "fields": { + "dimensionName": { + "type": "string", + "id": 1 + }, + "orderType": { + "type": "OrderType", + "id": 2 + } + }, + "nested": { + "OrderType": { + "values": { + "ORDER_TYPE_UNSPECIFIED": 0, + "ALPHANUMERIC": 1, + "CASE_INSENSITIVE_ALPHANUMERIC": 2, + "NUMERIC": 3 + } + } + } + } + } + }, + "AccessDimensionHeader": { + "fields": { + "dimensionName": { + "type": "string", + "id": 1 + } + } + }, + "AccessMetricHeader": { + "fields": { + "metricName": { + "type": "string", + "id": 1 + } + } + }, + "AccessRow": { + "fields": { + "dimensionValues": { + "rule": "repeated", + "type": "AccessDimensionValue", + "id": 1 + }, + "metricValues": { + "rule": "repeated", + "type": "AccessMetricValue", + "id": 2 + } + } + }, + "AccessDimensionValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "AccessMetricValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "AccessQuota": { + "fields": { + "tokensPerDay": { + "type": "AccessQuotaStatus", + "id": 1 + }, + "tokensPerHour": { + "type": "AccessQuotaStatus", + "id": 2 + }, + "concurrentRequests": { + "type": "AccessQuotaStatus", + "id": 3 + }, + "serverErrorsPerProjectPerHour": { + "type": "AccessQuotaStatus", + "id": 4 + }, + "tokensPerProjectPerHour": { + "type": "AccessQuotaStatus", + "id": 5 + } + } + }, + "AccessQuotaStatus": { + "fields": { + "consumed": { + "type": "int32", + "id": 1 + }, + "remaining": { + "type": "int32", + "id": 2 + } + } + }, "AnalyticsAdminService": { "options": { "(google.api.default_host)": "analyticsadmin.googleapis.com", @@ -7550,6 +7887,107 @@ "(google.api.method_signature)": "name" } ] + }, + "RunAccessReport": { + "requestType": "RunAccessReportRequest", + "responseType": "RunAccessReportResponse", + "options": { + "(google.api.http).post": "/v1beta/{entity=properties/*}:runAccessReport", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta/{entity=accounts/*}:runAccessReport", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{entity=properties/*}:runAccessReport", + "body": "*", + "additional_bindings": { + "post": "/v1beta/{entity=accounts/*}:runAccessReport", + "body": "*" + } + } + } + ] + } + } + }, + "RunAccessReportRequest": { + "fields": { + "entity": { + "type": "string", + "id": 1 + }, + "dimensions": { + "rule": "repeated", + "type": "AccessDimension", + "id": 2 + }, + "metrics": { + "rule": "repeated", + "type": "AccessMetric", + "id": 3 + }, + "dateRanges": { + "rule": "repeated", + "type": "AccessDateRange", + "id": 4 + }, + "dimensionFilter": { + "type": "AccessFilterExpression", + "id": 5 + }, + "metricFilter": { + "type": "AccessFilterExpression", + "id": 6 + }, + "offset": { + "type": "int64", + "id": 7 + }, + "limit": { + "type": "int64", + "id": 8 + }, + "timeZone": { + "type": "string", + "id": 9 + }, + "orderBys": { + "rule": "repeated", + "type": "AccessOrderBy", + "id": 10 + }, + "returnEntityQuota": { + "type": "bool", + "id": 11 + } + } + }, + "RunAccessReportResponse": { + "fields": { + "dimensionHeaders": { + "rule": "repeated", + "type": "AccessDimensionHeader", + "id": 1 + }, + "metricHeaders": { + "rule": "repeated", + "type": "AccessMetricHeader", + "id": 2 + }, + "rows": { + "rule": "repeated", + "type": "AccessRow", + "id": 3 + }, + "rowCount": { + "type": "int32", + "id": 4 + }, + "quota": { + "type": "AccessQuota", + "id": 5 } } }, diff --git a/packages/google-analytics-admin/samples/README.md b/packages/google-analytics-admin/samples/README.md index f3d23925c09..5193b2426c9 100644 --- a/packages/google-analytics-admin/samples/README.md +++ b/packages/google-analytics-admin/samples/README.md @@ -170,6 +170,7 @@ * [Analytics_admin_service.list_measurement_protocol_secrets](#analytics_admin_service.list_measurement_protocol_secrets) * [Analytics_admin_service.list_properties](#analytics_admin_service.list_properties) * [Analytics_admin_service.provision_account_ticket](#analytics_admin_service.provision_account_ticket) + * [Analytics_admin_service.run_access_report](#analytics_admin_service.run_access_report) * [Analytics_admin_service.search_change_history_events](#analytics_admin_service.search_change_history_events) * [Analytics_admin_service.update_account](#analytics_admin_service.update_account) * [Analytics_admin_service.update_custom_dimension](#analytics_admin_service.update_custom_dimension) @@ -2883,6 +2884,23 @@ __Usage:__ +### Analytics_admin_service.run_access_report + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.run_access_report.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.run_access_report.js,samples/README.md) + +__Usage:__ + + +`node packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.run_access_report.js` + + +----- + + + + ### Analytics_admin_service.search_change_history_events View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js). diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js index 381944e9bec..6b152cbaca5 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js @@ -33,8 +33,8 @@ function main(property, acknowledgement) { */ // const property = 'abc123' /** - * Required. An acknowledgement that the caller of this method understands the terms - * of user data collection. + * 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, diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js index 4040885a046..b63a44b7a36 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js @@ -33,8 +33,8 @@ function main(conversionEvent, parent) { */ // const conversionEvent = {} /** - * Required. The resource name of the parent property where this conversion event will - * be created. Format: properties/123 + * Required. The resource name of the parent property where this conversion + * event will be created. Format: properties/123 */ // const parent = 'abc123' diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js index 61981ffc75e..a444c5aa701 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js @@ -43,7 +43,7 @@ function main(parent) { /** * 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 + * When paginating, all other parameters provided to `ListFirebaseLinks` must * match the call that provided the page token. */ // const pageToken = 'abc123' diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js index d13c67138d3..55d6b28696b 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js @@ -34,7 +34,7 @@ function main() { // 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 + * Must be configured in Cloud Console as a Redirect URI. */ // const redirectUri = 'abc123' diff --git a/owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.run_access_report.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.run_access_report.js similarity index 100% rename from owl-bot-staging/google-analytics-admin/v1beta/samples/generated/v1beta/analytics_admin_service.run_access_report.js rename to packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.run_access_report.js diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js index 3c66ba712af..62edc7851f5 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js @@ -29,7 +29,8 @@ function main(account) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The account resource for which to return change history resources. + * Required. The account resource for which to return change history + * resources. */ // const account = 'abc123' /** @@ -38,17 +39,18 @@ function main(account) { */ // const property = 'abc123' /** - * Optional. If set, only return changes if they are for a resource that matches at - * least one of these types. + * 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. + * 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. + * Optional. If set, only return changes if they are made by a user in this + * list. */ // const actorEmail = 'abc123' /** @@ -67,10 +69,11 @@ function main(account) { */ // 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. + * 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' diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_account.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_account.js index a390005393a..42a1adc651e 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_account.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_account.js @@ -34,9 +34,10 @@ function main(account, updateMask) { */ // 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. + * Required. The list of fields to be updated. Field names must be in snake + * case (for example, "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 = {} diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js index 481a0e6f266..bc8726494e8 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js @@ -33,9 +33,9 @@ function main(updateMask) { */ // 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. + * 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 = {} diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js index 9d62187a8d4..f0de40297ff 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js @@ -33,9 +33,9 @@ function main(updateMask) { */ // 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. + * 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 = {} diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js index f0a119d5a57..4dc7e9f52d6 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js @@ -34,9 +34,10 @@ function main(dataRetentionSettings, updateMask) { */ // 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. + * 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 = {} diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_stream.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_stream.js index bba376ce952..f151f9e38dc 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_stream.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_stream.js @@ -33,9 +33,9 @@ function main(updateMask) { */ // 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. + * 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 = {} diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js index 8bdd6ea6a51..a3177166541 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js @@ -33,9 +33,10 @@ function main(updateMask) { */ // 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. + * 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 = {} diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_property.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_property.js index bb9329e6a5e..c856ef50871 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_property.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_property.js @@ -35,9 +35,10 @@ function main(property, updateMask) { */ // 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. + * 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 = {} diff --git a/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json b/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json index 330acb5f214..fa196359729 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json +++ b/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json @@ -150,7 +150,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 62, "type": "FULL" } ], @@ -407,7 +407,7 @@ "regionTag": "analyticsadmin_v1beta_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.", + "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 a GA4 Property.", "canonical": true, "file": "analytics_admin_service.delete_property.js", "language": "JAVASCRIPT", @@ -454,7 +454,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 63, "type": "FULL" } ], @@ -674,7 +674,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 60, "type": "FULL" } ], @@ -1055,7 +1055,7 @@ "regionTag": "analyticsadmin_v1beta_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.", + "description": " Acknowledges the terms of user data collection for the specified property. This acknowledgement must be completed (either in the Google Analytics UI or through this API) before MeasurementProtocolSecret resources may be created.", "canonical": true, "file": "analytics_admin_service.acknowledge_user_data_collection.js", "language": "JAVASCRIPT", @@ -1106,7 +1106,7 @@ "segments": [ { "start": 25, - "end": 96, + "end": 99, "type": "FULL" } ], @@ -1822,7 +1822,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 62, "type": "FULL" } ], @@ -2070,6 +2070,86 @@ } } } + }, + { + "regionTag": "analyticsadmin_v1beta_generated_AnalyticsAdminService_RunAccessReport_async", + "title": "AnalyticsAdminService runAccessReport Sample", + "origin": "API_DEFINITION", + "description": " Returns a customized report of data access records. The report provides records of each time a user reads Google Analytics reporting data. Access records are retained for up to 2 years. Data Access Reports can be requested for a property. The property must be in Google Analytics 360. This method is only available to Administrators. These data access records include GA4 UI Reporting, GA4 UI Explorations, GA4 Data API, and other products like Firebase & Admob that can retrieve data from Google Analytics through a linkage. These records don't include property configuration changes like adding a stream or changing a property's time zone. For configuration change history, see [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).", + "canonical": true, + "file": "analytics_admin_service.run_access_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 131, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunAccessReport", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.RunAccessReport", + "async": true, + "parameters": [ + { + "name": "entity", + "type": "TYPE_STRING" + }, + { + "name": "dimensions", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "metrics", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "date_ranges", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "dimension_filter", + "type": ".google.analytics.admin.v1beta.AccessFilterExpression" + }, + { + "name": "metric_filter", + "type": ".google.analytics.admin.v1beta.AccessFilterExpression" + }, + { + "name": "offset", + "type": "TYPE_INT64" + }, + { + "name": "limit", + "type": "TYPE_INT64" + }, + { + "name": "time_zone", + "type": "TYPE_STRING" + }, + { + "name": "order_bys", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "return_entity_quota", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.analytics.admin.v1beta.RunAccessReportResponse", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "RunAccessReport", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService.RunAccessReport", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1beta.AnalyticsAdminService" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-analytics-admin/src/v1beta/analytics_admin_service_client.ts b/packages/google-analytics-admin/src/v1beta/analytics_admin_service_client.ts index e48000db1cd..6b94c1a0f26 100644 --- a/packages/google-analytics-admin/src/v1beta/analytics_admin_service_client.ts +++ b/packages/google-analytics-admin/src/v1beta/analytics_admin_service_client.ts @@ -376,6 +376,7 @@ export class AnalyticsAdminServiceClient { 'updateDataStream', 'listDataStreams', 'getDataStream', + 'runAccessReport', ]; for (const methodName of analyticsAdminServiceStubMethods) { const callPromise = this.analyticsAdminServiceStub.then( @@ -667,9 +668,10 @@ export class AnalyticsAdminServiceClient { * 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. + * Required. The list of fields to be updated. Field names must be in snake + * case (for example, "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. @@ -763,7 +765,7 @@ export class AnalyticsAdminServiceClient { * 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 + * Must be configured in Cloud 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. @@ -1046,7 +1048,7 @@ export class AnalyticsAdminServiceClient { * 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. + * Returns an error if the target is not found, or is not a GA4 Property. * * @param {Object} request * The request object that will be sent. @@ -1148,9 +1150,10 @@ export class AnalyticsAdminServiceClient { * 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. + * 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. @@ -1542,9 +1545,10 @@ export class AnalyticsAdminServiceClient { * @param {google.analytics.admin.v1beta.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. + * 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. @@ -2254,15 +2258,16 @@ export class AnalyticsAdminServiceClient { * 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. + * or through 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. + * 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 @@ -2371,8 +2376,8 @@ export class AnalyticsAdminServiceClient { * @param {google.analytics.admin.v1beta.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 + * 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. @@ -2768,9 +2773,9 @@ export class AnalyticsAdminServiceClient { * @param {google.analytics.admin.v1beta.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. + * 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. @@ -3168,9 +3173,9 @@ export class AnalyticsAdminServiceClient { * @param {google.analytics.admin.v1beta.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. + * 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. @@ -3564,9 +3569,10 @@ export class AnalyticsAdminServiceClient { * 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. + * 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. @@ -3855,9 +3861,9 @@ export class AnalyticsAdminServiceClient { * @param {google.analytics.admin.v1beta.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. + * 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. @@ -4034,6 +4040,173 @@ export class AnalyticsAdminServiceClient { this.initialize(); return this.innerApiCalls.getDataStream(request, options, callback); } + /** + * Returns a customized report of data access records. The report provides + * records of each time a user reads Google Analytics reporting data. Access + * records are retained for up to 2 years. + * + * Data Access Reports can be requested for a property. The property must be + * in Google Analytics 360. This method is only available to Administrators. + * + * These data access records include GA4 UI Reporting, GA4 UI Explorations, + * GA4 Data API, and other products like Firebase & Admob that can retrieve + * data from Google Analytics through a linkage. These records don't include + * property configuration changes like adding a stream or changing a + * property's time zone. For configuration change history, see + * [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.entity + * The Data Access Report supports requesting at the property level or account + * level. If requested at the account level, Data Access Reports include all + * access for all properties under that account. + * + * To request at the property level, entity should be for example + * 'properties/123' if "123" is your GA4 property ID. To request at the + * account level, entity should be for example 'accounts/1234' if "1234" is + * your GA4 Account ID. + * @param {number[]} request.dimensions + * The dimensions requested and displayed in the response. Requests are + * allowed up to 9 dimensions. + * @param {number[]} request.metrics + * The metrics requested and displayed in the response. Requests are allowed + * up to 10 metrics. + * @param {number[]} request.dateRanges + * Date ranges of access records to read. If multiple date ranges are + * requested, each response row will contain a zero based date range index. If + * two date ranges overlap, the access records for the overlapping days is + * included in the response rows for both date ranges. Requests are allowed up + * to 2 date ranges. + * @param {google.analytics.admin.v1beta.AccessFilterExpression} request.dimensionFilter + * Dimension filters let you restrict report response to specific + * dimension values which match the filter. For example, filtering on access + * records of a single user. To learn more, see [Fundamentals of Dimension + * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + * @param {google.analytics.admin.v1beta.AccessFilterExpression} request.metricFilter + * Metric filters allow you to restrict report response to specific metric + * values which match the filter. Metric filters are applied after aggregating + * the report's rows, similar to SQL having-clause. Dimensions cannot be used + * in this filter. + * @param {number} request.offset + * The row count of the start row. The first row is counted as row 0. If + * offset is unspecified, it is treated as 0. If offset is zero, then this + * method will return the first page of results with `limit` entries. + * + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * @param {number} request.limit + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * + * The API may return fewer rows than the requested `limit`, if there aren't + * as many remaining rows as the `limit`. For instance, there are fewer than + * 300 possible values for the dimension `country`, so when reporting on only + * `country`, you can't get more than 300 rows, even if you set `limit` to a + * higher value. + * + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * @param {string} request.timeZone + * This request's time zone if specified. If unspecified, the property's time + * zone is used. The request's time zone is used to interpret the start & end + * dates of the report. + * + * Formatted as strings from the IANA Time Zone database + * (https://www.iana.org/time-zones); for example "America/New_York" or + * "Asia/Tokyo". + * @param {number[]} request.orderBys + * Specifies how rows are ordered in the response. + * @param {boolean} request.returnEntityQuota + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in [AccessQuota](#AccessQuota). For account-level + * requests, this field must be false. + * @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 {@link google.analytics.admin.v1beta.RunAccessReportResponse | RunAccessReportResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/analytics_admin_service.run_access_report.js + * region_tag:analyticsadmin_v1beta_generated_AnalyticsAdminService_RunAccessReport_async + */ + runAccessReport( + request?: protos.google.analytics.admin.v1beta.IRunAccessReportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.analytics.admin.v1beta.IRunAccessReportResponse, + protos.google.analytics.admin.v1beta.IRunAccessReportRequest | undefined, + {} | undefined + ] + >; + runAccessReport( + request: protos.google.analytics.admin.v1beta.IRunAccessReportRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1beta.IRunAccessReportResponse, + | protos.google.analytics.admin.v1beta.IRunAccessReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + runAccessReport( + request: protos.google.analytics.admin.v1beta.IRunAccessReportRequest, + callback: Callback< + protos.google.analytics.admin.v1beta.IRunAccessReportResponse, + | protos.google.analytics.admin.v1beta.IRunAccessReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + runAccessReport( + request?: protos.google.analytics.admin.v1beta.IRunAccessReportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.analytics.admin.v1beta.IRunAccessReportResponse, + | protos.google.analytics.admin.v1beta.IRunAccessReportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.analytics.admin.v1beta.IRunAccessReportResponse, + | protos.google.analytics.admin.v1beta.IRunAccessReportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.analytics.admin.v1beta.IRunAccessReportResponse, + protos.google.analytics.admin.v1beta.IRunAccessReportRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + entity: request.entity ?? '', + }); + this.initialize(); + return this.innerApiCalls.runAccessReport(request, options, callback); + } /** * Returns all accounts accessible by the caller. @@ -4703,7 +4876,7 @@ export class AnalyticsAdminServiceClient { * @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 + * When paginating, all other parameters provided to `ListFirebaseLinks` 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. @@ -4808,7 +4981,7 @@ export class AnalyticsAdminServiceClient { * @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 + * When paginating, all other parameters provided to `ListFirebaseLinks` 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. @@ -4861,7 +5034,7 @@ export class AnalyticsAdminServiceClient { * @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 + * When paginating, all other parameters provided to `ListFirebaseLinks` 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. @@ -5328,18 +5501,20 @@ export class AnalyticsAdminServiceClient { * @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. + * 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. + * 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. + * 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. + * 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] @@ -5350,10 +5525,11 @@ export class AnalyticsAdminServiceClient { * 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. + * 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. @@ -5451,18 +5627,20 @@ export class AnalyticsAdminServiceClient { * @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. + * 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. + * 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. + * 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. + * 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] @@ -5473,10 +5651,11 @@ export class AnalyticsAdminServiceClient { * 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. + * 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} @@ -5518,18 +5697,20 @@ export class AnalyticsAdminServiceClient { * @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. + * 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. + * 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. + * 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. + * 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] @@ -5540,10 +5721,11 @@ export class AnalyticsAdminServiceClient { * 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. + * 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} diff --git a/packages/google-analytics-admin/src/v1beta/analytics_admin_service_client_config.json b/packages/google-analytics-admin/src/v1beta/analytics_admin_service_client_config.json index e1e3f9017e4..aabd0a6eb1e 100644 --- a/packages/google-analytics-admin/src/v1beta/analytics_admin_service_client_config.json +++ b/packages/google-analytics-admin/src/v1beta/analytics_admin_service_client_config.json @@ -35,28 +35,28 @@ "methods": { "GetAccount": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "ListAccounts": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "DeleteAccount": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "UpdateAccount": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "ProvisionAccountTicket": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "ListAccountSummaries": { "timeout_millis": 60000, @@ -65,63 +65,63 @@ }, "GetProperty": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "ListProperties": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "CreateProperty": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "DeleteProperty": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "UpdateProperty": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "CreateFirebaseLink": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "DeleteFirebaseLink": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "ListFirebaseLinks": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "CreateGoogleAdsLink": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "UpdateGoogleAdsLink": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "DeleteGoogleAdsLink": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "ListGoogleAdsLinks": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, "GetDataSharingSettings": { "timeout_millis": 60000, @@ -267,6 +267,11 @@ "timeout_millis": 60000, "retry_codes_name": "unknown_unavailable", "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "RunAccessReport": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" } } } diff --git a/packages/google-analytics-admin/src/v1beta/analytics_admin_service_proto_list.json b/packages/google-analytics-admin/src/v1beta/analytics_admin_service_proto_list.json index fb30c5ecfee..95cd6a5fee5 100644 --- a/packages/google-analytics-admin/src/v1beta/analytics_admin_service_proto_list.json +++ b/packages/google-analytics-admin/src/v1beta/analytics_admin_service_proto_list.json @@ -1,4 +1,5 @@ [ + "../../protos/google/analytics/admin/v1beta/access_report.proto", "../../protos/google/analytics/admin/v1beta/analytics_admin.proto", "../../protos/google/analytics/admin/v1beta/resources.proto" ] diff --git a/packages/google-analytics-admin/src/v1beta/gapic_metadata.json b/packages/google-analytics-admin/src/v1beta/gapic_metadata.json index 6293235f50d..5c694601ea0 100644 --- a/packages/google-analytics-admin/src/v1beta/gapic_metadata.json +++ b/packages/google-analytics-admin/src/v1beta/gapic_metadata.json @@ -190,6 +190,11 @@ "getDataStream" ] }, + "RunAccessReport": { + "methods": [ + "runAccessReport" + ] + }, "ListAccounts": { "methods": [ "listAccounts", @@ -452,6 +457,11 @@ "getDataStream" ] }, + "RunAccessReport": { + "methods": [ + "runAccessReport" + ] + }, "ListAccounts": { "methods": [ "listAccounts", diff --git a/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1beta.ts b/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1beta.ts index e1fe39cfe7b..9e4483c249a 100644 --- a/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1beta.ts +++ b/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1beta.ts @@ -5107,6 +5107,140 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { }); }); + describe('runAccessReport', () => { + it('invokes runAccessReport without error', async () => { + const client = + new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.RunAccessReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.admin.v1beta.RunAccessReportRequest', + ['entity'] + ); + request.entity = defaultValue1; + const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.RunAccessReportResponse() + ); + client.innerApiCalls.runAccessReport = stubSimpleCall(expectedResponse); + const [response] = await client.runAccessReport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runAccessReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAccessReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAccessReport without error using callback', async () => { + const client = + new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.RunAccessReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.admin.v1beta.RunAccessReportRequest', + ['entity'] + ); + request.entity = defaultValue1; + const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1beta.RunAccessReportResponse() + ); + client.innerApiCalls.runAccessReport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runAccessReport( + request, + ( + err?: Error | null, + result?: protos.google.analytics.admin.v1beta.IRunAccessReportResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runAccessReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAccessReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAccessReport with error', async () => { + const client = + new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.RunAccessReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.admin.v1beta.RunAccessReportRequest', + ['entity'] + ); + request.entity = defaultValue1; + const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runAccessReport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.runAccessReport(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runAccessReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAccessReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAccessReport with closed client', async () => { + const client = + new analyticsadminserviceModule.v1beta.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1beta.RunAccessReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.admin.v1beta.RunAccessReportRequest', + ['entity'] + ); + request.entity = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.runAccessReport(request), expectedError); + }); + }); + describe('listAccounts', () => { it('invokes listAccounts without error', async () => { const client =