diff --git a/packages/google-analytics-data/.eslintignore b/packages/google-analytics-data/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-analytics-data/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-analytics-data/.eslintrc.json b/packages/google-analytics-data/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-analytics-data/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-analytics-data/.gitattributes b/packages/google-analytics-data/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-analytics-data/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-analytics-data/.github/.OwlBot.yaml b/packages/google-analytics-data/.github/.OwlBot.yaml new file mode 100644 index 00000000000..30a8ac6a2ed --- /dev/null +++ b/packages/google-analytics-data/.github/.OwlBot.yaml @@ -0,0 +1,23 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/analytics/data/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + diff --git a/packages/google-analytics-data/.gitignore b/packages/google-analytics-data/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-analytics-data/.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/packages/google-analytics-data/.jsdoc.js b/packages/google-analytics-data/.jsdoc.js new file mode 100644 index 00000000000..a28a7a092e0 --- /dev/null +++ b/packages/google-analytics-data/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-analytics/data', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-analytics-data/.mocharc.js b/packages/google-analytics-data/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-analytics-data/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-analytics-data/.nycrc b/packages/google-analytics-data/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-analytics-data/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-analytics-data/.prettierignore b/packages/google-analytics-data/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-analytics-data/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-analytics-data/.prettierrc.js b/packages/google-analytics-data/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-analytics-data/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-analytics-data/.repo-metadata.json b/packages/google-analytics-data/.repo-metadata.json new file mode 100644 index 00000000000..c8c8c30e347 --- /dev/null +++ b/packages/google-analytics-data/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "client_documentation": "https://googleapis.dev/nodejs/analytics-data/latest/index.html", + "api_id": "analyticsdata.googleapis.com", + "distribution_name": "@google-analytics/data", + "release_level": "preview", + "default_version": "v1beta", + "language": "nodejs", + "name_pretty": "Google Analytics Data", + "repo": "googleapis/nodejs-analytics-data", + "codeowner_team": "@googleapis/ga-devrel", + "product_documentation": "https://developers.google.com/analytics/trusted-testing/analytics-data", + "requires_billing": false, + "name": "analytics-data", + "issue_tracker": "https://issuetracker.google.com/issues/new?component=326380x", + "api_shortname": "analyticsdata", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-analytics-data/CHANGELOG.md b/packages/google-analytics-data/CHANGELOG.md new file mode 100644 index 00000000000..d015d4acf58 --- /dev/null +++ b/packages/google-analytics-data/CHANGELOG.md @@ -0,0 +1,226 @@ +# Changelog + +## [3.1.1](https://github.com/googleapis/nodejs-analytics-data/compare/v3.1.0...v3.1.1) (2022-11-10) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#270](https://github.com/googleapis/nodejs-analytics-data/issues/270)) ([58e6661](https://github.com/googleapis/nodejs-analytics-data/commit/58e6661e58f109d2db30eefbd6e6902fc3b1022b)) +* Regenerated protos JS and TS definitions ([#274](https://github.com/googleapis/nodejs-analytics-data/issues/274)) ([690d304](https://github.com/googleapis/nodejs-analytics-data/commit/690d3048bb0e5fc238a018fac95f55f989d7fa03)) + +## [3.1.0](https://github.com/googleapis/nodejs-analytics-data/compare/v3.0.3...v3.1.0) (2022-10-13) + + +### Features + +* Add `subject_to_thresholding` field to `ResponseMetadata` type ([#265](https://github.com/googleapis/nodejs-analytics-data/issues/265)) ([410f0e0](https://github.com/googleapis/nodejs-analytics-data/commit/410f0e099fa5aa305e5120031b848dda99499e45)) + +## [3.0.3](https://github.com/googleapis/nodejs-analytics-data/compare/v3.0.2...v3.0.3) (2022-09-22) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#237](https://github.com/googleapis/nodejs-analytics-data/issues/237)) ([ae646a5](https://github.com/googleapis/nodejs-analytics-data/commit/ae646a54bc64abff0cf92625117ffb258e303e8b)) + +## [3.0.2](https://github.com/googleapis/nodejs-analytics-data/compare/v3.0.1...v3.0.2) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#232](https://github.com/googleapis/nodejs-analytics-data/issues/232)) ([df75612](https://github.com/googleapis/nodejs-analytics-data/commit/df75612adeadf7c3db4fe755b8ba9a2473a2fbae)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-analytics-data/issues/1553)) ([#231](https://github.com/googleapis/nodejs-analytics-data/issues/231)) ([635cddf](https://github.com/googleapis/nodejs-analytics-data/commit/635cddfb95f3252ea92765c45b8844aaf1eb6494)) + +## [3.0.1](https://github.com/googleapis/nodejs-analytics-data/compare/v3.0.0...v3.0.1) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#226](https://github.com/googleapis/nodejs-analytics-data/issues/226)) ([e9f6e72](https://github.com/googleapis/nodejs-analytics-data/commit/e9f6e722506bcbcf6ec2119511c16d033121c6f2)) +* change import long to require ([#227](https://github.com/googleapis/nodejs-analytics-data/issues/227)) ([007dfad](https://github.com/googleapis/nodejs-analytics-data/commit/007dfadd590e9c957a978ce4e46b9e72eb78e090)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-analytics-data/issues/1546)) ([#229](https://github.com/googleapis/nodejs-analytics-data/issues/229)) ([d2e5aba](https://github.com/googleapis/nodejs-analytics-data/commit/d2e5aba8edb12337fd5c04916bd75fee1389c0d3)) + +## [3.0.0](https://github.com/googleapis/nodejs-analytics-data/compare/v2.8.0...v3.0.0) (2022-06-27) + + +### ⚠ BREAKING CHANGES + +* rename the `funnel_filter` field of the `FunnelFilterExpression` type to `funnel_field_filter` +* rename the type `FunnelFilter` to `FunnelFieldFilter` (#218) +* update library to use Node 12 (#213) + +### Features + +* add `runFunnelReport` method to the Alpha version of the Data API ([#208](https://github.com/googleapis/nodejs-analytics-data/issues/208)) ([2390a92](https://github.com/googleapis/nodejs-analytics-data/commit/2390a922100c4ad0415f914a88b13dd39c487477)) +* support regapic LRO ([#219](https://github.com/googleapis/nodejs-analytics-data/issues/219)) ([547ecd7](https://github.com/googleapis/nodejs-analytics-data/commit/547ecd76afd553051ba4f9d330b355422b7114c5)) + + +### Bug Fixes + +* rename the `funnel_filter` field of the `FunnelFilterExpression` type to `funnel_field_filter` ([9ff9521](https://github.com/googleapis/nodejs-analytics-data/commit/9ff9521b386c674809f528892cf1dd49db81edc3)) +* rename the type `FunnelFilter` to `FunnelFieldFilter` ([#218](https://github.com/googleapis/nodejs-analytics-data/issues/218)) ([9ff9521](https://github.com/googleapis/nodejs-analytics-data/commit/9ff9521b386c674809f528892cf1dd49db81edc3)) + + +### Build System + +* update library to use Node 12 ([#213](https://github.com/googleapis/nodejs-analytics-data/issues/213)) ([c227cda](https://github.com/googleapis/nodejs-analytics-data/commit/c227cdac99df8c671812bb7d1244bd83d23d01e8)) + +## [2.8.0](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.7.0...v2.8.0) (2021-11-08) + + +### Features + +* add the `schema_restriction_response` field to the `ResponseMetaData` type that contains the schema restrictions actively enforced in creating a report feat: add the `currency_code`, `time_zone` fields to the `ResponseMetaData` type feat: add the... ([#154](https://www.github.com/googleapis/nodejs-analytics-data/issues/154)) ([37f6077](https://www.github.com/googleapis/nodejs-analytics-data/commit/37f6077a2f86e0814495d3282866cacf6458a839)) + +## [2.7.0](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.6.0...v2.7.0) (2021-09-01) + + +### Features + +* add `CheckCompatibility` method to the API ([#141](https://www.github.com/googleapis/nodejs-analytics-data/issues/141)) ([62c787f](https://www.github.com/googleapis/nodejs-analytics-data/commit/62c787fe3cda77a924a1de119de0ac1893a9390c)) + +## [2.6.0](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.5.3...v2.6.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#138](https://www.github.com/googleapis/nodejs-analytics-data/issues/138)) ([c7df6d6](https://www.github.com/googleapis/nodejs-analytics-data/commit/c7df6d6468b5ecd433486b5f2b20883ea22a7ab1)) + +### [2.5.3](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.5.2...v2.5.3) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#136](https://www.github.com/googleapis/nodejs-analytics-data/issues/136)) ([ed23bc2](https://www.github.com/googleapis/nodejs-analytics-data/commit/ed23bc2d71db3bbcd60a1771f70fd10a10a3da1b)) + +### [2.5.2](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.5.1...v2.5.2) (2021-08-09) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#134](https://www.github.com/googleapis/nodejs-analytics-data/issues/134)) ([1a24d21](https://www.github.com/googleapis/nodejs-analytics-data/commit/1a24d2101ea3c15236f7f6ee2cc6fd8327950c43)) + +### [2.5.1](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.5.0...v2.5.1) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#126](https://www.github.com/googleapis/nodejs-analytics-data/issues/126)) ([7272509](https://www.github.com/googleapis/nodejs-analytics-data/commit/72725092f75b90366884f484b305643e6716086f)) + +## [2.5.0](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.4.3...v2.5.0) (2021-07-12) + + +### Features + +* add `minute_ranges` field to `RunRealtimeReportRequest` object which can be used to specify the time range (in minutes) for realtime report queries docs: document the increase from 8 to 9 of the number of allowed dimensions in a report query ([#123](https://www.github.com/googleapis/nodejs-analytics-data/issues/123)) ([975776b](https://www.github.com/googleapis/nodejs-analytics-data/commit/975776ba58c5bfe98f53e73fd0af3e00ebd8ab2b)) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#125](https://www.github.com/googleapis/nodejs-analytics-data/issues/125)) ([9db78d0](https://www.github.com/googleapis/nodejs-analytics-data/commit/9db78d0663438c2c887a219e807e24fa90431fe5)) + +### [2.4.3](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.4.2...v2.4.3) (2021-06-29) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#121](https://www.github.com/googleapis/nodejs-analytics-data/issues/121)) ([9cbad79](https://www.github.com/googleapis/nodejs-analytics-data/commit/9cbad79ce05892ec18841613557c75fab75aaa36)) +* make request optional in all cases ([#117](https://www.github.com/googleapis/nodejs-analytics-data/issues/117)) ([2c5ce79](https://www.github.com/googleapis/nodejs-analytics-data/commit/2c5ce79fb49dbce9e1c4315b8850fa6cbaffe5ce)) + +### [2.4.2](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.4.1...v2.4.2) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#110](https://www.github.com/googleapis/nodejs-analytics-data/issues/110)) ([816580a](https://www.github.com/googleapis/nodejs-analytics-data/commit/816580a5446ea45373f514813cf6d81be93c0532)) + +### [2.4.1](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.4.0...v2.4.1) (2021-05-19) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#101](https://www.github.com/googleapis/nodejs-analytics-data/issues/101)) ([c7b4ff1](https://www.github.com/googleapis/nodejs-analytics-data/commit/c7b4ff1856cbc700098d14fcb86fa11dd31a234b)) +* use require() to load JSON protos ([#104](https://www.github.com/googleapis/nodejs-analytics-data/issues/104)) ([bd0ecb9](https://www.github.com/googleapis/nodejs-analytics-data/commit/bd0ecb923ee6ec73c6f60844e5150b22acc91aa4)) + +## [2.4.0](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.3.0...v2.4.0) (2021-04-02) + + +### Features + +* add `kind` field which is used to distinguish between response types feat: add `potentially_thresholded_requests_per_hour` field to `PropertyQuota` ([#85](https://www.github.com/googleapis/nodejs-analytics-data/issues/85)) ([00b1d04](https://www.github.com/googleapis/nodejs-analytics-data/commit/00b1d04b34e737d3b68ab9e14fe7949106680ac2)) + +## [2.3.0](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.2.1...v2.3.0) (2021-03-11) + + +### Features + +* add v1beta surface (issues fixed) ([#69](https://www.github.com/googleapis/nodejs-analytics-data/issues/69)) ([44005ca](https://www.github.com/googleapis/nodejs-analytics-data/commit/44005cadb55e2e7695205af8977f3966dc53024c)) + +### [2.2.1](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.2.0...v2.2.1) (2021-03-04) + + +### Bug Fixes + +* **deps:** update dependency open to v8 ([#62](https://www.github.com/googleapis/nodejs-analytics-data/issues/62)) ([3724c67](https://www.github.com/googleapis/nodejs-analytics-data/commit/3724c676dcfc11684b1ac36f83ec4f64aea8e6f4)) +* remove v1beta1 to nodejs-analytics-data ([73aca08](https://www.github.com/googleapis/nodejs-analytics-data/commit/73aca080ac587d15feed541d7b66407dacd2b41c)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.1.0...v2.2.0) (2021-03-02) + + +### Features + +* add v1beta1 to nodejs-analytics-data ([#60](https://www.github.com/googleapis/nodejs-analytics-data/issues/60)) ([ffe0395](https://www.github.com/googleapis/nodejs-analytics-data/commit/ffe0395c4b1a648e38dbeaa2b47e4588c34eda82)) + + +### Bug Fixes + +* **deps:** update dependency google-auth-library to v7 ([#58](https://www.github.com/googleapis/nodejs-analytics-data/issues/58)) ([77002d8](https://www.github.com/googleapis/nodejs-analytics-data/commit/77002d877d4c353864d0a55f1247855e80e42fab)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-analytics-data/compare/v2.0.0...v2.1.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#47](https://www.github.com/googleapis/nodejs-analytics-data/issues/47)) ([3028672](https://www.github.com/googleapis/nodejs-analytics-data/commit/3028672c3307fc68aea858c5d7f901f606a73a99)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-analytics-data/compare/v1.1.0...v2.0.0) (2020-12-28) + + +### ⚠ BREAKING CHANGES + +* GetUniversalMetadata method removed from the API, GetMetadata method should be used instead feat: reporting requests support longer date ranges (#43) + +### Bug Fixes + +* GetUniversalMetadata method removed from the API, GetMetadata method should be used instead feat: reporting requests support longer date ranges ([#43](https://www.github.com/googleapis/nodejs-analytics-data/issues/43)) ([661ee0e](https://www.github.com/googleapis/nodejs-analytics-data/commit/661ee0e27abea9978d09ee06b2d6c259712b351f)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-analytics-data/compare/v1.0.2...v1.1.0) (2020-11-11) + + +### Features + +* added RunRealtimeReport method that returns a customized report of realtime event data for a GA4 property docs: minor documentation updates ([#29](https://www.github.com/googleapis/nodejs-analytics-data/issues/29)) ([58da0fe](https://www.github.com/googleapis/nodejs-analytics-data/commit/58da0fe05418d91db1bbb698d787d3863266ff30)) + +### [1.0.2](https://www.github.com/googleapis/nodejs-analytics-data/compare/v1.0.1...v1.0.2) (2020-11-07) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#30](https://www.github.com/googleapis/nodejs-analytics-data/issues/30)) ([f5c9f64](https://www.github.com/googleapis/nodejs-analytics-data/commit/f5c9f64b3074a41ba590ce8be9aadd9961c0ab57)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-analytics-data/compare/v1.0.0...v1.0.1) (2020-11-03) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/billing to v2 ([#7](https://www.github.com/googleapis/nodejs-analytics-data/issues/7)) ([de83230](https://www.github.com/googleapis/nodejs-analytics-data/commit/de832308358059c3dbd59a4e9b118b5c2a208570)) + +## 1.0.0 (2020-09-02) + + +### ⚠ BREAKING CHANGES + +* generate first stub of library (#1) + +### Features + +* generate first stub of library ([#1](https://www.github.com/googleapis/nodejs-analytics-data/issues/1)) ([5514d1c](https://www.github.com/googleapis/nodejs-analytics-data/commit/5514d1cc64de222e29ea6c3e6c3ca6f80bce9eea)) diff --git a/packages/google-analytics-data/CODE_OF_CONDUCT.md b/packages/google-analytics-data/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-analytics-data/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-analytics-data/CONTRIBUTING.md b/packages/google-analytics-data/CONTRIBUTING.md new file mode 100644 index 00000000000..5271088bd54 --- /dev/null +++ b/packages/google-analytics-data/CONTRIBUTING.md @@ -0,0 +1,75 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable the Google Analytics Data API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=analyticsdata.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-analytics-data/LICENSE b/packages/google-analytics-data/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-analytics-data/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.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. diff --git a/packages/google-analytics-data/README.md b/packages/google-analytics-data/README.md new file mode 100644 index 00000000000..41ec2bee4b7 --- /dev/null +++ b/packages/google-analytics-data/README.md @@ -0,0 +1,205 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Analytics Data: Node.js Client](https://github.com/googleapis/nodejs-analytics-data) + +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-analytics/data.svg)](https://www.npmjs.org/package/@google-analytics/data) + + + + +Data client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-analytics-data/blob/main/CHANGELOG.md). + +* [Google Analytics Data Node.js Client API Reference][client-docs] +* [Google Analytics Data Documentation][product-docs] +* [github.com/googleapis/nodejs-analytics-data](https://github.com/googleapis/nodejs-analytics-data) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable the Google Analytics Data API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-analytics/data +``` + + +### Using the client library + +```javascript +/** + * TODO(developer): Uncomment this variable and replace with your + * Google Analytics 4 property ID before running the sample. + */ +// propertyId = 'YOUR-GA4-PROPERTY-ID'; + +// Imports the Google Analytics Data API client library. +const {BetaAnalyticsDataClient} = require('@google-analytics/data'); + +// Using a default constructor instructs the client to use the credentials +// specified in GOOGLE_APPLICATION_CREDENTIALS environment variable. +const analyticsDataClient = new BetaAnalyticsDataClient(); + +// Runs a simple report. +async function runReport() { + const [response] = await analyticsDataClient.runReport({ + property: `properties/${propertyId}`, + dateRanges: [ + { + startDate: '2020-03-31', + endDate: 'today', + }, + ], + dimensions: [ + { + name: 'city', + }, + ], + metrics: [ + { + name: 'activeUsers', + }, + ], + }); + + console.log('Report result:'); + response.rows.forEach(row => { + console.log(row.dimensionValues[0], row.metricValues[0]); + }); +} + +runReport(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-analytics-data/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Get Common Metadata | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/getCommonMetadata.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/getCommonMetadata.js,samples/README.md) | +| Get Metadata By Property Id | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/getMetadataByPropertyId.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/getMetadataByPropertyId.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Quickstart_json_credentials | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/quickstart_json_credentials.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/quickstart_json_credentials.js,samples/README.md) | +| Quickstart_oauth2 | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/quickstart_oauth2.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/quickstart_oauth2.js,samples/README.md) | +| Run Batch Report | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runBatchReport.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runBatchReport.js,samples/README.md) | +| Run Pivot Report | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runPivotReport.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runPivotReport.js,samples/README.md) | +| Run Realtime Report | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runRealtimeReport.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runRealtimeReport.js,samples/README.md) | +| Run Realtime Report With Multiple Dimensions | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runRealtimeReportWithMultipleDimensions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runRealtimeReportWithMultipleDimensions.js,samples/README.md) | +| Run Realtime Report With Multiple Metrics | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runRealtimeReportWithMultipleMetrics.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runRealtimeReportWithMultipleMetrics.js,samples/README.md) | +| Run Report | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReport.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReport.js,samples/README.md) | +| Run Report With Aggregations | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithAggregations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithAggregations.js,samples/README.md) | +| Run Report With Cohorts | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithCohorts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithCohorts.js,samples/README.md) | +| Run Report With Date Ranges | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithDateRanges.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithDateRanges.js,samples/README.md) | +| Run Report With Dimension And Metric Filters | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithDimensionAndMetricFilters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithDimensionAndMetricFilters.js,samples/README.md) | +| Run Report With Dimension Exclude Filter | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithDimensionExcludeFilter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithDimensionExcludeFilter.js,samples/README.md) | +| Run Report With Dimension Filter | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithDimensionFilter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithDimensionFilter.js,samples/README.md) | +| Run Report With Dimension In List Filter | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithDimensionInListFilter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithDimensionInListFilter.js,samples/README.md) | +| Run Report With Multiple Dimension Filters | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithMultipleDimensionFilters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithMultipleDimensionFilters.js,samples/README.md) | +| Run Report With Multiple Dimensions | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithMultipleDimensions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithMultipleDimensions.js,samples/README.md) | +| Run Report With Multiple Metrics | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithMultipleMetrics.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithMultipleMetrics.js,samples/README.md) | +| Run Report With Named Date Ranges | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithNamedDateRanges.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithNamedDateRanges.js,samples/README.md) | +| Run Report With Ordering | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithOrdering.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithOrdering.js,samples/README.md) | +| Run Report With Pagination | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithPagination.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithPagination.js,samples/README.md) | +| Run Report With Property Quota | [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithPropertyQuota.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithPropertyQuota.js,samples/README.md) | + + + +The [Google Analytics Data Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-analytics/data@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + + + + +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-analytics-data/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-analytics-data/blob/main/LICENSE) + +[client-docs]: https://googleapis.dev/nodejs/analytics-data/latest/index.html +[product-docs]: https://developers.google.com/analytics/trusted-testing/analytics-data +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=analyticsdata.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-analytics-data/linkinator.config.json b/packages/google-analytics-data/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-analytics-data/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/packages/google-analytics-data/package.json b/packages/google-analytics-data/package.json new file mode 100644 index 00000000000..996855385d8 --- /dev/null +++ b/packages/google-analytics-data/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-analytics/data", + "version": "3.1.1", + "description": "Data client for Node.js", + "repository": "googleapis/nodejs-analytics-data", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google data", + "data", + "alpha analytics data" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prelint": "cd samples; npm link ../; npm i", + "prepare": "npm run compile-protos && npm run compile", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.2.0", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-analytics-data/protos/google/analytics/data/v1alpha/analytics_data_api.proto b/packages/google-analytics-data/protos/google/analytics/data/v1alpha/analytics_data_api.proto new file mode 100644 index 00000000000..f86cf8dbdb4 --- /dev/null +++ b/packages/google-analytics-data/protos/google/analytics/data/v1alpha/analytics_data_api.proto @@ -0,0 +1,169 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.analytics.data.v1alpha; + +import "google/analytics/data/v1alpha/data.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; + +option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1alpha;data"; +option java_multiple_files = true; +option java_outer_classname = "AnalyticsDataApiProto"; +option java_package = "com.google.analytics.data.v1alpha"; + +// Google Analytics reporting data service. +service AlphaAnalyticsData { + option (google.api.default_host) = "analyticsdata.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/analytics," + "https://www.googleapis.com/auth/analytics.readonly"; + + // Returns a customized funnel report of your Google Analytics event data. The + // data returned from the API is as a table with columns for the requested + // dimensions and metrics. + // + // Funnel exploration lets you visualize the steps your users take to complete + // a task and quickly see how well they are succeeding or failing at each + // step. For example, how do prospects become shoppers and then become buyers? + // How do one time buyers become repeat buyers? With this information, you can + // improve inefficient or abandoned customer journeys. To learn more, see [GA4 + // Funnel Explorations](https://support.google.com/analytics/answer/9327974). + rpc RunFunnelReport(RunFunnelReportRequest) returns (RunFunnelReportResponse) { + option (google.api.http) = { + post: "/v1alpha/{property=properties/*}:runFunnelReport" + body: "*" + }; + } +} + +// The request for a funnel report. +message RunFunnelReportRequest { + // Controls the dimensions present in the funnel visualization sub report + // response. + enum FunnelVisualizationType { + // Unspecified type. + FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED = 0; + + // A standard (stepped) funnel. The funnel visualization sub report in the + // response will not contain date. + STANDARD_FUNNEL = 1; + + // A trended (line chart) funnel. The funnel visualization sub report in the + // response will contain the date dimension. + TRENDED_FUNNEL = 2; + } + + // A Google Analytics GA4 property identifier whose events are tracked. + // Specified in the URL path and not the body. To learn more, see [where to + // find your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // Within a batch request, this property should either be unspecified or + // consistent with the batch-level property. + // + // Example: properties/1234 + string property = 1; + + // Date ranges of data to read. If multiple date ranges are requested, each + // response row will contain a zero based date range index. If two date + // ranges overlap, the event data for the overlapping days is included in the + // response rows for both date ranges. + repeated DateRange date_ranges = 2; + + // The configuration of this request's funnel. This funnel configuration is + // required. + Funnel funnel = 3; + + // If specified, this breakdown adds a dimension to the funnel table sub + // report response. This breakdown dimension expands each funnel step to the + // unique values of the breakdown dimension. For example, a breakdown by the + // `deviceCategory` dimension will create rows for `mobile`, `tablet`, + // `desktop`, and the total. + FunnelBreakdown funnel_breakdown = 4; + + // If specified, next action adds a dimension to the funnel visualization sub + // report response. This next action dimension expands each funnel step to the + // unique values of the next action. For example a next action of the + // `eventName` dimension will create rows for several events (i.e. + // `session_start` & `click`) and the total. + // + // Next action only supports `eventName` and most Page / Screen dimensions + // like `pageTitle` and `pagePath`. + FunnelNextAction funnel_next_action = 5; + + // The funnel visualization type controls the dimensions present in the funnel + // visualization sub report response. If not specified, `STANDARD_FUNNEL` is + // used. + FunnelVisualizationType funnel_visualization_type = 6; + + // The configurations of segments. Segments are subsets of a property's data. + // In a funnel report with segments, the funnel is evaluated in each segment. + // + // Each segment specified in this request + // produces a separate row in the response; in the response, each segment + // identified by its name. + // + // The segments parameter is optional. Requests are limited to 4 segments. + repeated Segment segments = 7; + + // The number of rows to return. If unspecified, 10,000 rows are returned. The + // API returns a maximum of 100,000 rows per request, no matter how many you + // ask for. `limit` must be positive. + // + // The API can also return fewer rows than the requested `limit`, if there + // aren't as many dimension values as the `limit`. + int64 limit = 9; + + // Dimension filters allow you to ask for only specific dimension values in + // the report. To learn more, see [Creating a Report: Dimension + // Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + // for examples. Metrics cannot be used in this filter. + FilterExpression dimension_filter = 10; + + // Toggles whether to return the current state of this Analytics Property's + // quota. Quota is returned in [PropertyQuota](#PropertyQuota). + bool return_property_quota = 12; +} + +// The funnel report response contains two sub reports. The two sub reports are +// different combinations of dimensions and metrics. +message RunFunnelReportResponse { + // The funnel table is a report with the funnel step, segment, breakdown + // dimension, active users, completion rate, abandonments, and abandonments + // rate. + // + // The segment dimension is only present in this response if a segment was + // requested. The breakdown dimension is only present in this response if it + // was requested. + FunnelSubReport funnel_table = 1; + + // The funnel visualization is a report with the funnel step, segment, date, + // next action dimension, and active users. + // + // The segment dimension is only present in this response if a segment was + // requested. The date dimension is only present in this response if it was + // requested via the `TRENDED_FUNNEL` funnel type. The next action dimension + // is only present in the response if it was requested. + FunnelSubReport funnel_visualization = 2; + + // This Analytics Property's quota state including this request. + PropertyQuota property_quota = 3; + + // Identifies what kind of resource this message is. This `kind` is always the + // fixed string "analyticsData#runFunnelReport". Useful to distinguish between + // response types in JSON. + string kind = 4; +} diff --git a/packages/google-analytics-data/protos/google/analytics/data/v1alpha/data.proto b/packages/google-analytics-data/protos/google/analytics/data/v1alpha/data.proto new file mode 100644 index 00000000000..9ef9f614354 --- /dev/null +++ b/packages/google-analytics-data/protos/google/analytics/data/v1alpha/data.proto @@ -0,0 +1,1233 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.analytics.data.v1alpha; + +import "google/protobuf/duration.proto"; + +option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1alpha;data"; +option java_multiple_files = true; +option java_outer_classname = "ReportingApiProto"; +option java_package = "com.google.analytics.data.v1alpha"; + +// A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests +// are allowed up to 4 date ranges. +message DateRange { + // The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot + // be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also + // accepted, and in that case, the date is inferred based on the property's + // reporting time zone. + string start_date = 1; + + // The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot + // be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is + // also accepted, and in that case, the date is inferred based on the + // property's reporting time zone. + string end_date = 2; + + // Assigns a name to this date range. The dimension `dateRange` is valued to + // this name in a report response. If set, cannot begin with `date_range_` or + // `RESERVED_`. If not set, date ranges are named by their zero based index in + // the request: `date_range_0`, `date_range_1`, etc. + string name = 3; +} + +// Dimensions are attributes of your data. For example, the dimension city +// indicates the city from which an event originates. Dimension values in report +// responses are strings; for example, the city could be "Paris" or "New York". +message Dimension { + // The name of the dimension. See the [API + // Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) + // for the list of dimension names. + // + // If `dimensionExpression` is specified, `name` can be any string that you + // would like within the allowed character set. For example if a + // `dimensionExpression` concatenates `country` and `city`, you could call + // that dimension `countryAndCity`. Dimension names that you choose must match + // the regular expression `^[a-zA-Z0-9_]$`. + // + // Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, + // `dimensionExpression`, and `pivots`. + string name = 1; + + // One dimension can be the result of an expression of multiple dimensions. + // For example, dimension "country, city": concatenate(country, ", ", city). + DimensionExpression dimension_expression = 2; +} + +// Used to express a dimension which is the result of a formula of multiple +// dimensions. Example usages: +// 1) lower_case(dimension) +// 2) concatenate(dimension1, symbol, dimension2). +message DimensionExpression { + // Used to convert a dimension value to a single case. + message CaseExpression { + // Name of a dimension. The name must refer back to a name in dimensions + // field of the request. + string dimension_name = 1; + } + + // Used to combine dimension values to a single dimension. + message ConcatenateExpression { + // Names of dimensions. The names must refer back to names in the dimensions + // field of the request. + repeated string dimension_names = 1; + + // The delimiter placed between dimension names. + // + // Delimiters are often single characters such as "|" or "," but can be + // longer strings. If a dimension value contains the delimiter, both will be + // present in response with no distinction. For example if dimension 1 value + // = "US,FR", dimension 2 value = "JP", and delimiter = ",", then the + // response will contain "US,FR,JP". + string delimiter = 2; + } + + // Specify one type of dimension expression for `DimensionExpression`. + oneof one_expression { + // Used to convert a dimension value to lower case. + CaseExpression lower_case = 4; + + // Used to convert a dimension value to upper case. + CaseExpression upper_case = 5; + + // Used to combine dimension values to a single dimension. + // For example, dimension "country, city": concatenate(country, ", ", city). + ConcatenateExpression concatenate = 6; + } +} + +// To express dimension or metric filters. The fields in the same +// FilterExpression need to be either all dimensions or all metrics. +message FilterExpression { + // Specify one type of filter expression for `FilterExpression`. + oneof expr { + // The FilterExpressions in and_group have an AND relationship. + FilterExpressionList and_group = 1; + + // The FilterExpressions in or_group have an OR relationship. + FilterExpressionList or_group = 2; + + // The FilterExpression is NOT of not_expression. + FilterExpression not_expression = 3; + + // A primitive filter. In the same FilterExpression, all of the filter's + // field names need to be either all dimensions or all metrics. + Filter filter = 4; + } +} + +// A list of filter expressions. +message FilterExpressionList { + // A list of filter expressions. + repeated FilterExpression expressions = 1; +} + +// An expression to filter dimension or metric values. +message Filter { + // The dimension name or metric name. Must be a name defined in dimensions + // or metrics. + string field_name = 1; + + // Specify one type of filter for `Filter`. + oneof one_filter { + // Strings related filter. + StringFilter string_filter = 2; + + // A filter for in list values. + InListFilter in_list_filter = 3; + + // A filter for numeric or date values. + NumericFilter numeric_filter = 4; + + // A filter for between two values. + BetweenFilter between_filter = 5; + } +} + +// The filter for string +message StringFilter { + // The match type of a string filter + enum MatchType { + // Unspecified + MATCH_TYPE_UNSPECIFIED = 0; + + // Exact match of the string value. + EXACT = 1; + + // Begins with the string value. + BEGINS_WITH = 2; + + // Ends with the string value. + ENDS_WITH = 3; + + // Contains the string value. + CONTAINS = 4; + + // Full match for the regular expression with the string value. + FULL_REGEXP = 5; + + // Partial match for the regular expression with the string value. + PARTIAL_REGEXP = 6; + } + + // The match type for this filter. + MatchType match_type = 1; + + // The string value used for the matching. + string value = 2; + + // If true, the string value is case sensitive. + bool case_sensitive = 3; +} + +// The result needs to be in a list of string values. +message InListFilter { + // The list of string values. + // Must be non-empty. + repeated string values = 1; + + // If true, the string value is case sensitive. + bool case_sensitive = 2; +} + +// Filters for numeric or date values. +message NumericFilter { + // The operation applied to a numeric filter + enum Operation { + // Unspecified. + OPERATION_UNSPECIFIED = 0; + + // Equal + EQUAL = 1; + + // Less than + LESS_THAN = 2; + + // Less than or equal + LESS_THAN_OR_EQUAL = 3; + + // Greater than + GREATER_THAN = 4; + + // Greater than or equal + GREATER_THAN_OR_EQUAL = 5; + } + + // The operation type for this filter. + Operation operation = 1; + + // A numeric value or a date value. + NumericValue value = 2; +} + +// To express that the result needs to be between two numbers (inclusive). +message BetweenFilter { + // Begins with this number. + NumericValue from_value = 1; + + // Ends with this number. + NumericValue to_value = 2; +} + +// To represent a number. +message NumericValue { + // One of a numeric value + oneof one_value { + // Integer value + int64 int64_value = 1; + + // Double value + double double_value = 2; + } +} + +// Describes a dimension column in the report. Dimensions requested in a report +// produce column entries within rows and DimensionHeaders. However, dimensions +// used exclusively within filters or expressions do not produce columns in a +// report; correspondingly, those dimensions do not produce headers. +message DimensionHeader { + // The dimension's name. + string name = 1; +} + +// Describes a metric column in the report. Visible metrics requested in a +// report produce column entries within rows and MetricHeaders. However, +// metrics used exclusively within filters or expressions do not produce columns +// in a report; correspondingly, those metrics do not produce headers. +message MetricHeader { + // The metric's name. + string name = 1; + + // The metric's data type. + MetricType type = 2; +} + +// Report data for each row. +// For example if RunReportRequest contains: +// +// ```none +// "dimensions": [ +// { +// "name": "eventName" +// }, +// { +// "name": "countryId" +// } +// ], +// "metrics": [ +// { +// "name": "eventCount" +// } +// ] +// ``` +// +// One row with 'in_app_purchase' as the eventName, 'JP' as the countryId, and +// 15 as the eventCount, would be: +// +// ```none +// "dimensionValues": [ +// { +// "value": "in_app_purchase" +// }, +// { +// "value": "JP" +// } +// ], +// "metricValues": [ +// { +// "value": "15" +// } +// ] +// ``` +message Row { + // List of requested dimension values. In a PivotReport, dimension_values + // are only listed for dimensions included in a pivot. + repeated DimensionValue dimension_values = 1; + + // List of requested visible metric values. + repeated MetricValue metric_values = 2; +} + +// The value of a dimension. +message DimensionValue { + // One kind of dimension value + oneof one_value { + // Value as a string if the dimension type is a string. + string value = 1; + } +} + +// The value of a metric. +message MetricValue { + // One of metric value + oneof one_value { + // Measurement value. See MetricHeader for type. + string value = 4; + } +} + +// Current state of all quotas for this Analytics Property. If any quota for a +// property is exhausted, all requests to that property will return Resource +// Exhausted errors. +message PropertyQuota { + // Standard Analytics Properties can use up to 25,000 tokens per day; + // Analytics 360 Properties can use 250,000 tokens per day. Most requests + // consume fewer than 10 tokens. + QuotaStatus tokens_per_day = 1; + + // Standard Analytics Properties can use up to 5,000 tokens per hour; + // Analytics 360 Properties can use 50,000 tokens per hour. An API request + // consumes a single number of tokens, and that number is deducted from both + // the hourly and daily quotas. + QuotaStatus tokens_per_hour = 2; + + // Standard Analytics Properties can send up to 10 concurrent requests; + // Analytics 360 Properties can use up to 50 concurrent requests. + QuotaStatus concurrent_requests = 3; + + // Standard Analytics Properties and cloud project pairs can have up to 10 + // server errors per hour; Analytics 360 Properties and cloud project pairs + // can have up to 50 server errors per hour. + QuotaStatus server_errors_per_project_per_hour = 4; + + // Analytics Properties can send up to 120 requests with potentially + // thresholded dimensions per hour. In a batch request, each report request + // is individually counted for this quota if the request contains potentially + // thresholded dimensions. + QuotaStatus potentially_thresholded_requests_per_hour = 5; +} + +// Current state for a particular quota group. +message QuotaStatus { + // Quota consumed by this request. + int32 consumed = 1; + + // Quota remaining after this request. + int32 remaining = 2; +} + +// Breakdowns add a dimension to the funnel table sub report response. +message FunnelBreakdown { + // The dimension column added to the funnel table sub report response. The + // breakdown dimension breaks down each funnel step. A valid + // `breakdownDimension` is required if `funnelBreakdown` is specified. + Dimension breakdown_dimension = 1; + + // The maximum number of distinct values of the breakdown dimension to return + // in the response. A `limit` of `5` is used if limit is not specified. Limit + // must exceed zero and cannot exceed 15. + optional int64 limit = 2; +} + +// Next actions state the value for a dimension after the user has achieved +// a step but before the same user has achieved the next step. For example if +// the `nextActionDimension` is `eventName`, then `nextActionDimension` in the +// `i`th funnel step row will return first event after the event that qualified +// the user into the `i`th funnel step but before the user achieved the `i+1`th +// funnel step. +message FunnelNextAction { + // The dimension column added to the funnel visualization sub report response. + // The next action dimension returns the next dimension value of this + // dimension after the user has attained the `i`th funnel step. + // + // `nextActionDimension` currently only supports `eventName` and most Page / + // Screen dimensions like `pageTitle` and `pagePath`. `nextActionDimension` + // cannot be a dimension expression. + Dimension next_action_dimension = 1; + + // The maximum number of distinct values of the breakdown dimension to return + // in the response. A `limit` of `5` is used if limit is not specified. Limit + // must exceed zero and cannot exceed 5. + optional int64 limit = 2; +} + +// Configures the funnel in a funnel report request. A funnel reports on users +// as they pass through a sequence of steps. +// +// Funnel exploration lets you visualize the steps your users take to complete a +// task and quickly see how well they are succeeding or failing at each step. +// For example, how do prospects become shoppers and then become buyers? How do +// one time buyers become repeat buyers? With this information, you can improve +// inefficient or abandoned customer journeys. +message Funnel { + // In an open funnel, users can enter the funnel in any step, and in a closed + // funnel, users must enter the funnel in the first step. Optional. If + // unspecified, a closed funnel is used. + bool is_open_funnel = 1; + + // The sequential steps of this funnel. + repeated FunnelStep steps = 2; +} + +// Steps define the user journey you want to measure. Steps contain one or +// more conditions that your users must meet to be included in that step of +// the funnel journey. +message FunnelStep { + // The distinctive name for this step. If unspecified, steps will be named + // by a 1 based indexed name (i.e. "0. ", "1. ", etc.). This name defines + // string value returned by the `funnelStepName` dimension. For example, + // specifying `name = Purchase` in the request's third funnel step will + // produce `3. Purchase` in the funnel report response. + string name = 1; + + // If true, this step must directly follow the previous step. If false, + // there can be events between the previous step and this step. If + // unspecified, `isDirectlyFollowedBy` is treated as false. + bool is_directly_followed_by = 2; + + // If specified, this step must complete within this duration of the + // completion of the prior step. `withinDurationFromPriorStep` is inclusive + // of the endpoint at the microsecond granularity. For example a duration of + // 5 seconds can be completed at 4.9 or 5.0 seconds, but not 5 seconds and 1 + // microsecond. + // + // `withinDurationFromPriorStep` is optional, and if unspecified, steps may + // be separated by any time duration. + optional google.protobuf.Duration within_duration_from_prior_step = 3; + + // The condition that your users must meet to be included in this step of + // the funnel journey. + FunnelFilterExpression filter_expression = 4; +} + +// Funnel sub reports contain the dimension and metric data values. For example, +// 12 users reached the second step of the funnel. +message FunnelSubReport { + // Describes dimension columns. Funnel reports always include the funnel step + // dimension in sub report responses. Additional dimensions like breakdowns, + // dates, and next actions may be present in the response if requested. + repeated DimensionHeader dimension_headers = 1; + + // Describes metric columns. Funnel reports always include active users in sub + // report responses. The funnel table includes additional metrics like + // completion rate, abandonments, and abandonments rate. + repeated MetricHeader metric_headers = 2; + + // Rows of dimension value combinations and metric values in the report. + repeated Row rows = 3; + + // Metadata for the funnel report. + FunnelResponseMetadata metadata = 4; +} + +// User segments are subsets of users who engaged with your site or app. For +// example, users who have previously purchased; users who added items to their +// shopping carts, but didn’t complete a purchase. +message UserSegment { + // Defines which users are included in this segment. Optional. + UserSegmentCriteria user_inclusion_criteria = 1; + + // Defines which users are excluded in this segment. Optional. + UserSegmentExclusion exclusion = 2; +} + +// A user matches a criteria if the user's events meet the conditions in the +// criteria. +message UserSegmentCriteria { + // A user matches this criteria if the user matches each of these + // `andConditionGroups` and each of the `andSequenceGroups`. + // `andConditionGroups` may be empty if `andSequenceGroups` are specified. + repeated UserSegmentConditionGroup and_condition_groups = 1; + + // A user matches this criteria if the user matches each of these + // `andSequenceGroups` and each of the `andConditionGroups`. + // `andSequenceGroups` may be empty if `andConditionGroups` are specified. + repeated UserSegmentSequenceGroup and_sequence_groups = 2; +} + +// Scoping specifies which events are considered when evaluating if a user +// meets a criteria. +enum UserCriteriaScoping { + // Unspecified criteria scoping. Do not specify. + USER_CRITERIA_SCOPING_UNSPECIFIED = 0; + + // If the criteria is satisfied within one event, the user matches the + // criteria. + USER_CRITERIA_WITHIN_SAME_EVENT = 1; + + // If the criteria is satisfied within one session, the user matches the + // criteria. + USER_CRITERIA_WITHIN_SAME_SESSION = 2; + + // If the criteria is satisfied by any events for the user, the user + // matches the criteria. + USER_CRITERIA_ACROSS_ALL_SESSIONS = 3; +} + +// Conditions tell Analytics what data to include in or exclude from the +// segment. +message UserSegmentConditionGroup { + // Data is included or excluded from the segment based on if it matches + // the condition group. This scoping defines how many events the + // `segmentFilterExpression` is evaluated on before the condition group + // is determined to be matched or not. For example if `conditionScoping = + // USER_CRITERIA_WITHIN_SAME_SESSION`, the expression is evaluated on all + // events in a session, and then, the condition group is determined to be + // matched or not for this user. For example if `conditionScoping = + // USER_CRITERIA_WITHIN_SAME_EVENT`, the expression is evaluated on a single + // event, and then, the condition group is determined to be matched or not for + // this user. + // + // Optional. If unspecified, `conditionScoping = ACROSS_ALL_SESSIONS` is + // used. + UserCriteriaScoping condition_scoping = 1; + + // Data is included or excluded from the segment based on if it matches + // this expression. Expressions express criteria on dimension, metrics, + // and/or parameters. + SegmentFilterExpression segment_filter_expression = 2; +} + +// Define conditions that must occur in a specific order for the user to be +// a member of the segment. +message UserSegmentSequenceGroup { + // All sequence steps must be satisfied in the scoping for the user to + // match the sequence. For example if `sequenceScoping = + // USER_CRITERIA_WITHIN_SAME_SESSION`, all sequence steps must complete within + // one session for the user to match the sequence. `sequenceScoping = + // USER_CRITERIA_WITHIN_SAME_EVENT` is not supported. + // + // Optional. If unspecified, `conditionScoping = ACROSS_ALL_SESSIONS` is + // used. + UserCriteriaScoping sequence_scoping = 1; + + // Defines the time period in which the whole sequence must occur; for + // example, 30 Minutes. `sequenceMaximumDuration` is inclusive + // of the endpoint at the microsecond granularity. For example a sequence + // with a maximum duration of 5 seconds can be completed at 4.9 or 5.0 + // seconds, but not 5 seconds and 1 microsecond. + // + // `sequenceMaximumDuration` is optional, and if unspecified, sequences can + // be completed in any time duration. + google.protobuf.Duration sequence_maximum_duration = 2; + + // An ordered sequence of condition steps. A user's events must complete + // each step in order for the user to match the + // `UserSegmentSequenceGroup`. + repeated UserSequenceStep user_sequence_steps = 3; +} + +// A condition that must occur in the specified step order for this user +// to match the sequence. +message UserSequenceStep { + // If true, the event satisfying this step must be the very next event + // after the event satifying the last step. If false, this step indirectly + // follows the prior step; for example, there may be events between the + // prior step and this step. `isDirectlyFollowedBy` must be false for + // the first step. + bool is_directly_followed_by = 1; + + // This sequence step must be satisfied in the scoping for the user to + // match the sequence. For example if `sequenceScoping = + // WITHIN_SAME_SESSION`, this sequence steps must complete within one + // session for the user to match the sequence. `stepScoping = + // ACROSS_ALL_SESSIONS` is only allowed if the `sequenceScoping = + // ACROSS_ALL_SESSIONS`. + // + // Optional. If unspecified, `stepScoping` uses the same + // `UserCriteriaScoping` as the `sequenceScoping`. + UserCriteriaScoping step_scoping = 2; + + // A user matches this sequence step if their events match this + // expression. Expressions express criteria on dimension, metrics, + // and/or parameters. + SegmentFilterExpression segment_filter_expression = 3; +} + +// Specifies which users are excluded in this segment. +message UserSegmentExclusion { + // Specifies how long an exclusion will last if a user matches the + // `userExclusionCriteria`. + // + // Optional. If unspecified, `userExclusionDuration` of + // `USER_EXCLUSION_TEMPORARY` is used. + UserExclusionDuration user_exclusion_duration = 1; + + // If a user meets this condition, the user is excluded from membership in + // the segment for the `userExclusionDuration`. + UserSegmentCriteria user_exclusion_criteria = 2; +} + +// Enumerates options for how long an exclusion will last if a user matches +// the `userExclusionCriteria`. +enum UserExclusionDuration { + // Unspecified exclusion duration. Do not specify. + USER_EXCLUSION_DURATION_UNSPECIFIED = 0; + + // Temporarily exclude users from the segment during periods when the + // user meets the `userExclusionCriteria` condition. + USER_EXCLUSION_TEMPORARY = 1; + + // Permanently exclude users from the segment if the user ever meets the + // `userExclusionCriteria` condition. + USER_EXCLUSION_PERMANENT = 2; +} + +// Session segments are subsets of the sessions that occurred on your site or +// app: for example, all the sessions that originated from a particular +// advertising campaign. +message SessionSegment { + // Defines which sessions are included in this segment. Optional. + SessionSegmentCriteria session_inclusion_criteria = 1; + + // Defines which sessions are excluded in this segment. Optional. + SessionSegmentExclusion exclusion = 2; +} + +// A session matches a criteria if the session's events meet the conditions in +// the criteria. +message SessionSegmentCriteria { + // A session matches this criteria if the session matches each of these + // `andConditionGroups`. + repeated SessionSegmentConditionGroup and_condition_groups = 1; +} + +// Scoping specifies which events are considered when evaluating if a +// session meets a criteria. +enum SessionCriteriaScoping { + // Unspecified criteria scoping. Do not specify. + SESSION_CRITERIA_SCOPING_UNSPECIFIED = 0; + + // If the criteria is satisfied within one event, the session matches the + // criteria. + SESSION_CRITERIA_WITHIN_SAME_EVENT = 1; + + // If the criteria is satisfied within one session, the session matches + // the criteria. + SESSION_CRITERIA_WITHIN_SAME_SESSION = 2; +} + +// Conditions tell Analytics what data to include in or exclude from the +// segment. +message SessionSegmentConditionGroup { + // Data is included or excluded from the segment based on if it matches + // the condition group. This scoping defines how many events the + // `segmentFilterExpression` is evaluated on before the condition group + // is determined to be matched or not. For example if `conditionScoping = + // SESSION_CRITERIA_WITHIN_SAME_SESSION`, the expression is evaluated on all + // events in a session, and then, the condition group is determined to be + // matched or not for this session. For example if `conditionScoping = + // SESSION_CRITERIA_WITHIN_SAME_EVENT`, the expression is evaluated on a + // single event, and then, the condition group is determined to be matched or + // not for this session. + // + // Optional. If unspecified, a `conditionScoping` of `WITHIN_SAME_SESSION` + // is used. + SessionCriteriaScoping condition_scoping = 1; + + // Data is included or excluded from the segment based on if it matches + // this expression. Expressions express criteria on dimension, metrics, + // and/or parameters. + SegmentFilterExpression segment_filter_expression = 2; +} + +// Specifies which sessions are excluded in this segment. +message SessionSegmentExclusion { + // Specifies how long an exclusion will last if a session matches the + // `sessionExclusionCriteria`. + // + // Optional. If unspecified, a `sessionExclusionDuration` of + // `SESSION_EXCLUSION_TEMPORARY` is used. + SessionExclusionDuration session_exclusion_duration = 1; + + // If a session meets this condition, the session is excluded from + // membership in the segment for the `sessionExclusionDuration`. + SessionSegmentCriteria session_exclusion_criteria = 2; +} + +// Enumerates options for how long an exclusion will last if a session +// matches the `sessionExclusionCriteria`. +enum SessionExclusionDuration { + // Unspecified exclusion duration. Do not specify. + SESSION_EXCLUSION_DURATION_UNSPECIFIED = 0; + + // Temporarily exclude sessions from the segment during periods when the + // session meets the `sessionExclusionCriteria` condition. + SESSION_EXCLUSION_TEMPORARY = 1; + + // Permanently exclude sessions from the segment if the session ever meets + // the `sessionExclusionCriteria` condition. + SESSION_EXCLUSION_PERMANENT = 2; +} + +// Event segments are subsets of events that were triggered on your site or app. +// for example, all purchase events made in a particular location; app_exception +// events that occurred on a specific operating system. +message EventSegment { + // Defines which events are included in this segment. Optional. + EventSegmentCriteria event_inclusion_criteria = 1; + + // Defines which events are excluded in this segment. Optional. + EventSegmentExclusion exclusion = 2; +} + +// An event matches a criteria if the event meet the conditions in the +// criteria. +message EventSegmentCriteria { + // An event matches this criteria if the event matches each of these + // `andConditionGroups`. + repeated EventSegmentConditionGroup and_condition_groups = 1; +} + +// Scoping specifies which events are considered when evaluating if an event +// meets a criteria. +enum EventCriteriaScoping { + // Unspecified criteria scoping. Do not specify. + EVENT_CRITERIA_SCOPING_UNSPECIFIED = 0; + + // If the criteria is satisfied within one event, the event matches the + // criteria. + EVENT_CRITERIA_WITHIN_SAME_EVENT = 1; +} + +// Conditions tell Analytics what data to include in or exclude from the +// segment. +message EventSegmentConditionGroup { + // `conditionScoping` should always be `EVENT_CRITERIA_WITHIN_SAME_EVENT`. + // + // Optional. If unspecified, a `conditionScoping` of + // `EVENT_CRITERIA_WITHIN_SAME_EVENT` is used. + EventCriteriaScoping condition_scoping = 1; + + // Data is included or excluded from the segment based on if it matches + // this expression. Expressions express criteria on dimension, metrics, + // and/or parameters. + SegmentFilterExpression segment_filter_expression = 2; +} + +// Specifies which events are excluded in this segment. +message EventSegmentExclusion { + // `eventExclusionDuration` should always be `PERMANENTLY_EXCLUDE`. + // + // Optional. If unspecified, an `eventExclusionDuration` of + // `EVENT_EXCLUSION_PERMANENT` is used. + EventExclusionDuration event_exclusion_duration = 1; + + // If an event meets this condition, the event is excluded from membership + // in the segment for the `eventExclusionDuration`. + EventSegmentCriteria event_exclusion_criteria = 2; +} + +// Enumerates options for how long an exclusion will last if an event +// matches the `eventExclusionCriteria`. +enum EventExclusionDuration { + // Unspecified exclusion duration. Do not specify. + EVENT_EXCLUSION_DURATION_UNSPECIFIED = 0; + + // Permanently exclude events from the segment if the event ever meets + // the `eventExclusionCriteria` condition. + EVENT_EXCLUSION_PERMANENT = 1; +} + +// A segment is a subset of your Analytics data. For example, of your entire set +// of users, one segment might be users from a particular country or city. +// Another segment might be users who purchase a particular line of products or +// who visit a specific part of your site or trigger certain events in your app. +// +// To learn more, see [GA4 Segment +// Builder](https://support.google.com/analytics/answer/9304353). +message Segment { + // The name for this segment. If unspecified, segments are named "Segment". + // This name defines string value returned by the `segment` dimension. The + // `segment` dimension prefixes segment names by the 1-based index number of + // the segment in the request (i.e. "1. Segment", "2. Segment", etc.). + string name = 1; + + // A segment is specified in one scope. + oneof one_segment_scope { + // User segments are subsets of users who engaged with your site or app. + UserSegment user_segment = 2; + + // Session segments are subsets of the sessions that occurred on your site + // or app. + SessionSegment session_segment = 3; + + // Event segments are subsets of events that were triggered on your site or + // app. + EventSegment event_segment = 4; + } +} + +// Expresses combinations of segment filters. +message SegmentFilterExpression { + // Specify one type of filter for `SegmentFilterExpression`. + oneof expr { + // The SegmentFilterExpression in `andGroup` have an AND relationship. + SegmentFilterExpressionList and_group = 1; + + // The SegmentFilterExpression in `orGroup` have an OR relationship. + SegmentFilterExpressionList or_group = 2; + + // The SegmentFilterExpression is NOT of `notExpression`. + SegmentFilterExpression not_expression = 3; + + // A primitive segment filter. + SegmentFilter segment_filter = 4; + + // Creates a filter that matches events of a single event name. If a + // parameter filter expression is specified, only the subset of events that + // match both the single event name and the parameter filter expressions + // match this event filter. + SegmentEventFilter segment_event_filter = 5; + } +} + +// A list of segment filter expressions. +message SegmentFilterExpressionList { + // The list of segment filter expressions + repeated SegmentFilterExpression expressions = 1; +} + +// An expression to filter dimension or metric values. +message SegmentFilter { + // The dimension name or metric name. + string field_name = 1; + + // Specify one type of filter for `Filter`. + oneof one_filter { + // Strings related filter. + StringFilter string_filter = 4; + + // A filter for in list values. + InListFilter in_list_filter = 5; + + // A filter for numeric or date values. + NumericFilter numeric_filter = 6; + + // A filter for between two values. + BetweenFilter between_filter = 7; + } + + // Specifies the scope for the filter. + SegmentFilterScoping filter_scoping = 8; +} + +// Scopings specify how the dimensions & metrics of multiple events +// should be considered when evaluating a segment filter. +message SegmentFilterScoping { + // If `atAnyPointInTime` is true, this filter evaluates to true for all + // events if it evaluates to true for any event in the date range of the + // request. + // + // This `atAnyPointInTime` parameter does not extend the date range of + // events in the report. If `atAnyPointInTime` is true, only events within + // the report's date range are considered when evaluating this filter. + // + // This `atAnyPointInTime` is only able to be specified if the criteria + // scoping is `ACROSS_ALL_SESSIONS` and is not able to be specified in + // sequences. + // + // If the criteria scoping is `ACROSS_ALL_SESSIONS`, `atAnyPointInTime` = + // false is used if unspecified. + optional bool at_any_point_in_time = 1; +} + +// Creates a filter that matches events of a single event name. If a parameter +// filter expression is specified, only the subset of events that match both the +// single event name and the parameter filter expressions match this event +// filter. +message SegmentEventFilter { + // This filter matches events of this single event name. Event name is + // required. + optional string event_name = 1; + + // If specified, this filter matches events that match both the single event + // name and the parameter filter expressions. + // + // Inside the parameter filter expression, only parameter filters are + // available. + optional SegmentParameterFilterExpression segment_parameter_filter_expression = 2; +} + +// Expresses combinations of segment filter on parameters. +message SegmentParameterFilterExpression { + // Specify one type of filter for `SegmentParameterFilterExpression`. + oneof expr { + // The SegmentParameterFilterExpression in `andGroup` have an AND + // relationship. + SegmentParameterFilterExpressionList and_group = 1; + + // The SegmentParameterFilterExpression in `orGroup` have an OR + // relationship. + SegmentParameterFilterExpressionList or_group = 2; + + // The SegmentParameterFilterExpression is NOT of `notExpression`. + SegmentParameterFilterExpression not_expression = 3; + + // A primitive segment parameter filter. + SegmentParameterFilter segment_parameter_filter = 4; + } +} + +// A list of segment parameter filter expressions. +message SegmentParameterFilterExpressionList { + // The list of segment parameter filter expressions. + repeated SegmentParameterFilterExpression expressions = 1; +} + +// An expression to filter parameter values in a segment. +message SegmentParameterFilter { + // The field that is being filtered. + oneof one_parameter { + // This filter will be evaluated on the specified event parameter. Event + // parameters are logged as parameters of the event. Event parameters + // include fields like "firebase_screen" & "currency". + // + // Event parameters can only be used in segments & funnels and can only be + // used in a descendent filter from an EventFilter. In a descendent filter + // from an EventFilter either event or item parameters should be used. + string event_parameter_name = 1; + + // This filter will be evaluated on the specified item parameter. Item + // parameters are logged as parameters in the item array. Item parameters + // include fields like "item_name" & "item_category". + // + // Item parameters can only be used in segments & funnels and can only be + // used in a descendent filter from an EventFilter. In a descendent filter + // from an EventFilter either event or item parameters should be used. + // + // Item parameters are only available in ecommerce events. To learn more + // about ecommerce events, see the [Measure ecommerce] + // (https://developers.google.com/analytics/devguides/collection/ga4/ecommerce) + // guide. + string item_parameter_name = 2; + } + + // Specify one type of filter. + oneof one_filter { + // Strings related filter. + StringFilter string_filter = 4; + + // A filter for in list values. + InListFilter in_list_filter = 5; + + // A filter for numeric or date values. + NumericFilter numeric_filter = 6; + + // A filter for between two values. + BetweenFilter between_filter = 7; + } + + // Specifies the scope for the filter. + SegmentParameterFilterScoping filter_scoping = 8; +} + +// Scopings specify how multiple events should be considered when evaluating a +// segment parameter filter. +message SegmentParameterFilterScoping { + // Accumulates the parameter over the specified period of days before + // applying the filter. Only supported if criteria scoping is + // `ACROSS_ALL_SESSIONS` or `WITHIN_SAME_SESSION`. Only supported if the + // parameter is `event_count`. + // + // For example if `inAnyNDayPeriod` is 3, the event_name is "purchase", + // the event parameter is "event_count", and the Filter's criteria is + // greater than 5, this filter will accumulate the event count of purchase + // events over every 3 consecutive day period in the report's date range; a + // user will pass this Filter's criteria to be included in this segment if + // their count of purchase events exceeds 5 in any 3 consecutive day period. + // For example, the periods 2021-11-01 to 2021-11-03, 2021-11-02 to + // 2021-11-04, 2021-11-03 to 2021-11-05, and etc. will be considered. + // + // The date range is not extended for the purpose of having a full N day + // window near the start of the date range. For example if a report is for + // 2021-11-01 to 2021-11-10 and `inAnyNDayPeriod` = 3, the first two day + // period will be effectively shortened because no event data outside the + // report's date range will be read. For example, the first four periods + // will effectively be: 2021-11-01 to 2021-11-01, 2021-11-01 to 2021-11-02, + // 2021-11-01 to 2021-11-03, and 2021-11-02 to 2021-11-04. + // + // `inAnyNDayPeriod` is optional. If not specified, the + // `segmentParameterFilter` is applied to each event individually. + optional int64 in_any_n_day_period = 1; +} + +// Expresses combinations of funnel filters. +message FunnelFilterExpression { + // Specify one type of filter for `FunnelFilterExpression`. + oneof expr { + // The FunnelFilterExpression in `andGroup` have an AND relationship. + FunnelFilterExpressionList and_group = 1; + + // The FunnelFilterExpression in `orGroup` have an OR relationship. + FunnelFilterExpressionList or_group = 2; + + // The FunnelFilterExpression is NOT of `notExpression`. + FunnelFilterExpression not_expression = 3; + + // A funnel filter for a dimension or metric. + FunnelFieldFilter funnel_field_filter = 4; + + // Creates a filter that matches events of a single event name. If a + // parameter filter expression is specified, only the subset of events that + // match both the single event name and the parameter filter expressions + // match this event filter. + FunnelEventFilter funnel_event_filter = 5; + } +} + +// A list of funnel filter expressions. +message FunnelFilterExpressionList { + // The list of funnel filter expressions. + repeated FunnelFilterExpression expressions = 1; +} + +// An expression to filter dimension or metric values. +message FunnelFieldFilter { + // The dimension name or metric name. + string field_name = 1; + + // Specify one type of filter. + oneof one_filter { + // Strings related filter. + StringFilter string_filter = 4; + + // A filter for in list values. + InListFilter in_list_filter = 5; + + // A filter for numeric or date values. + NumericFilter numeric_filter = 6; + + // A filter for between two values. + BetweenFilter between_filter = 7; + } +} + +// Creates a filter that matches events of a single event name. If a parameter +// filter expression is specified, only the subset of events that match both the +// single event name and the parameter filter expressions match this event +// filter. +message FunnelEventFilter { + // This filter matches events of this single event name. Event name is + // required. + optional string event_name = 1; + + // If specified, this filter matches events that match both the single event + // name and the parameter filter expressions. + // + // Inside the parameter filter expression, only parameter filters are + // available. + optional FunnelParameterFilterExpression funnel_parameter_filter_expression = 2; +} + +// Expresses combinations of funnel filters on parameters. +message FunnelParameterFilterExpression { + // Specify one type of filter for `FunnelParameterFilterExpression`. + oneof expr { + // The FunnelParameterFilterExpression in `andGroup` have an AND + // relationship. + FunnelParameterFilterExpressionList and_group = 1; + + // The FunnelParameterFilterExpression in `orGroup` have an OR + // relationship. + FunnelParameterFilterExpressionList or_group = 2; + + // The FunnelParameterFilterExpression is NOT of `notExpression`. + FunnelParameterFilterExpression not_expression = 3; + + // A primitive funnel parameter filter. + FunnelParameterFilter funnel_parameter_filter = 4; + } +} + +// A list of funnel parameter filter expressions. +message FunnelParameterFilterExpressionList { + // The list of funnel parameter filter expressions. + repeated FunnelParameterFilterExpression expressions = 1; +} + +// An expression to filter parameter values in a funnel. +message FunnelParameterFilter { + // The field that is being filtered. + oneof one_parameter { + // This filter will be evaluated on the specified event parameter. Event + // parameters are logged as parameters of the event. Event parameters + // include fields like "firebase_screen" & "currency". + // + // Event parameters can only be used in segments & funnels and can only be + // used in a descendent filter from an EventFilter. In a descendent filter + // from an EventFilter either event or item parameters should be used. + string event_parameter_name = 1; + + // This filter will be evaluated on the specified item parameter. Item + // parameters are logged as parameters in the item array. Item parameters + // include fields like "item_name" & "item_category". + // + // Item parameters can only be used in segments & funnels and can only be + // used in a descendent filter from an EventFilter. In a descendent filter + // from an EventFilter either event or item parameters should be used. + // + // Item parameters are only available in ecommerce events. To learn more + // about ecommerce events, see the [Measure ecommerce] + // (https://developers.google.com/analytics/devguides/collection/ga4/ecommerce) + // guide. + string item_parameter_name = 2; + } + + // Specify one type of filter. + oneof one_filter { + // Strings related filter. + StringFilter string_filter = 4; + + // A filter for in list values. + InListFilter in_list_filter = 5; + + // A filter for numeric or date values. + NumericFilter numeric_filter = 6; + + // A filter for between two values. + BetweenFilter between_filter = 7; + } +} + +// The funnel report's response metadata carries additional information about +// the funnel report. +message FunnelResponseMetadata { + // If funnel report results are + // [sampled](https://support.google.com/analytics/answer/2637192), this + // describes what percentage of events were used in this funnel report. One + // `samplingMetadatas` is populated for each date range. Each + // `samplingMetadatas` corresponds to a date range in order that date ranges + // were specified in the request. + // + // However if the results are not sampled, this field will not be defined. + repeated SamplingMetadata sampling_metadatas = 1; +} + +// If funnel report results are +// [sampled](https://support.google.com/analytics/answer/2637192), this +// metadata describes what percentage of events were used in this funnel +// report for a date range. Sampling is the practice of analyzing a subset of +// all data in order to uncover the meaningful information in the larger data +// set. +message SamplingMetadata { + // The total number of events read in this sampled report for a date range. + // This is the size of the subset this property's data that was analyzed in + // this funnel report. + int64 samples_read_count = 1; + + // The total number of events present in this property's data that could + // have been analyzed in this funnel report for a date range. Sampling + // uncovers the meaningful information about the larger data set, and this + // is the size of the larger data set. + // + // To calculate the percentage of available data that was used in this + // funnel report, compute `samplesReadCount/samplingSpaceSize`. + int64 sampling_space_size = 2; +} + +// A metric's value type. +enum MetricType { + // Unspecified type. + METRIC_TYPE_UNSPECIFIED = 0; + + // Integer type. + TYPE_INTEGER = 1; + + // Floating point type. + TYPE_FLOAT = 2; + + // A duration of seconds; a special floating point type. + TYPE_SECONDS = 4; + + // A duration in milliseconds; a special floating point type. + TYPE_MILLISECONDS = 5; + + // A duration in minutes; a special floating point type. + TYPE_MINUTES = 6; + + // A duration in hours; a special floating point type. + TYPE_HOURS = 7; + + // A custom metric of standard type; a special floating point type. + TYPE_STANDARD = 8; + + // An amount of money; a special floating point type. + TYPE_CURRENCY = 9; + + // A length in feet; a special floating point type. + TYPE_FEET = 10; + + // A length in miles; a special floating point type. + TYPE_MILES = 11; + + // A length in meters; a special floating point type. + TYPE_METERS = 12; + + // A length in kilometers; a special floating point type. + TYPE_KILOMETERS = 13; +} diff --git a/packages/google-analytics-data/protos/google/analytics/data/v1beta/analytics_data_api.proto b/packages/google-analytics-data/protos/google/analytics/data/v1beta/analytics_data_api.proto new file mode 100644 index 00000000000..e5ee72cca49 --- /dev/null +++ b/packages/google-analytics-data/protos/google/analytics/data/v1beta/analytics_data_api.proto @@ -0,0 +1,628 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.analytics.data.v1beta; + +import "google/analytics/data/v1beta/data.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1beta;data"; +option java_multiple_files = true; +option java_outer_classname = "AnalyticsDataApiProto"; +option java_package = "com.google.analytics.data.v1beta"; + +// Google Analytics reporting data service. +service BetaAnalyticsData { + option (google.api.default_host) = "analyticsdata.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/analytics," + "https://www.googleapis.com/auth/analytics.readonly"; + + // Returns a customized report of your Google Analytics event data. Reports + // contain statistics derived from data collected by the Google Analytics + // tracking code. The data returned from the API is as a table with columns + // for the requested dimensions and metrics. Metrics are individual + // measurements of user activity on your property, such as active users or + // event count. Dimensions break down metrics across some common criteria, + // such as country or event name. + // + // For a guide to constructing requests & understanding responses, see + // [Creating a + // Report](https://developers.google.com/analytics/devguides/reporting/data/v1/basics). + rpc RunReport(RunReportRequest) returns (RunReportResponse) { + option (google.api.http) = { + post: "/v1beta/{property=properties/*}:runReport" + body: "*" + }; + } + + // Returns a customized pivot report of your Google Analytics event data. + // Pivot reports are more advanced and expressive formats than regular + // reports. In a pivot report, dimensions are only visible if they are + // included in a pivot. Multiple pivots can be specified to further dissect + // your data. + rpc RunPivotReport(RunPivotReportRequest) returns (RunPivotReportResponse) { + option (google.api.http) = { + post: "/v1beta/{property=properties/*}:runPivotReport" + body: "*" + }; + } + + // Returns multiple reports in a batch. All reports must be for the same + // GA4 Property. + rpc BatchRunReports(BatchRunReportsRequest) returns (BatchRunReportsResponse) { + option (google.api.http) = { + post: "/v1beta/{property=properties/*}:batchRunReports" + body: "*" + }; + } + + // Returns multiple pivot reports in a batch. All reports must be for the same + // GA4 Property. + rpc BatchRunPivotReports(BatchRunPivotReportsRequest) returns (BatchRunPivotReportsResponse) { + option (google.api.http) = { + post: "/v1beta/{property=properties/*}:batchRunPivotReports" + body: "*" + }; + } + + // Returns metadata for dimensions and metrics available in reporting methods. + // Used to explore the dimensions and metrics. In this method, a Google + // Analytics GA4 Property Identifier is specified in the request, and + // the metadata response includes Custom dimensions and metrics as well as + // Universal metadata. + // + // For example if a custom metric with parameter name `levels_unlocked` is + // registered to a property, the Metadata response will contain + // `customEvent:levels_unlocked`. Universal metadata are dimensions and + // metrics applicable to any property such as `country` and `totalUsers`. + rpc GetMetadata(GetMetadataRequest) returns (Metadata) { + option (google.api.http) = { + get: "/v1beta/{name=properties/*/metadata}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns a customized report of realtime event data for your property. + // Events appear in realtime reports seconds after they have been sent to + // the Google Analytics. Realtime reports show events and usage data for the + // periods of time ranging from the present moment to 30 minutes ago (up to + // 60 minutes for Google Analytics 360 properties). + // + // For a guide to constructing realtime requests & understanding responses, + // see [Creating a Realtime + // Report](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-basics). + rpc RunRealtimeReport(RunRealtimeReportRequest) returns (RunRealtimeReportResponse) { + option (google.api.http) = { + post: "/v1beta/{property=properties/*}:runRealtimeReport" + body: "*" + }; + } + + // This compatibility method lists dimensions and metrics that can be added to + // a report request and maintain compatibility. This method fails if the + // request's dimensions and metrics are incompatible. + // + // In Google Analytics, reports fail if they request incompatible dimensions + // and/or metrics; in that case, you will need to remove dimensions and/or + // metrics from the incompatible report until the report is compatible. + // + // The Realtime and Core reports have different compatibility rules. This + // method checks compatibility for Core reports. + rpc CheckCompatibility(CheckCompatibilityRequest) returns (CheckCompatibilityResponse) { + option (google.api.http) = { + post: "/v1beta/{property=properties/*}:checkCompatibility" + body: "*" + }; + } +} + +// The request for compatibility information for a report's dimensions and +// metrics. Check compatibility provides a preview of the compatibility of a +// report; fields shared with the `runReport` request should be the same values +// as in your `runReport` request. +message CheckCompatibilityRequest { + // A Google Analytics GA4 property identifier whose events are tracked. To + // learn more, see [where to find your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // `property` should be the same value as in your `runReport` request. + // + // Example: properties/1234 + // + // Set the Property ID to 0 for compatibility checking on dimensions and + // metrics common to all properties. In this special mode, this method will + // not return custom dimensions and metrics. + string property = 1; + + // The dimensions in this report. `dimensions` should be the same value as in + // your `runReport` request. + repeated Dimension dimensions = 2; + + // The metrics in this report. `metrics` should be the same value as in your + // `runReport` request. + repeated Metric metrics = 3; + + // The filter clause of dimensions. `dimensionFilter` should be the same value + // as in your `runReport` request. + FilterExpression dimension_filter = 4; + + // The filter clause of metrics. `metricFilter` should be the same value as in + // your `runReport` request + FilterExpression metric_filter = 5; + + // Filters the dimensions and metrics in the response to just this + // compatibility. Commonly used as `”compatibilityFilter”: “COMPATIBLE”` + // to only return compatible dimensions & metrics. + Compatibility compatibility_filter = 6; +} + +// The compatibility response with the compatibility of each dimension & metric. +message CheckCompatibilityResponse { + // The compatibility of each dimension. + repeated DimensionCompatibility dimension_compatibilities = 1; + + // The compatibility of each metric. + repeated MetricCompatibility metric_compatibilities = 2; +} + +// The dimensions and metrics currently accepted in reporting methods. +message Metadata { + option (google.api.resource) = { + type: "analyticsdata.googleapis.com/Metadata" + pattern: "properties/{property}/metadata" + }; + + // Resource name of this metadata. + string name = 3; + + // The dimension descriptions. + repeated DimensionMetadata dimensions = 1; + + // The metric descriptions. + repeated MetricMetadata metrics = 2; +} + +// The request to generate a report. +message RunReportRequest { + // A Google Analytics GA4 property identifier whose events are tracked. + // Specified in the URL path and not the body. To learn more, see [where to + // find your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // Within a batch request, this property should either be unspecified or + // consistent with the batch-level property. + // + // Example: properties/1234 + string property = 1; + + // The dimensions requested and displayed. + repeated Dimension dimensions = 2; + + // The metrics requested and displayed. + repeated Metric metrics = 3; + + // Date ranges of data to read. If multiple date ranges are requested, each + // response row will contain a zero based date range index. If two date + // ranges overlap, the event data for the overlapping days is included in the + // response rows for both date ranges. In a cohort request, this `dateRanges` + // must be unspecified. + repeated DateRange date_ranges = 4; + + // Dimension filters allow you to ask for only specific dimension values in + // the report. To learn more, see [Fundamentals of Dimension + // Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + // for examples. Metrics cannot be used in this filter. + FilterExpression dimension_filter = 5; + + // The filter clause of metrics. Applied after aggregating the report's rows, + // similar to SQL having-clause. Dimensions cannot be used in this filter. + FilterExpression metric_filter = 6; + + // The row count of the start row. The first row is counted as row 0. + // + // When paging, the first request does not specify offset; or equivalently, + // sets offset to 0; the first request returns the first `limit` of rows. The + // second request sets offset to the `limit` of the first request; the second + // request returns the second `limit` of rows. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int64 offset = 7; + + // The number of rows to return. If unspecified, 10,000 rows are returned. The + // API returns a maximum of 100,000 rows per request, no matter how many you + // ask for. `limit` must be positive. + // + // The API can also return fewer rows than the requested `limit`, if there + // aren't as many dimension values as the `limit`. For instance, there are + // fewer than 300 possible values for the dimension `country`, so when + // reporting on only `country`, you can't get more than 300 rows, even if you + // set `limit` to a higher value. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int64 limit = 8; + + // Aggregation of metrics. Aggregated metric values will be shown in rows + // where the dimension_values are set to "RESERVED_(MetricAggregation)". + repeated MetricAggregation metric_aggregations = 9; + + // Specifies how rows are ordered in the response. + repeated OrderBy order_bys = 10; + + // A currency code in ISO4217 format, such as "AED", "USD", "JPY". + // If the field is empty, the report uses the property's default currency. + string currency_code = 11; + + // Cohort group associated with this request. If there is a cohort group + // in the request the 'cohort' dimension must be present. + CohortSpec cohort_spec = 12; + + // If false or unspecified, each row with all metrics equal to 0 will not be + // returned. If true, these rows will be returned if they are not separately + // removed by a filter. + bool keep_empty_rows = 13; + + // Toggles whether to return the current state of this Analytics Property's + // quota. Quota is returned in [PropertyQuota](#PropertyQuota). + bool return_property_quota = 14; +} + +// The response report table corresponding to a request. +message RunReportResponse { + // Describes dimension columns. The number of DimensionHeaders and ordering of + // DimensionHeaders matches the dimensions present in rows. + repeated DimensionHeader dimension_headers = 1; + + // Describes metric columns. The number of MetricHeaders and ordering of + // MetricHeaders matches the metrics present in rows. + repeated MetricHeader metric_headers = 2; + + // Rows of dimension value combinations and metric values in the report. + repeated Row rows = 3; + + // If requested, the totaled values of metrics. + repeated Row totals = 4; + + // If requested, the maximum values of metrics. + repeated Row maximums = 5; + + // If requested, the minimum values of metrics. + repeated Row minimums = 6; + + // The total number of rows in the query result. `rowCount` is independent of + // the number of rows returned in the response, the `limit` request + // parameter, and the `offset` request parameter. For example if a query + // returns 175 rows and includes `limit` of 50 in the API request, the + // response will contain `rowCount` of 175 but only 50 rows. + // + // To learn more about this pagination parameter, see + // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + int32 row_count = 7; + + // Metadata for the report. + ResponseMetaData metadata = 8; + + // This Analytics Property's quota state including this request. + PropertyQuota property_quota = 9; + + // Identifies what kind of resource this message is. This `kind` is always the + // fixed string "analyticsData#runReport". Useful to distinguish between + // response types in JSON. + string kind = 10; +} + +// The request to generate a pivot report. +message RunPivotReportRequest { + // A Google Analytics GA4 property identifier whose events are tracked. + // Specified in the URL path and not the body. To learn more, see [where to + // find your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // Within a batch request, this property should either be unspecified or + // consistent with the batch-level property. + // + // Example: properties/1234 + string property = 1; + + // The dimensions requested. All defined dimensions must be used by one of the + // following: dimension_expression, dimension_filter, pivots, order_bys. + repeated Dimension dimensions = 2; + + // The metrics requested, at least one metric needs to be specified. All + // defined metrics must be used by one of the following: metric_expression, + // metric_filter, order_bys. + repeated Metric metrics = 3; + + // The date range to retrieve event data for the report. If multiple date + // ranges are specified, event data from each date range is used in the + // report. A special dimension with field name "dateRange" can be included in + // a Pivot's field names; if included, the report compares between date + // ranges. In a cohort request, this `dateRanges` must be unspecified. + repeated DateRange date_ranges = 4; + + // Describes the visual format of the report's dimensions in columns or rows. + // The union of the fieldNames (dimension names) in all pivots must be a + // subset of dimension names defined in Dimensions. No two pivots can share a + // dimension. A dimension is only visible if it appears in a pivot. + repeated Pivot pivots = 5; + + // The filter clause of dimensions. Dimensions must be requested to be used in + // this filter. Metrics cannot be used in this filter. + FilterExpression dimension_filter = 6; + + // The filter clause of metrics. Applied at post aggregation phase, similar to + // SQL having-clause. Metrics must be requested to be used in this filter. + // Dimensions cannot be used in this filter. + FilterExpression metric_filter = 7; + + // A currency code in ISO4217 format, such as "AED", "USD", "JPY". + // If the field is empty, the report uses the property's default currency. + string currency_code = 8; + + // Cohort group associated with this request. If there is a cohort group + // in the request the 'cohort' dimension must be present. + CohortSpec cohort_spec = 9; + + // If false or unspecified, each row with all metrics equal to 0 will not be + // returned. If true, these rows will be returned if they are not separately + // removed by a filter. + bool keep_empty_rows = 10; + + // Toggles whether to return the current state of this Analytics Property's + // quota. Quota is returned in [PropertyQuota](#PropertyQuota). + bool return_property_quota = 11; +} + +// The response pivot report table corresponding to a pivot request. +message RunPivotReportResponse { + // Summarizes the columns and rows created by a pivot. Each pivot in the + // request produces one header in the response. If we have a request like + // this: + // + // "pivots": [{ + // "fieldNames": ["country", + // "city"] + // }, + // { + // "fieldNames": "eventName" + // }] + // + // We will have the following `pivotHeaders` in the response: + // + // "pivotHeaders" : [{ + // "dimensionHeaders": [{ + // "dimensionValues": [ + // { "value": "United Kingdom" }, + // { "value": "London" } + // ] + // }, + // { + // "dimensionValues": [ + // { "value": "Japan" }, + // { "value": "Osaka" } + // ] + // }] + // }, + // { + // "dimensionHeaders": [{ + // "dimensionValues": [{ "value": "session_start" }] + // }, + // { + // "dimensionValues": [{ "value": "scroll" }] + // }] + // }] + repeated PivotHeader pivot_headers = 1; + + // Describes dimension columns. The number of DimensionHeaders and ordering of + // DimensionHeaders matches the dimensions present in rows. + repeated DimensionHeader dimension_headers = 2; + + // Describes metric columns. The number of MetricHeaders and ordering of + // MetricHeaders matches the metrics present in rows. + repeated MetricHeader metric_headers = 3; + + // Rows of dimension value combinations and metric values in the report. + repeated Row rows = 4; + + // Aggregation of metric values. Can be totals, minimums, or maximums. The + // returned aggregations are controlled by the metric_aggregations in the + // pivot. The type of aggregation returned in each row is shown by the + // dimension_values which are set to "RESERVED_". + repeated Row aggregates = 5; + + // Metadata for the report. + ResponseMetaData metadata = 6; + + // This Analytics Property's quota state including this request. + PropertyQuota property_quota = 7; + + // Identifies what kind of resource this message is. This `kind` is always the + // fixed string "analyticsData#runPivotReport". Useful to distinguish between + // response types in JSON. + string kind = 8; +} + +// The batch request containing multiple report requests. +message BatchRunReportsRequest { + // A Google Analytics GA4 property identifier whose events are tracked. + // Specified in the URL path and not the body. To learn more, see [where to + // find your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // This property must be specified for the batch. The property within + // RunReportRequest may either be unspecified or consistent with this + // property. + // + // Example: properties/1234 + string property = 1; + + // Individual requests. Each request has a separate report response. Each + // batch request is allowed up to 5 requests. + repeated RunReportRequest requests = 2; +} + +// The batch response containing multiple reports. +message BatchRunReportsResponse { + // Individual responses. Each response has a separate report request. + repeated RunReportResponse reports = 1; + + // Identifies what kind of resource this message is. This `kind` is always the + // fixed string "analyticsData#batchRunReports". Useful to distinguish between + // response types in JSON. + string kind = 2; +} + +// The batch request containing multiple pivot report requests. +message BatchRunPivotReportsRequest { + // A Google Analytics GA4 property identifier whose events are tracked. + // Specified in the URL path and not the body. To learn more, see [where to + // find your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // This property must be specified for the batch. The property within + // RunPivotReportRequest may either be unspecified or consistent with this + // property. + // + // Example: properties/1234 + string property = 1; + + // Individual requests. Each request has a separate pivot report response. + // Each batch request is allowed up to 5 requests. + repeated RunPivotReportRequest requests = 2; +} + +// The batch response containing multiple pivot reports. +message BatchRunPivotReportsResponse { + // Individual responses. Each response has a separate pivot report request. + repeated RunPivotReportResponse pivot_reports = 1; + + // Identifies what kind of resource this message is. This `kind` is always the + // fixed string "analyticsData#batchRunPivotReports". Useful to distinguish + // between response types in JSON. + string kind = 2; +} + +// Request for a property's dimension and metric metadata. +message GetMetadataRequest { + // Required. The resource name of the metadata to retrieve. This name field is + // specified in the URL path and not URL parameters. Property is a numeric + // Google Analytics GA4 Property identifier. To learn more, see [where to find + // your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // + // Example: properties/1234/metadata + // + // Set the Property ID to 0 for dimensions and metrics common to all + // properties. In this special mode, this method will not return custom + // dimensions and metrics. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsdata.googleapis.com/Metadata" + } + ]; +} + +// The request to generate a realtime report. +message RunRealtimeReportRequest { + // A Google Analytics GA4 property identifier whose events are tracked. + // Specified in the URL path and not the body. To learn more, see [where to + // find your Property + // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + // + // Example: properties/1234 + string property = 1; + + // The dimensions requested and displayed. + repeated Dimension dimensions = 2; + + // The metrics requested and displayed. + repeated Metric metrics = 3; + + // The filter clause of dimensions. Metrics cannot be used in this filter. + FilterExpression dimension_filter = 4; + + // The filter clause of metrics. Applied at post aggregation phase, similar to + // SQL having-clause. Dimensions cannot be used in this filter. + FilterExpression metric_filter = 5; + + // The number of rows to return. If unspecified, 10,000 rows are returned. The + // API returns a maximum of 100,000 rows per request, no matter how many you + // ask for. `limit` must be positive. + // + // The API can also return fewer rows than the requested `limit`, if there + // aren't as many dimension values as the `limit`. For instance, there are + // fewer than 300 possible values for the dimension `country`, so when + // reporting on only `country`, you can't get more than 300 rows, even if you + // set `limit` to a higher value. + int64 limit = 6; + + // Aggregation of metrics. Aggregated metric values will be shown in rows + // where the dimension_values are set to "RESERVED_(MetricAggregation)". + repeated MetricAggregation metric_aggregations = 7; + + // Specifies how rows are ordered in the response. + repeated OrderBy order_bys = 8; + + // Toggles whether to return the current state of this Analytics Property's + // Realtime quota. Quota is returned in [PropertyQuota](#PropertyQuota). + bool return_property_quota = 9; + + // The minute ranges of event data to read. If unspecified, one minute range + // for the last 30 minutes will be used. If multiple minute ranges are + // requested, each response row will contain a zero based minute range index. + // If two minute ranges overlap, the event data for the overlapping minutes is + // included in the response rows for both minute ranges. + repeated MinuteRange minute_ranges = 10; +} + +// The response realtime report table corresponding to a request. +message RunRealtimeReportResponse { + // Describes dimension columns. The number of DimensionHeaders and ordering of + // DimensionHeaders matches the dimensions present in rows. + repeated DimensionHeader dimension_headers = 1; + + // Describes metric columns. The number of MetricHeaders and ordering of + // MetricHeaders matches the metrics present in rows. + repeated MetricHeader metric_headers = 2; + + // Rows of dimension value combinations and metric values in the report. + repeated Row rows = 3; + + // If requested, the totaled values of metrics. + repeated Row totals = 4; + + // If requested, the maximum values of metrics. + repeated Row maximums = 5; + + // If requested, the minimum values of metrics. + repeated Row minimums = 6; + + // The total number of rows in the query result. `rowCount` is independent of + // the number of rows returned in the response and the `limit` request + // parameter. For example if a query returns 175 rows and includes `limit` + // of 50 in the API request, the response will contain `rowCount` of 175 but + // only 50 rows. + int32 row_count = 7; + + // This Analytics Property's Realtime quota state including this request. + PropertyQuota property_quota = 8; + + // Identifies what kind of resource this message is. This `kind` is always the + // fixed string "analyticsData#runRealtimeReport". Useful to distinguish + // between response types in JSON. + string kind = 9; +} diff --git a/packages/google-analytics-data/protos/google/analytics/data/v1beta/data.proto b/packages/google-analytics-data/protos/google/analytics/data/v1beta/data.proto new file mode 100644 index 00000000000..6c6431b97fd --- /dev/null +++ b/packages/google-analytics-data/protos/google/analytics/data/v1beta/data.proto @@ -0,0 +1,981 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.analytics.data.v1beta; + +option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1beta;data"; +option java_multiple_files = true; +option java_outer_classname = "ReportingApiProto"; +option java_package = "com.google.analytics.data.v1beta"; + +// A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests +// are allowed up to 4 date ranges. +message DateRange { + // The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot + // be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also + // accepted, and in that case, the date is inferred based on the property's + // reporting time zone. + string start_date = 1; + + // The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot + // be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is + // also accepted, and in that case, the date is inferred based on the + // property's reporting time zone. + string end_date = 2; + + // Assigns a name to this date range. The dimension `dateRange` is valued to + // this name in a report response. If set, cannot begin with `date_range_` or + // `RESERVED_`. If not set, date ranges are named by their zero based index in + // the request: `date_range_0`, `date_range_1`, etc. + string name = 3; +} + +// A contiguous set of minutes: startMinutesAgo, startMinutesAgo + 1, ..., +// endMinutesAgo. Requests are allowed up to 2 minute ranges. +message MinuteRange { + // The inclusive start minute for the query as a number of minutes before now. + // For example, `"startMinutesAgo": 29` specifies the report should include + // event data from 29 minutes ago and after. Cannot be after `endMinutesAgo`. + // + // If unspecified, `startMinutesAgo` is defaulted to 29. Standard Analytics + // properties can request up to the last 30 minutes of event data + // (`startMinutesAgo <= 29`), and 360 Analytics properties can request up to + // the last 60 minutes of event data (`startMinutesAgo <= 59`). + optional int32 start_minutes_ago = 1; + + // The inclusive end minute for the query as a number of minutes before now. + // Cannot be before `startMinutesAgo`. For example, `"endMinutesAgo": 15` + // specifies the report should include event data from prior to 15 minutes + // ago. + // + // If unspecified, `endMinutesAgo` is defaulted to 0. Standard Analytics + // properties can request any minute in the last 30 minutes of event data + // (`endMinutesAgo <= 29`), and 360 Analytics properties can request any + // minute in the last 60 minutes of event data (`endMinutesAgo <= 59`). + optional int32 end_minutes_ago = 2; + + // Assigns a name to this minute range. The dimension `dateRange` is valued to + // this name in a report response. If set, cannot begin with `date_range_` or + // `RESERVED_`. If not set, minute ranges are named by their zero based index + // in the request: `date_range_0`, `date_range_1`, etc. + string name = 3; +} + +// Dimensions are attributes of your data. For example, the dimension city +// indicates the city from which an event originates. Dimension values in report +// responses are strings; for example, the city could be "Paris" or "New York". +// Requests are allowed up to 9 dimensions. +message Dimension { + // The name of the dimension. See the [API + // Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) + // for the list of dimension names. + // + // If `dimensionExpression` is specified, `name` can be any string that you + // would like within the allowed character set. For example if a + // `dimensionExpression` concatenates `country` and `city`, you could call + // that dimension `countryAndCity`. Dimension names that you choose must match + // the regular expression `^[a-zA-Z0-9_]$`. + // + // Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, + // `dimensionExpression`, and `pivots`. + string name = 1; + + // One dimension can be the result of an expression of multiple dimensions. + // For example, dimension "country, city": concatenate(country, ", ", city). + DimensionExpression dimension_expression = 2; +} + +// Used to express a dimension which is the result of a formula of multiple +// dimensions. Example usages: +// 1) lower_case(dimension) +// 2) concatenate(dimension1, symbol, dimension2). +message DimensionExpression { + // Used to convert a dimension value to a single case. + message CaseExpression { + // Name of a dimension. The name must refer back to a name in dimensions + // field of the request. + string dimension_name = 1; + } + + // Used to combine dimension values to a single dimension. + message ConcatenateExpression { + // Names of dimensions. The names must refer back to names in the dimensions + // field of the request. + repeated string dimension_names = 1; + + // The delimiter placed between dimension names. + // + // Delimiters are often single characters such as "|" or "," but can be + // longer strings. If a dimension value contains the delimiter, both will be + // present in response with no distinction. For example if dimension 1 value + // = "US,FR", dimension 2 value = "JP", and delimiter = ",", then the + // response will contain "US,FR,JP". + string delimiter = 2; + } + + // Specify one type of dimension expression for `DimensionExpression`. + oneof one_expression { + // Used to convert a dimension value to lower case. + CaseExpression lower_case = 4; + + // Used to convert a dimension value to upper case. + CaseExpression upper_case = 5; + + // Used to combine dimension values to a single dimension. + // For example, dimension "country, city": concatenate(country, ", ", city). + ConcatenateExpression concatenate = 6; + } +} + +// The quantitative measurements of a report. For example, the metric +// `eventCount` is the total number of events. Requests are allowed up to 10 +// metrics. +message Metric { + // The name of the metric. See the [API + // Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) + // for the list of metric names. + // + // If `expression` is specified, `name` can be any string that you would like + // within the allowed character set. For example if `expression` is + // `screenPageViews/sessions`, you could call that metric's name = + // `viewsPerSession`. Metric names that you choose must match the regular + // expression `^[a-zA-Z0-9_]$`. + // + // Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric + // `expression`. + string name = 1; + + // A mathematical expression for derived metrics. For example, the metric + // Event count per user is `eventCount/totalUsers`. + string expression = 2; + + // Indicates if a metric is invisible in the report response. If a metric is + // invisible, the metric will not produce a column in the response, but can be + // used in `metricFilter`, `orderBys`, or a metric `expression`. + bool invisible = 3; +} + +// To express dimension or metric filters. The fields in the same +// FilterExpression need to be either all dimensions or all metrics. +message FilterExpression { + // Specify one type of filter expression for `FilterExpression`. + oneof expr { + // The FilterExpressions in and_group have an AND relationship. + FilterExpressionList and_group = 1; + + // The FilterExpressions in or_group have an OR relationship. + FilterExpressionList or_group = 2; + + // The FilterExpression is NOT of not_expression. + FilterExpression not_expression = 3; + + // A primitive filter. In the same FilterExpression, all of the filter's + // field names need to be either all dimensions or all metrics. + Filter filter = 4; + } +} + +// A list of filter expressions. +message FilterExpressionList { + // A list of filter expressions. + repeated FilterExpression expressions = 1; +} + +// An expression to filter dimension or metric values. +message Filter { + // The filter for string + message StringFilter { + // The match type of a string filter + enum MatchType { + // Unspecified + MATCH_TYPE_UNSPECIFIED = 0; + + // Exact match of the string value. + EXACT = 1; + + // Begins with the string value. + BEGINS_WITH = 2; + + // Ends with the string value. + ENDS_WITH = 3; + + // Contains the string value. + CONTAINS = 4; + + // Full match for the regular expression with the string value. + FULL_REGEXP = 5; + + // Partial match for the regular expression with the string value. + PARTIAL_REGEXP = 6; + } + + // The match type for this filter. + MatchType match_type = 1; + + // The string value used for the matching. + string value = 2; + + // If true, the string value is case sensitive. + bool case_sensitive = 3; + } + + // The result needs to be in a list of string values. + message InListFilter { + // The list of string values. + // Must be non-empty. + repeated string values = 1; + + // If true, the string value is case sensitive. + bool case_sensitive = 2; + } + + // Filters for numeric or date values. + message NumericFilter { + // The operation applied to a numeric filter + enum Operation { + // Unspecified. + OPERATION_UNSPECIFIED = 0; + + // Equal + EQUAL = 1; + + // Less than + LESS_THAN = 2; + + // Less than or equal + LESS_THAN_OR_EQUAL = 3; + + // Greater than + GREATER_THAN = 4; + + // Greater than or equal + GREATER_THAN_OR_EQUAL = 5; + } + + // The operation type for this filter. + Operation operation = 1; + + // A numeric value or a date value. + NumericValue value = 2; + } + + // To express that the result needs to be between two numbers (inclusive). + message BetweenFilter { + // Begins with this number. + NumericValue from_value = 1; + + // Ends with this number. + NumericValue to_value = 2; + } + + // The dimension name or metric name. + // + // In most methods, dimensions & metrics can be used for the first time in + // this field. However in a RunPivotReportRequest, this field must be + // additionally specified by name in the RunPivotReportRequest's dimensions or + // metrics. + string field_name = 1; + + // Specify one type of filter for `Filter`. + oneof one_filter { + // Strings related filter. + StringFilter string_filter = 3; + + // A filter for in list values. + InListFilter in_list_filter = 4; + + // A filter for numeric or date values. + NumericFilter numeric_filter = 5; + + // A filter for two values. + BetweenFilter between_filter = 6; + } +} + +// Order bys define how rows will be sorted in the response. For example, +// ordering rows by descending event count is one ordering, and ordering rows by +// the event name string is a different ordering. +message OrderBy { + // Sorts by metric values. + message MetricOrderBy { + // A metric name in the request to order by. + string metric_name = 1; + } + + // Sorts by dimension values. + message DimensionOrderBy { + // Rule to order the string dimension values by. + enum OrderType { + // Unspecified. + ORDER_TYPE_UNSPECIFIED = 0; + + // Alphanumeric sort by Unicode code point. For example, "2" < "A" < "X" < + // "b" < "z". + ALPHANUMERIC = 1; + + // Case insensitive alphanumeric sort by lower case Unicode code point. + // For example, "2" < "A" < "b" < "X" < "z". + CASE_INSENSITIVE_ALPHANUMERIC = 2; + + // Dimension values are converted to numbers before sorting. For example + // in NUMERIC sort, "25" < "100", and in `ALPHANUMERIC` sort, "100" < + // "25". Non-numeric dimension values all have equal ordering value below + // all numeric values. + NUMERIC = 3; + } + + // A dimension name in the request to order by. + string dimension_name = 1; + + // Controls the rule for dimension value ordering. + OrderType order_type = 2; + } + + // Sorts by a pivot column group. + message PivotOrderBy { + // A pair of dimension names and values. Rows with this dimension pivot pair + // are ordered by the metric's value. + // + // For example if pivots = {{"browser", "Chrome"}} and + // metric_name = "Sessions", + // then the rows will be sorted based on Sessions in Chrome. + // + // ---------|----------|----------------|----------|---------------- + // | Chrome | Chrome | Safari | Safari + // ---------|----------|----------------|----------|---------------- + // Country | Sessions | Pages/Sessions | Sessions | Pages/Sessions + // ---------|----------|----------------|----------|---------------- + // US | 2 | 2 | 3 | 1 + // ---------|----------|----------------|----------|---------------- + // Canada | 3 | 1 | 4 | 1 + // ---------|----------|----------------|----------|---------------- + message PivotSelection { + // Must be a dimension name from the request. + string dimension_name = 1; + + // Order by only when the named dimension is this value. + string dimension_value = 2; + } + + // In the response to order by, order rows by this column. Must be a metric + // name from the request. + string metric_name = 1; + + // Used to select a dimension name and value pivot. If multiple pivot + // selections are given, the sort occurs on rows where all pivot selection + // dimension name and value pairs match the row's dimension name and value + // pair. + repeated PivotSelection pivot_selections = 2; + } + + // Specify one type of order by for `OrderBy`. + oneof one_order_by { + // Sorts results by a metric's values. + MetricOrderBy metric = 1; + + // Sorts results by a dimension's values. + DimensionOrderBy dimension = 2; + + // Sorts results by a metric's values within a pivot column group. + PivotOrderBy pivot = 3; + } + + // If true, sorts by descending order. + bool desc = 4; +} + +// Describes the visible dimension columns and rows in the report response. +message Pivot { + // Dimension names for visible columns in the report response. Including + // "dateRange" produces a date range column; for each row in the response, + // dimension values in the date range column will indicate the corresponding + // date range from the request. + repeated string field_names = 1; + + // Specifies how dimensions are ordered in the pivot. In the first Pivot, the + // OrderBys determine Row and PivotDimensionHeader ordering; in subsequent + // Pivots, the OrderBys determine only PivotDimensionHeader ordering. + // Dimensions specified in these OrderBys must be a subset of + // Pivot.field_names. + repeated OrderBy order_bys = 2; + + // The row count of the start row. The first row is counted as row 0. + int64 offset = 3; + + // The number of unique combinations of dimension values to return in this + // pivot. The `limit` parameter is required. A `limit` of 10,000 is common for + // single pivot requests. + // + // The product of the `limit` for each `pivot` in a `RunPivotReportRequest` + // must not exceed 100,000. For example, a two pivot request with `limit: + // 1000` in each pivot will fail because the product is `1,000,000`. + int64 limit = 4; + + // Aggregate the metrics by dimensions in this pivot using the specified + // metric_aggregations. + repeated MetricAggregation metric_aggregations = 5; +} + +// The specification of cohorts for a cohort report. +// +// Cohort reports create a time series of user retention for the cohort. For +// example, you could select the cohort of users that were acquired in the first +// week of September and follow that cohort for the next six weeks. Selecting +// the users acquired in the first week of September cohort is specified in the +// `cohort` object. Following that cohort for the next six weeks is specified in +// the `cohortsRange` object. +// +// For examples, see [Cohort Report +// Examples](https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#cohort_report_examples). +// +// The report response could show a weekly time series where say your app has +// retained 60% of this cohort after three weeks and 25% of this cohort after +// six weeks. These two percentages can be calculated by the metric +// `cohortActiveUsers/cohortTotalUsers` and will be separate rows in the report. +message CohortSpec { + // Defines the selection criteria to group users into cohorts. + // + // Most cohort reports define only a single cohort. If multiple cohorts are + // specified, each cohort can be recognized in the report by their name. + repeated Cohort cohorts = 1; + + // Cohort reports follow cohorts over an extended reporting date range. This + // range specifies an offset duration to follow the cohorts over. + CohortsRange cohorts_range = 2; + + // Optional settings for a cohort report. + CohortReportSettings cohort_report_settings = 3; +} + +// Defines a cohort selection criteria. A cohort is a group of users who share +// a common characteristic. For example, users with the same `firstSessionDate` +// belong to the same cohort. +message Cohort { + // Assigns a name to this cohort. The dimension `cohort` is valued to this + // name in a report response. If set, cannot begin with `cohort_` or + // `RESERVED_`. If not set, cohorts are named by their zero based index + // `cohort_0`, `cohort_1`, etc. + string name = 1; + + // Dimension used by the cohort. Required and only supports + // `firstSessionDate`. + string dimension = 2; + + // The cohort selects users whose first touch date is between start date and + // end date defined in the `dateRange`. This `dateRange` does not specify the + // full date range of event data that is present in a cohort report. In a + // cohort report, this `dateRange` is extended by the granularity and offset + // present in the `cohortsRange`; event data for the extended reporting date + // range is present in a cohort report. + // + // In a cohort request, this `dateRange` is required and the `dateRanges` in + // the `RunReportRequest` or `RunPivotReportRequest` must be unspecified. + // + // This `dateRange` should generally be aligned with the cohort's granularity. + // If `CohortsRange` uses daily granularity, this `dateRange` can be a single + // day. If `CohortsRange` uses weekly granularity, this `dateRange` can be + // aligned to a week boundary, starting at Sunday and ending Saturday. If + // `CohortsRange` uses monthly granularity, this `dateRange` can be aligned to + // a month, starting at the first and ending on the last day of the month. + DateRange date_range = 3; +} + +// Configures the extended reporting date range for a cohort report. Specifies +// an offset duration to follow the cohorts over. +message CohortsRange { + // The granularity used to interpret the `startOffset` and `endOffset` for the + // extended reporting date range for a cohort report. + enum Granularity { + // Should never be specified. + GRANULARITY_UNSPECIFIED = 0; + + // Daily granularity. Commonly used if the cohort's `dateRange` is a single + // day and the request contains `cohortNthDay`. + DAILY = 1; + + // Weekly granularity. Commonly used if the cohort's `dateRange` is a week + // in duration (starting on Sunday and ending on Saturday) and the request + // contains `cohortNthWeek`. + WEEKLY = 2; + + // Monthly granularity. Commonly used if the cohort's `dateRange` is a month + // in duration and the request contains `cohortNthMonth`. + MONTHLY = 3; + } + + // Required. The granularity used to interpret the `startOffset` and + // `endOffset` for the extended reporting date range for a cohort report. + Granularity granularity = 1; + + // `startOffset` specifies the start date of the extended reporting date range + // for a cohort report. `startOffset` is commonly set to 0 so that reports + // contain data from the acquisition of the cohort forward. + // + // If `granularity` is `DAILY`, the `startDate` of the extended reporting date + // range is `startDate` of the cohort plus `startOffset` days. + // + // If `granularity` is `WEEKLY`, the `startDate` of the extended reporting + // date range is `startDate` of the cohort plus `startOffset * 7` days. + // + // If `granularity` is `MONTHLY`, the `startDate` of the extended reporting + // date range is `startDate` of the cohort plus `startOffset * 30` days. + int32 start_offset = 2; + + // Required. `endOffset` specifies the end date of the extended reporting date + // range for a cohort report. `endOffset` can be any positive integer but is + // commonly set to 5 to 10 so that reports contain data on the cohort for the + // next several granularity time periods. + // + // If `granularity` is `DAILY`, the `endDate` of the extended reporting date + // range is `endDate` of the cohort plus `endOffset` days. + // + // If `granularity` is `WEEKLY`, the `endDate` of the extended reporting date + // range is `endDate` of the cohort plus `endOffset * 7` days. + // + // If `granularity` is `MONTHLY`, the `endDate` of the extended reporting date + // range is `endDate` of the cohort plus `endOffset * 30` days. + int32 end_offset = 3; +} + +// Optional settings of a cohort report. +message CohortReportSettings { + // If true, accumulates the result from first touch day to the end day. Not + // supported in `RunReportRequest`. + bool accumulate = 1; +} + +// Response's metadata carrying additional information about the report content. +message ResponseMetaData { + // The schema restrictions actively enforced in creating this report. To learn + // more, see [Access and data-restriction + // management](https://support.google.com/analytics/answer/10851388). + message SchemaRestrictionResponse { + // A metric actively restricted in creating the report. + message ActiveMetricRestriction { + // The name of the restricted metric. + optional string metric_name = 1; + + // The reason for this metric's restriction. + repeated RestrictedMetricType restricted_metric_types = 2; + } + + // All restrictions actively enforced in creating the report. For example, + // `purchaseRevenue` always has the restriction type `REVENUE_DATA`. + // However, this active response restriction is only populated if the user's + // custom role disallows access to `REVENUE_DATA`. + repeated ActiveMetricRestriction active_metric_restrictions = 1; + } + + // If true, indicates some buckets of dimension combinations are rolled into + // "(other)" row. This can happen for high cardinality reports. + bool data_loss_from_other_row = 3; + + // Describes the schema restrictions actively enforced in creating this + // report. To learn more, see [Access and data-restriction + // management](https://support.google.com/analytics/answer/10851388). + optional SchemaRestrictionResponse schema_restriction_response = 4; + + // The currency code used in this report. Intended to be used in formatting + // currency metrics like `purchaseRevenue` for visualization. If currency_code + // was specified in the request, this response parameter will echo the request + // parameter; otherwise, this response parameter is the property's current + // currency_code. + // + // Currency codes are string encodings of currency types from the ISO 4217 + // standard (https://en.wikipedia.org/wiki/ISO_4217); for example "USD", + // "EUR", "JPY". To learn more, see + // https://support.google.com/analytics/answer/9796179. + optional string currency_code = 5; + + // The property's current timezone. Intended to be used to interpret + // time-based dimensions like `hour` and `minute`. Formatted as strings from + // the IANA Time Zone database (https://www.iana.org/time-zones); for example + // "America/New_York" or "Asia/Tokyo". + optional string time_zone = 6; + + // If empty reason is specified, the report is empty for this reason. + optional string empty_reason = 7; + + // If `subjectToThresholding` is true, this report is subject to thresholding + // and only returns data that meets the minimum aggregation thresholds. It is + // possible for a request to be subject to thresholding thresholding and no + // data is absent from the report, and this happens when all data is above the + // thresholds. To learn more, see [Data + // thresholds](https://support.google.com/analytics/answer/9383630) and [About + // Demographics and + // Interests](https://support.google.com/analytics/answer/2799357). + optional bool subject_to_thresholding = 8; +} + +// Describes a dimension column in the report. Dimensions requested in a report +// produce column entries within rows and DimensionHeaders. However, dimensions +// used exclusively within filters or expressions do not produce columns in a +// report; correspondingly, those dimensions do not produce headers. +message DimensionHeader { + // The dimension's name. + string name = 1; +} + +// Describes a metric column in the report. Visible metrics requested in a +// report produce column entries within rows and MetricHeaders. However, +// metrics used exclusively within filters or expressions do not produce columns +// in a report; correspondingly, those metrics do not produce headers. +message MetricHeader { + // The metric's name. + string name = 1; + + // The metric's data type. + MetricType type = 2; +} + +// Dimensions' values in a single pivot. +message PivotHeader { + // The size is the same as the cardinality of the corresponding dimension + // combinations. + repeated PivotDimensionHeader pivot_dimension_headers = 1; + + // The cardinality of the pivot. The total number of rows for this pivot's + // fields regardless of how the parameters `offset` and `limit` are specified + // in the request. + int32 row_count = 2; +} + +// Summarizes dimension values from a row for this pivot. +message PivotDimensionHeader { + // Values of multiple dimensions in a pivot. + repeated DimensionValue dimension_values = 1; +} + +// Report data for each row. +// For example if RunReportRequest contains: +// +// ```none +// "dimensions": [ +// { +// "name": "eventName" +// }, +// { +// "name": "countryId" +// } +// ], +// "metrics": [ +// { +// "name": "eventCount" +// } +// ] +// ``` +// +// One row with 'in_app_purchase' as the eventName, 'JP' as the countryId, and +// 15 as the eventCount, would be: +// +// ```none +// "dimensionValues": [ +// { +// "value": "in_app_purchase" +// }, +// { +// "value": "JP" +// } +// ], +// "metricValues": [ +// { +// "value": "15" +// } +// ] +// ``` +message Row { + // List of requested dimension values. In a PivotReport, dimension_values + // are only listed for dimensions included in a pivot. + repeated DimensionValue dimension_values = 1; + + // List of requested visible metric values. + repeated MetricValue metric_values = 2; +} + +// The value of a dimension. +message DimensionValue { + // One kind of dimension value + oneof one_value { + // Value as a string if the dimension type is a string. + string value = 1; + } +} + +// The value of a metric. +message MetricValue { + // One of metric value + oneof one_value { + // Measurement value. See MetricHeader for type. + string value = 4; + } +} + +// To represent a number. +message NumericValue { + // One of a numeric value + oneof one_value { + // Integer value + int64 int64_value = 1; + + // Double value + double double_value = 2; + } +} + +// Current state of all quotas for this Analytics Property. If any quota for a +// property is exhausted, all requests to that property will return Resource +// Exhausted errors. +message PropertyQuota { + // Standard Analytics Properties can use up to 25,000 tokens per day; + // Analytics 360 Properties can use 250,000 tokens per day. Most requests + // consume fewer than 10 tokens. + QuotaStatus tokens_per_day = 1; + + // Standard Analytics Properties can use up to 5,000 tokens per hour; + // Analytics 360 Properties can use 50,000 tokens per hour. An API request + // consumes a single number of tokens, and that number is deducted from all of + // the hourly, daily, and per project hourly quotas. + QuotaStatus tokens_per_hour = 2; + + // Standard Analytics Properties can send up to 10 concurrent requests; + // Analytics 360 Properties can use up to 50 concurrent requests. + QuotaStatus concurrent_requests = 3; + + // Standard Analytics Properties and cloud project pairs can have up to 10 + // server errors per hour; Analytics 360 Properties and cloud project pairs + // can have up to 50 server errors per hour. + QuotaStatus server_errors_per_project_per_hour = 4; + + // Analytics Properties can send up to 120 requests with potentially + // thresholded dimensions per hour. In a batch request, each report request + // is individually counted for this quota if the request contains potentially + // thresholded dimensions. + QuotaStatus potentially_thresholded_requests_per_hour = 5; + + // Analytics Properties can use up to 25% of their tokens per project per + // hour. This amounts to standard Analytics Properties can use up to 1,250 + // tokens per project per hour, and 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. + QuotaStatus tokens_per_project_per_hour = 6; +} + +// Current state for a particular quota group. +message QuotaStatus { + // Quota consumed by this request. + int32 consumed = 1; + + // Quota remaining after this request. + int32 remaining = 2; +} + +// Explains a dimension. +message DimensionMetadata { + // This dimension's name. Useable in [Dimension](#Dimension)'s `name`. For + // example, `eventName`. + string api_name = 1; + + // This dimension's name within the Google Analytics user interface. For + // example, `Event name`. + string ui_name = 2; + + // Description of how this dimension is used and calculated. + string description = 3; + + // Still usable but deprecated names for this dimension. If populated, this + // dimension is available by either `apiName` or one of `deprecatedApiNames` + // for a period of time. After the deprecation period, the dimension will be + // available only by `apiName`. + repeated string deprecated_api_names = 4; + + // True if the dimension is a custom dimension for this property. + bool custom_definition = 5; + + // The display name of the category that this dimension belongs to. Similar + // dimensions and metrics are categorized together. + string category = 7; +} + +// Explains a metric. +message MetricMetadata { + // Justifications for why this metric is blocked. + enum BlockedReason { + // Will never be specified in API response. + BLOCKED_REASON_UNSPECIFIED = 0; + + // If present, your access is blocked to revenue related metrics for this + // property, and this metric is revenue related. + NO_REVENUE_METRICS = 1; + + // If present, your access is blocked to cost related metrics for this + // property, and this metric is cost related. + NO_COST_METRICS = 2; + } + + // A metric name. Useable in [Metric](#Metric)'s `name`. For example, + // `eventCount`. + string api_name = 1; + + // This metric's name within the Google Analytics user interface. For example, + // `Event count`. + string ui_name = 2; + + // Description of how this metric is used and calculated. + string description = 3; + + // Still usable but deprecated names for this metric. If populated, this + // metric is available by either `apiName` or one of `deprecatedApiNames` + // for a period of time. After the deprecation period, the metric will be + // available only by `apiName`. + repeated string deprecated_api_names = 4; + + // The type of this metric. + MetricType type = 5; + + // The mathematical expression for this derived metric. Can be used in + // [Metric](#Metric)'s `expression` field for equivalent reports. Most metrics + // are not expressions, and for non-expressions, this field is empty. + string expression = 6; + + // True if the metric is a custom metric for this property. + bool custom_definition = 7; + + // If reasons are specified, your access is blocked to this metric for this + // property. API requests from you to this property for this metric will + // succeed; however, the report will contain only zeros for this metric. API + // requests with metric filters on blocked metrics will fail. If reasons are + // empty, you have access to this metric. + // + // To learn more, see [Access and data-restriction + // management](https://support.google.com/analytics/answer/10851388). + repeated BlockedReason blocked_reasons = 8; + + // The display name of the category that this metrics belongs to. Similar + // dimensions and metrics are categorized together. + string category = 10; +} + +// The compatibility for a single dimension. +message DimensionCompatibility { + // The dimension metadata contains the API name for this compatibility + // information. The dimension metadata also contains other helpful information + // like the UI name and description. + optional DimensionMetadata dimension_metadata = 1; + + // The compatibility of this dimension. If the compatibility is COMPATIBLE, + // this dimension can be successfully added to the report. + optional Compatibility compatibility = 2; +} + +// The compatibility for a single metric. +message MetricCompatibility { + // The metric metadata contains the API name for this compatibility + // information. The metric metadata also contains other helpful information + // like the UI name and description. + optional MetricMetadata metric_metadata = 1; + + // The compatibility of this metric. If the compatibility is COMPATIBLE, + // this metric can be successfully added to the report. + optional Compatibility compatibility = 2; +} + +// Represents aggregation of metrics. +enum MetricAggregation { + // Unspecified operator. + METRIC_AGGREGATION_UNSPECIFIED = 0; + + // SUM operator. + TOTAL = 1; + + // Minimum operator. + MINIMUM = 5; + + // Maximum operator. + MAXIMUM = 6; + + // Count operator. + COUNT = 4; +} + +// A metric's value type. +enum MetricType { + // Unspecified type. + METRIC_TYPE_UNSPECIFIED = 0; + + // Integer type. + TYPE_INTEGER = 1; + + // Floating point type. + TYPE_FLOAT = 2; + + // A duration of seconds; a special floating point type. + TYPE_SECONDS = 4; + + // A duration in milliseconds; a special floating point type. + TYPE_MILLISECONDS = 5; + + // A duration in minutes; a special floating point type. + TYPE_MINUTES = 6; + + // A duration in hours; a special floating point type. + TYPE_HOURS = 7; + + // A custom metric of standard type; a special floating point type. + TYPE_STANDARD = 8; + + // An amount of money; a special floating point type. + TYPE_CURRENCY = 9; + + // A length in feet; a special floating point type. + TYPE_FEET = 10; + + // A length in miles; a special floating point type. + TYPE_MILES = 11; + + // A length in meters; a special floating point type. + TYPE_METERS = 12; + + // A length in kilometers; a special floating point type. + TYPE_KILOMETERS = 13; +} + +// Categories of data that you may be restricted from viewing on certain GA4 +// properties. +enum RestrictedMetricType { + // Unspecified type. + RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0; + + // Cost metrics such as `adCost`. + COST_DATA = 1; + + // Revenue metrics such as `purchaseRevenue`. + REVENUE_DATA = 2; +} + +// The compatibility types for a single dimension or metric. +enum Compatibility { + // Unspecified compatibility. + COMPATIBILITY_UNSPECIFIED = 0; + + // The dimension or metric is compatible. This dimension or metric can be + // successfully added to a report. + COMPATIBLE = 1; + + // The dimension or metric is incompatible. This dimension or metric cannot be + // successfully added to a report. + INCOMPATIBLE = 2; +} diff --git a/packages/google-analytics-data/protos/protos.d.ts b/packages/google-analytics-data/protos/protos.d.ts new file mode 100644 index 00000000000..a6d9d089ba9 --- /dev/null +++ b/packages/google-analytics-data/protos/protos.d.ts @@ -0,0 +1,17262 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @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.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @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.protobuf.Duration; + + /** + * Verifies a Duration 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 Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @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.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @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.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet 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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @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.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @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.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @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.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @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.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @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.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @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.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange 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 ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @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.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @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.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange 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 ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @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.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @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.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions 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 ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @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.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @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.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto 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 FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @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.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @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.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto 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 OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @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.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @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.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto 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 EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @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.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @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.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange 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 EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @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.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @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.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto 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 EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @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.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @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.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto 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 ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @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.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @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.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @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.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @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.protobuf.FileOptions; + + /** + * Verifies a FileOptions 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 FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @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.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @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.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions 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 MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @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.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @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.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions 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 FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @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.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @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.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions 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 OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @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.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @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.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions 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 EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @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.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @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.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions 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 EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @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.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @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.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions 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 ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @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.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @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.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions 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 MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @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.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @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.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption 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 UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @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.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @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.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart 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 NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @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.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @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.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @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.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @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.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location 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 Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo 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 GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @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.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @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.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation 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 Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + } + + /** Namespace analytics. */ + namespace analytics { + + /** Namespace data. */ + namespace data { + + /** Namespace v1alpha. */ + namespace v1alpha { + + /** Represents an AlphaAnalyticsData */ + class AlphaAnalyticsData extends $protobuf.rpc.Service { + + /** + * Constructs a new AlphaAnalyticsData service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new AlphaAnalyticsData service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AlphaAnalyticsData; + + /** + * Calls RunFunnelReport. + * @param request RunFunnelReportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RunFunnelReportResponse + */ + public runFunnelReport(request: google.analytics.data.v1alpha.IRunFunnelReportRequest, callback: google.analytics.data.v1alpha.AlphaAnalyticsData.RunFunnelReportCallback): void; + + /** + * Calls RunFunnelReport. + * @param request RunFunnelReportRequest message or plain object + * @returns Promise + */ + public runFunnelReport(request: google.analytics.data.v1alpha.IRunFunnelReportRequest): Promise; + } + + namespace AlphaAnalyticsData { + + /** + * Callback as used by {@link google.analytics.data.v1alpha.AlphaAnalyticsData|runFunnelReport}. + * @param error Error, if any + * @param [response] RunFunnelReportResponse + */ + type RunFunnelReportCallback = (error: (Error|null), response?: google.analytics.data.v1alpha.RunFunnelReportResponse) => void; + } + + /** Properties of a RunFunnelReportRequest. */ + interface IRunFunnelReportRequest { + + /** RunFunnelReportRequest property */ + property?: (string|null); + + /** RunFunnelReportRequest dateRanges */ + dateRanges?: (google.analytics.data.v1alpha.IDateRange[]|null); + + /** RunFunnelReportRequest funnel */ + funnel?: (google.analytics.data.v1alpha.IFunnel|null); + + /** RunFunnelReportRequest funnelBreakdown */ + funnelBreakdown?: (google.analytics.data.v1alpha.IFunnelBreakdown|null); + + /** RunFunnelReportRequest funnelNextAction */ + funnelNextAction?: (google.analytics.data.v1alpha.IFunnelNextAction|null); + + /** RunFunnelReportRequest funnelVisualizationType */ + funnelVisualizationType?: (google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType|keyof typeof google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType|null); + + /** RunFunnelReportRequest segments */ + segments?: (google.analytics.data.v1alpha.ISegment[]|null); + + /** RunFunnelReportRequest limit */ + limit?: (number|Long|string|null); + + /** RunFunnelReportRequest dimensionFilter */ + dimensionFilter?: (google.analytics.data.v1alpha.IFilterExpression|null); + + /** RunFunnelReportRequest returnPropertyQuota */ + returnPropertyQuota?: (boolean|null); + } + + /** Represents a RunFunnelReportRequest. */ + class RunFunnelReportRequest implements IRunFunnelReportRequest { + + /** + * Constructs a new RunFunnelReportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IRunFunnelReportRequest); + + /** RunFunnelReportRequest property. */ + public property: string; + + /** RunFunnelReportRequest dateRanges. */ + public dateRanges: google.analytics.data.v1alpha.IDateRange[]; + + /** RunFunnelReportRequest funnel. */ + public funnel?: (google.analytics.data.v1alpha.IFunnel|null); + + /** RunFunnelReportRequest funnelBreakdown. */ + public funnelBreakdown?: (google.analytics.data.v1alpha.IFunnelBreakdown|null); + + /** RunFunnelReportRequest funnelNextAction. */ + public funnelNextAction?: (google.analytics.data.v1alpha.IFunnelNextAction|null); + + /** RunFunnelReportRequest funnelVisualizationType. */ + public funnelVisualizationType: (google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType|keyof typeof google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType); + + /** RunFunnelReportRequest segments. */ + public segments: google.analytics.data.v1alpha.ISegment[]; + + /** RunFunnelReportRequest limit. */ + public limit: (number|Long|string); + + /** RunFunnelReportRequest dimensionFilter. */ + public dimensionFilter?: (google.analytics.data.v1alpha.IFilterExpression|null); + + /** RunFunnelReportRequest returnPropertyQuota. */ + public returnPropertyQuota: boolean; + + /** + * Creates a new RunFunnelReportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunFunnelReportRequest instance + */ + public static create(properties?: google.analytics.data.v1alpha.IRunFunnelReportRequest): google.analytics.data.v1alpha.RunFunnelReportRequest; + + /** + * Encodes the specified RunFunnelReportRequest message. Does not implicitly {@link google.analytics.data.v1alpha.RunFunnelReportRequest.verify|verify} messages. + * @param message RunFunnelReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IRunFunnelReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunFunnelReportRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.RunFunnelReportRequest.verify|verify} messages. + * @param message RunFunnelReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IRunFunnelReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunFunnelReportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunFunnelReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.RunFunnelReportRequest; + + /** + * Decodes a RunFunnelReportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunFunnelReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.RunFunnelReportRequest; + + /** + * Verifies a RunFunnelReportRequest 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 RunFunnelReportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunFunnelReportRequest + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.RunFunnelReportRequest; + + /** + * Creates a plain object from a RunFunnelReportRequest message. Also converts values to other types if specified. + * @param message RunFunnelReportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.RunFunnelReportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunFunnelReportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunFunnelReportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RunFunnelReportRequest { + + /** FunnelVisualizationType enum. */ + enum FunnelVisualizationType { + FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED = 0, + STANDARD_FUNNEL = 1, + TRENDED_FUNNEL = 2 + } + } + + /** Properties of a RunFunnelReportResponse. */ + interface IRunFunnelReportResponse { + + /** RunFunnelReportResponse funnelTable */ + funnelTable?: (google.analytics.data.v1alpha.IFunnelSubReport|null); + + /** RunFunnelReportResponse funnelVisualization */ + funnelVisualization?: (google.analytics.data.v1alpha.IFunnelSubReport|null); + + /** RunFunnelReportResponse propertyQuota */ + propertyQuota?: (google.analytics.data.v1alpha.IPropertyQuota|null); + + /** RunFunnelReportResponse kind */ + kind?: (string|null); + } + + /** Represents a RunFunnelReportResponse. */ + class RunFunnelReportResponse implements IRunFunnelReportResponse { + + /** + * Constructs a new RunFunnelReportResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IRunFunnelReportResponse); + + /** RunFunnelReportResponse funnelTable. */ + public funnelTable?: (google.analytics.data.v1alpha.IFunnelSubReport|null); + + /** RunFunnelReportResponse funnelVisualization. */ + public funnelVisualization?: (google.analytics.data.v1alpha.IFunnelSubReport|null); + + /** RunFunnelReportResponse propertyQuota. */ + public propertyQuota?: (google.analytics.data.v1alpha.IPropertyQuota|null); + + /** RunFunnelReportResponse kind. */ + public kind: string; + + /** + * Creates a new RunFunnelReportResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunFunnelReportResponse instance + */ + public static create(properties?: google.analytics.data.v1alpha.IRunFunnelReportResponse): google.analytics.data.v1alpha.RunFunnelReportResponse; + + /** + * Encodes the specified RunFunnelReportResponse message. Does not implicitly {@link google.analytics.data.v1alpha.RunFunnelReportResponse.verify|verify} messages. + * @param message RunFunnelReportResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IRunFunnelReportResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunFunnelReportResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.RunFunnelReportResponse.verify|verify} messages. + * @param message RunFunnelReportResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IRunFunnelReportResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunFunnelReportResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunFunnelReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.RunFunnelReportResponse; + + /** + * Decodes a RunFunnelReportResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunFunnelReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.RunFunnelReportResponse; + + /** + * Verifies a RunFunnelReportResponse 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 RunFunnelReportResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunFunnelReportResponse + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.RunFunnelReportResponse; + + /** + * Creates a plain object from a RunFunnelReportResponse message. Also converts values to other types if specified. + * @param message RunFunnelReportResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.RunFunnelReportResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunFunnelReportResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunFunnelReportResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DateRange. */ + interface IDateRange { + + /** DateRange startDate */ + startDate?: (string|null); + + /** DateRange endDate */ + endDate?: (string|null); + + /** DateRange name */ + name?: (string|null); + } + + /** Represents a DateRange. */ + class DateRange implements IDateRange { + + /** + * Constructs a new DateRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IDateRange); + + /** DateRange startDate. */ + public startDate: string; + + /** DateRange endDate. */ + public endDate: string; + + /** DateRange name. */ + public name: string; + + /** + * Creates a new DateRange instance using the specified properties. + * @param [properties] Properties to set + * @returns DateRange instance + */ + public static create(properties?: google.analytics.data.v1alpha.IDateRange): google.analytics.data.v1alpha.DateRange; + + /** + * Encodes the specified DateRange message. Does not implicitly {@link google.analytics.data.v1alpha.DateRange.verify|verify} messages. + * @param message DateRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IDateRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateRange message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.DateRange.verify|verify} messages. + * @param message DateRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IDateRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.DateRange; + + /** + * Decodes a DateRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.DateRange; + + /** + * Verifies a DateRange 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 DateRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateRange + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.DateRange; + + /** + * Creates a plain object from a DateRange message. Also converts values to other types if specified. + * @param message DateRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.DateRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Dimension. */ + interface IDimension { + + /** Dimension name */ + name?: (string|null); + + /** Dimension dimensionExpression */ + dimensionExpression?: (google.analytics.data.v1alpha.IDimensionExpression|null); + } + + /** Represents a Dimension. */ + class Dimension implements IDimension { + + /** + * Constructs a new Dimension. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IDimension); + + /** Dimension name. */ + public name: string; + + /** Dimension dimensionExpression. */ + public dimensionExpression?: (google.analytics.data.v1alpha.IDimensionExpression|null); + + /** + * Creates a new Dimension instance using the specified properties. + * @param [properties] Properties to set + * @returns Dimension instance + */ + public static create(properties?: google.analytics.data.v1alpha.IDimension): google.analytics.data.v1alpha.Dimension; + + /** + * Encodes the specified Dimension message. Does not implicitly {@link google.analytics.data.v1alpha.Dimension.verify|verify} messages. + * @param message Dimension message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IDimension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dimension message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.Dimension.verify|verify} messages. + * @param message Dimension message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IDimension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dimension message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dimension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.Dimension; + + /** + * Decodes a Dimension message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dimension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.Dimension; + + /** + * Verifies a Dimension 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 Dimension message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dimension + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.Dimension; + + /** + * Creates a plain object from a Dimension message. Also converts values to other types if specified. + * @param message Dimension + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.Dimension, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dimension to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dimension + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DimensionExpression. */ + interface IDimensionExpression { + + /** DimensionExpression lowerCase */ + lowerCase?: (google.analytics.data.v1alpha.DimensionExpression.ICaseExpression|null); + + /** DimensionExpression upperCase */ + upperCase?: (google.analytics.data.v1alpha.DimensionExpression.ICaseExpression|null); + + /** DimensionExpression concatenate */ + concatenate?: (google.analytics.data.v1alpha.DimensionExpression.IConcatenateExpression|null); + } + + /** Represents a DimensionExpression. */ + class DimensionExpression implements IDimensionExpression { + + /** + * Constructs a new DimensionExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IDimensionExpression); + + /** DimensionExpression lowerCase. */ + public lowerCase?: (google.analytics.data.v1alpha.DimensionExpression.ICaseExpression|null); + + /** DimensionExpression upperCase. */ + public upperCase?: (google.analytics.data.v1alpha.DimensionExpression.ICaseExpression|null); + + /** DimensionExpression concatenate. */ + public concatenate?: (google.analytics.data.v1alpha.DimensionExpression.IConcatenateExpression|null); + + /** DimensionExpression oneExpression. */ + public oneExpression?: ("lowerCase"|"upperCase"|"concatenate"); + + /** + * Creates a new DimensionExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns DimensionExpression instance + */ + public static create(properties?: google.analytics.data.v1alpha.IDimensionExpression): google.analytics.data.v1alpha.DimensionExpression; + + /** + * Encodes the specified DimensionExpression message. Does not implicitly {@link google.analytics.data.v1alpha.DimensionExpression.verify|verify} messages. + * @param message DimensionExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IDimensionExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DimensionExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.DimensionExpression.verify|verify} messages. + * @param message DimensionExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IDimensionExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DimensionExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DimensionExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.DimensionExpression; + + /** + * Decodes a DimensionExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DimensionExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.DimensionExpression; + + /** + * Verifies a DimensionExpression 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 DimensionExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DimensionExpression + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.DimensionExpression; + + /** + * Creates a plain object from a DimensionExpression message. Also converts values to other types if specified. + * @param message DimensionExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.DimensionExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DimensionExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DimensionExpression + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DimensionExpression { + + /** Properties of a CaseExpression. */ + interface ICaseExpression { + + /** CaseExpression dimensionName */ + dimensionName?: (string|null); + } + + /** Represents a CaseExpression. */ + class CaseExpression implements ICaseExpression { + + /** + * Constructs a new CaseExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.DimensionExpression.ICaseExpression); + + /** CaseExpression dimensionName. */ + public dimensionName: string; + + /** + * Creates a new CaseExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns CaseExpression instance + */ + public static create(properties?: google.analytics.data.v1alpha.DimensionExpression.ICaseExpression): google.analytics.data.v1alpha.DimensionExpression.CaseExpression; + + /** + * Encodes the specified CaseExpression message. Does not implicitly {@link google.analytics.data.v1alpha.DimensionExpression.CaseExpression.verify|verify} messages. + * @param message CaseExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.DimensionExpression.ICaseExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CaseExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.DimensionExpression.CaseExpression.verify|verify} messages. + * @param message CaseExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.DimensionExpression.ICaseExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CaseExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CaseExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.DimensionExpression.CaseExpression; + + /** + * Decodes a CaseExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CaseExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.DimensionExpression.CaseExpression; + + /** + * Verifies a CaseExpression 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 CaseExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CaseExpression + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.DimensionExpression.CaseExpression; + + /** + * Creates a plain object from a CaseExpression message. Also converts values to other types if specified. + * @param message CaseExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.DimensionExpression.CaseExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CaseExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CaseExpression + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConcatenateExpression. */ + interface IConcatenateExpression { + + /** ConcatenateExpression dimensionNames */ + dimensionNames?: (string[]|null); + + /** ConcatenateExpression delimiter */ + delimiter?: (string|null); + } + + /** Represents a ConcatenateExpression. */ + class ConcatenateExpression implements IConcatenateExpression { + + /** + * Constructs a new ConcatenateExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.DimensionExpression.IConcatenateExpression); + + /** ConcatenateExpression dimensionNames. */ + public dimensionNames: string[]; + + /** ConcatenateExpression delimiter. */ + public delimiter: string; + + /** + * Creates a new ConcatenateExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns ConcatenateExpression instance + */ + public static create(properties?: google.analytics.data.v1alpha.DimensionExpression.IConcatenateExpression): google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression; + + /** + * Encodes the specified ConcatenateExpression message. Does not implicitly {@link google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression.verify|verify} messages. + * @param message ConcatenateExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.DimensionExpression.IConcatenateExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConcatenateExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression.verify|verify} messages. + * @param message ConcatenateExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.DimensionExpression.IConcatenateExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConcatenateExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConcatenateExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression; + + /** + * Decodes a ConcatenateExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConcatenateExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression; + + /** + * Verifies a ConcatenateExpression 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 ConcatenateExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConcatenateExpression + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression; + + /** + * Creates a plain object from a ConcatenateExpression message. Also converts values to other types if specified. + * @param message ConcatenateExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConcatenateExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConcatenateExpression + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FilterExpression. */ + interface IFilterExpression { + + /** FilterExpression andGroup */ + andGroup?: (google.analytics.data.v1alpha.IFilterExpressionList|null); + + /** FilterExpression orGroup */ + orGroup?: (google.analytics.data.v1alpha.IFilterExpressionList|null); + + /** FilterExpression notExpression */ + notExpression?: (google.analytics.data.v1alpha.IFilterExpression|null); + + /** FilterExpression filter */ + filter?: (google.analytics.data.v1alpha.IFilter|null); + } + + /** Represents a FilterExpression. */ + class FilterExpression implements IFilterExpression { + + /** + * Constructs a new FilterExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFilterExpression); + + /** FilterExpression andGroup. */ + public andGroup?: (google.analytics.data.v1alpha.IFilterExpressionList|null); + + /** FilterExpression orGroup. */ + public orGroup?: (google.analytics.data.v1alpha.IFilterExpressionList|null); + + /** FilterExpression notExpression. */ + public notExpression?: (google.analytics.data.v1alpha.IFilterExpression|null); + + /** FilterExpression filter. */ + public filter?: (google.analytics.data.v1alpha.IFilter|null); + + /** FilterExpression expr. */ + public expr?: ("andGroup"|"orGroup"|"notExpression"|"filter"); + + /** + * Creates a new FilterExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns FilterExpression instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFilterExpression): google.analytics.data.v1alpha.FilterExpression; + + /** + * Encodes the specified FilterExpression message. Does not implicitly {@link google.analytics.data.v1alpha.FilterExpression.verify|verify} messages. + * @param message FilterExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFilterExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FilterExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FilterExpression.verify|verify} messages. + * @param message FilterExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFilterExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FilterExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FilterExpression; + + /** + * Decodes a FilterExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FilterExpression; + + /** + * Verifies a FilterExpression 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 FilterExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FilterExpression + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FilterExpression; + + /** + * Creates a plain object from a FilterExpression message. Also converts values to other types if specified. + * @param message FilterExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.FilterExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FilterExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FilterExpression + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FilterExpressionList. */ + interface IFilterExpressionList { + + /** FilterExpressionList expressions */ + expressions?: (google.analytics.data.v1alpha.IFilterExpression[]|null); + } + + /** Represents a FilterExpressionList. */ + class FilterExpressionList implements IFilterExpressionList { + + /** + * Constructs a new FilterExpressionList. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFilterExpressionList); + + /** FilterExpressionList expressions. */ + public expressions: google.analytics.data.v1alpha.IFilterExpression[]; + + /** + * Creates a new FilterExpressionList instance using the specified properties. + * @param [properties] Properties to set + * @returns FilterExpressionList instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFilterExpressionList): google.analytics.data.v1alpha.FilterExpressionList; + + /** + * Encodes the specified FilterExpressionList message. Does not implicitly {@link google.analytics.data.v1alpha.FilterExpressionList.verify|verify} messages. + * @param message FilterExpressionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFilterExpressionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FilterExpressionList message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FilterExpressionList.verify|verify} messages. + * @param message FilterExpressionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFilterExpressionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FilterExpressionList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FilterExpressionList; + + /** + * Decodes a FilterExpressionList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FilterExpressionList; + + /** + * Verifies a FilterExpressionList 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 FilterExpressionList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FilterExpressionList + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FilterExpressionList; + + /** + * Creates a plain object from a FilterExpressionList message. Also converts values to other types if specified. + * @param message FilterExpressionList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.FilterExpressionList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FilterExpressionList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FilterExpressionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Filter. */ + interface IFilter { + + /** Filter fieldName */ + fieldName?: (string|null); + + /** Filter stringFilter */ + stringFilter?: (google.analytics.data.v1alpha.IStringFilter|null); + + /** Filter inListFilter */ + inListFilter?: (google.analytics.data.v1alpha.IInListFilter|null); + + /** Filter numericFilter */ + numericFilter?: (google.analytics.data.v1alpha.INumericFilter|null); + + /** Filter betweenFilter */ + betweenFilter?: (google.analytics.data.v1alpha.IBetweenFilter|null); + } + + /** Represents a Filter. */ + class Filter implements IFilter { + + /** + * Constructs a new Filter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFilter); + + /** Filter fieldName. */ + public fieldName: string; + + /** Filter stringFilter. */ + public stringFilter?: (google.analytics.data.v1alpha.IStringFilter|null); + + /** Filter inListFilter. */ + public inListFilter?: (google.analytics.data.v1alpha.IInListFilter|null); + + /** Filter numericFilter. */ + public numericFilter?: (google.analytics.data.v1alpha.INumericFilter|null); + + /** Filter betweenFilter. */ + public betweenFilter?: (google.analytics.data.v1alpha.IBetweenFilter|null); + + /** Filter oneFilter. */ + public oneFilter?: ("stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"); + + /** + * Creates a new Filter instance using the specified properties. + * @param [properties] Properties to set + * @returns Filter instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFilter): google.analytics.data.v1alpha.Filter; + + /** + * Encodes the specified Filter message. Does not implicitly {@link google.analytics.data.v1alpha.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Filter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.Filter; + + /** + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.Filter; + + /** + * Verifies a Filter 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 Filter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Filter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.Filter; + + /** + * Creates a plain object from a Filter message. Also converts values to other types if specified. + * @param message Filter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.Filter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Filter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Filter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringFilter. */ + interface IStringFilter { + + /** StringFilter matchType */ + matchType?: (google.analytics.data.v1alpha.StringFilter.MatchType|keyof typeof google.analytics.data.v1alpha.StringFilter.MatchType|null); + + /** StringFilter value */ + value?: (string|null); + + /** StringFilter caseSensitive */ + caseSensitive?: (boolean|null); + } + + /** Represents a StringFilter. */ + class StringFilter implements IStringFilter { + + /** + * Constructs a new StringFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IStringFilter); + + /** StringFilter matchType. */ + public matchType: (google.analytics.data.v1alpha.StringFilter.MatchType|keyof typeof google.analytics.data.v1alpha.StringFilter.MatchType); + + /** StringFilter value. */ + public value: string; + + /** StringFilter caseSensitive. */ + public caseSensitive: boolean; + + /** + * Creates a new StringFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns StringFilter instance + */ + public static create(properties?: google.analytics.data.v1alpha.IStringFilter): google.analytics.data.v1alpha.StringFilter; + + /** + * Encodes the specified StringFilter message. Does not implicitly {@link google.analytics.data.v1alpha.StringFilter.verify|verify} messages. + * @param message StringFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IStringFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.StringFilter.verify|verify} messages. + * @param message StringFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IStringFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.StringFilter; + + /** + * Decodes a StringFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.StringFilter; + + /** + * Verifies a StringFilter 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 StringFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.StringFilter; + + /** + * Creates a plain object from a StringFilter message. Also converts values to other types if specified. + * @param message StringFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.StringFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StringFilter { + + /** 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 InListFilter. */ + interface IInListFilter { + + /** InListFilter values */ + values?: (string[]|null); + + /** InListFilter caseSensitive */ + caseSensitive?: (boolean|null); + } + + /** Represents an InListFilter. */ + class InListFilter implements IInListFilter { + + /** + * Constructs a new InListFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IInListFilter); + + /** InListFilter values. */ + public values: string[]; + + /** InListFilter caseSensitive. */ + public caseSensitive: boolean; + + /** + * Creates a new InListFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns InListFilter instance + */ + public static create(properties?: google.analytics.data.v1alpha.IInListFilter): google.analytics.data.v1alpha.InListFilter; + + /** + * Encodes the specified InListFilter message. Does not implicitly {@link google.analytics.data.v1alpha.InListFilter.verify|verify} messages. + * @param message InListFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IInListFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InListFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.InListFilter.verify|verify} messages. + * @param message InListFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IInListFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InListFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InListFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.InListFilter; + + /** + * Decodes an InListFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InListFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.InListFilter; + + /** + * Verifies an InListFilter 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 InListFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InListFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.InListFilter; + + /** + * Creates a plain object from an InListFilter message. Also converts values to other types if specified. + * @param message InListFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.InListFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InListFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InListFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NumericFilter. */ + interface INumericFilter { + + /** NumericFilter operation */ + operation?: (google.analytics.data.v1alpha.NumericFilter.Operation|keyof typeof google.analytics.data.v1alpha.NumericFilter.Operation|null); + + /** NumericFilter value */ + value?: (google.analytics.data.v1alpha.INumericValue|null); + } + + /** Represents a NumericFilter. */ + class NumericFilter implements INumericFilter { + + /** + * Constructs a new NumericFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.INumericFilter); + + /** NumericFilter operation. */ + public operation: (google.analytics.data.v1alpha.NumericFilter.Operation|keyof typeof google.analytics.data.v1alpha.NumericFilter.Operation); + + /** NumericFilter value. */ + public value?: (google.analytics.data.v1alpha.INumericValue|null); + + /** + * Creates a new NumericFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns NumericFilter instance + */ + public static create(properties?: google.analytics.data.v1alpha.INumericFilter): google.analytics.data.v1alpha.NumericFilter; + + /** + * Encodes the specified NumericFilter message. Does not implicitly {@link google.analytics.data.v1alpha.NumericFilter.verify|verify} messages. + * @param message NumericFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.INumericFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NumericFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.NumericFilter.verify|verify} messages. + * @param message NumericFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.INumericFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NumericFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NumericFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.NumericFilter; + + /** + * Decodes a NumericFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NumericFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.NumericFilter; + + /** + * Verifies a NumericFilter 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 NumericFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NumericFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.NumericFilter; + + /** + * Creates a plain object from a NumericFilter message. Also converts values to other types if specified. + * @param message NumericFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.NumericFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NumericFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NumericFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NumericFilter { + + /** 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 a BetweenFilter. */ + interface IBetweenFilter { + + /** BetweenFilter fromValue */ + fromValue?: (google.analytics.data.v1alpha.INumericValue|null); + + /** BetweenFilter toValue */ + toValue?: (google.analytics.data.v1alpha.INumericValue|null); + } + + /** Represents a BetweenFilter. */ + class BetweenFilter implements IBetweenFilter { + + /** + * Constructs a new BetweenFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IBetweenFilter); + + /** BetweenFilter fromValue. */ + public fromValue?: (google.analytics.data.v1alpha.INumericValue|null); + + /** BetweenFilter toValue. */ + public toValue?: (google.analytics.data.v1alpha.INumericValue|null); + + /** + * Creates a new BetweenFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns BetweenFilter instance + */ + public static create(properties?: google.analytics.data.v1alpha.IBetweenFilter): google.analytics.data.v1alpha.BetweenFilter; + + /** + * Encodes the specified BetweenFilter message. Does not implicitly {@link google.analytics.data.v1alpha.BetweenFilter.verify|verify} messages. + * @param message BetweenFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IBetweenFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BetweenFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.BetweenFilter.verify|verify} messages. + * @param message BetweenFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IBetweenFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BetweenFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BetweenFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.BetweenFilter; + + /** + * Decodes a BetweenFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BetweenFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.BetweenFilter; + + /** + * Verifies a BetweenFilter 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 BetweenFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BetweenFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.BetweenFilter; + + /** + * Creates a plain object from a BetweenFilter message. Also converts values to other types if specified. + * @param message BetweenFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.BetweenFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BetweenFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BetweenFilter + * @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.data.v1alpha.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.data.v1alpha.INumericValue): google.analytics.data.v1alpha.NumericValue; + + /** + * Encodes the specified NumericValue message. Does not implicitly {@link google.analytics.data.v1alpha.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.data.v1alpha.INumericValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NumericValue message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.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.data.v1alpha.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.data.v1alpha.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.data.v1alpha.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.data.v1alpha.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.data.v1alpha.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 a DimensionHeader. */ + interface IDimensionHeader { + + /** DimensionHeader name */ + name?: (string|null); + } + + /** Represents a DimensionHeader. */ + class DimensionHeader implements IDimensionHeader { + + /** + * Constructs a new DimensionHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IDimensionHeader); + + /** DimensionHeader name. */ + public name: string; + + /** + * Creates a new DimensionHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns DimensionHeader instance + */ + public static create(properties?: google.analytics.data.v1alpha.IDimensionHeader): google.analytics.data.v1alpha.DimensionHeader; + + /** + * Encodes the specified DimensionHeader message. Does not implicitly {@link google.analytics.data.v1alpha.DimensionHeader.verify|verify} messages. + * @param message DimensionHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IDimensionHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DimensionHeader message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.DimensionHeader.verify|verify} messages. + * @param message DimensionHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IDimensionHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DimensionHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.DimensionHeader; + + /** + * Decodes a DimensionHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.DimensionHeader; + + /** + * Verifies a DimensionHeader 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 DimensionHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DimensionHeader + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.DimensionHeader; + + /** + * Creates a plain object from a DimensionHeader message. Also converts values to other types if specified. + * @param message DimensionHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.DimensionHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DimensionHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DimensionHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricHeader. */ + interface IMetricHeader { + + /** MetricHeader name */ + name?: (string|null); + + /** MetricHeader type */ + type?: (google.analytics.data.v1alpha.MetricType|keyof typeof google.analytics.data.v1alpha.MetricType|null); + } + + /** Represents a MetricHeader. */ + class MetricHeader implements IMetricHeader { + + /** + * Constructs a new MetricHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IMetricHeader); + + /** MetricHeader name. */ + public name: string; + + /** MetricHeader type. */ + public type: (google.analytics.data.v1alpha.MetricType|keyof typeof google.analytics.data.v1alpha.MetricType); + + /** + * Creates a new MetricHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricHeader instance + */ + public static create(properties?: google.analytics.data.v1alpha.IMetricHeader): google.analytics.data.v1alpha.MetricHeader; + + /** + * Encodes the specified MetricHeader message. Does not implicitly {@link google.analytics.data.v1alpha.MetricHeader.verify|verify} messages. + * @param message MetricHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IMetricHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricHeader message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.MetricHeader.verify|verify} messages. + * @param message MetricHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IMetricHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.MetricHeader; + + /** + * Decodes a MetricHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.MetricHeader; + + /** + * Verifies a MetricHeader 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 MetricHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricHeader + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.MetricHeader; + + /** + * Creates a plain object from a MetricHeader message. Also converts values to other types if specified. + * @param message MetricHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.MetricHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Row. */ + interface IRow { + + /** Row dimensionValues */ + dimensionValues?: (google.analytics.data.v1alpha.IDimensionValue[]|null); + + /** Row metricValues */ + metricValues?: (google.analytics.data.v1alpha.IMetricValue[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IRow); + + /** Row dimensionValues. */ + public dimensionValues: google.analytics.data.v1alpha.IDimensionValue[]; + + /** Row metricValues. */ + public metricValues: google.analytics.data.v1alpha.IMetricValue[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.analytics.data.v1alpha.IRow): google.analytics.data.v1alpha.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.analytics.data.v1alpha.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.Row; + + /** + * Verifies a Row 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 Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Row + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DimensionValue. */ + interface IDimensionValue { + + /** DimensionValue value */ + value?: (string|null); + } + + /** Represents a DimensionValue. */ + class DimensionValue implements IDimensionValue { + + /** + * Constructs a new DimensionValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IDimensionValue); + + /** DimensionValue value. */ + public value?: (string|null); + + /** DimensionValue oneValue. */ + public oneValue?: "value"; + + /** + * Creates a new DimensionValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DimensionValue instance + */ + public static create(properties?: google.analytics.data.v1alpha.IDimensionValue): google.analytics.data.v1alpha.DimensionValue; + + /** + * Encodes the specified DimensionValue message. Does not implicitly {@link google.analytics.data.v1alpha.DimensionValue.verify|verify} messages. + * @param message DimensionValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IDimensionValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DimensionValue message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.DimensionValue.verify|verify} messages. + * @param message DimensionValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IDimensionValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DimensionValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DimensionValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.DimensionValue; + + /** + * Decodes a DimensionValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DimensionValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.DimensionValue; + + /** + * Verifies a DimensionValue 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 DimensionValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DimensionValue + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.DimensionValue; + + /** + * Creates a plain object from a DimensionValue message. Also converts values to other types if specified. + * @param message DimensionValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.DimensionValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DimensionValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DimensionValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricValue. */ + interface IMetricValue { + + /** MetricValue value */ + value?: (string|null); + } + + /** Represents a MetricValue. */ + class MetricValue implements IMetricValue { + + /** + * Constructs a new MetricValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IMetricValue); + + /** MetricValue value. */ + public value?: (string|null); + + /** MetricValue oneValue. */ + public oneValue?: "value"; + + /** + * Creates a new MetricValue instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricValue instance + */ + public static create(properties?: google.analytics.data.v1alpha.IMetricValue): google.analytics.data.v1alpha.MetricValue; + + /** + * Encodes the specified MetricValue message. Does not implicitly {@link google.analytics.data.v1alpha.MetricValue.verify|verify} messages. + * @param message MetricValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IMetricValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricValue message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.MetricValue.verify|verify} messages. + * @param message MetricValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IMetricValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.MetricValue; + + /** + * Decodes a MetricValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.MetricValue; + + /** + * Verifies a MetricValue 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 MetricValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricValue + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.MetricValue; + + /** + * Creates a plain object from a MetricValue message. Also converts values to other types if specified. + * @param message MetricValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.MetricValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PropertyQuota. */ + interface IPropertyQuota { + + /** PropertyQuota tokensPerDay */ + tokensPerDay?: (google.analytics.data.v1alpha.IQuotaStatus|null); + + /** PropertyQuota tokensPerHour */ + tokensPerHour?: (google.analytics.data.v1alpha.IQuotaStatus|null); + + /** PropertyQuota concurrentRequests */ + concurrentRequests?: (google.analytics.data.v1alpha.IQuotaStatus|null); + + /** PropertyQuota serverErrorsPerProjectPerHour */ + serverErrorsPerProjectPerHour?: (google.analytics.data.v1alpha.IQuotaStatus|null); + + /** PropertyQuota potentiallyThresholdedRequestsPerHour */ + potentiallyThresholdedRequestsPerHour?: (google.analytics.data.v1alpha.IQuotaStatus|null); + } + + /** Represents a PropertyQuota. */ + class PropertyQuota implements IPropertyQuota { + + /** + * Constructs a new PropertyQuota. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IPropertyQuota); + + /** PropertyQuota tokensPerDay. */ + public tokensPerDay?: (google.analytics.data.v1alpha.IQuotaStatus|null); + + /** PropertyQuota tokensPerHour. */ + public tokensPerHour?: (google.analytics.data.v1alpha.IQuotaStatus|null); + + /** PropertyQuota concurrentRequests. */ + public concurrentRequests?: (google.analytics.data.v1alpha.IQuotaStatus|null); + + /** PropertyQuota serverErrorsPerProjectPerHour. */ + public serverErrorsPerProjectPerHour?: (google.analytics.data.v1alpha.IQuotaStatus|null); + + /** PropertyQuota potentiallyThresholdedRequestsPerHour. */ + public potentiallyThresholdedRequestsPerHour?: (google.analytics.data.v1alpha.IQuotaStatus|null); + + /** + * Creates a new PropertyQuota instance using the specified properties. + * @param [properties] Properties to set + * @returns PropertyQuota instance + */ + public static create(properties?: google.analytics.data.v1alpha.IPropertyQuota): google.analytics.data.v1alpha.PropertyQuota; + + /** + * Encodes the specified PropertyQuota message. Does not implicitly {@link google.analytics.data.v1alpha.PropertyQuota.verify|verify} messages. + * @param message PropertyQuota message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IPropertyQuota, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PropertyQuota message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.PropertyQuota.verify|verify} messages. + * @param message PropertyQuota message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IPropertyQuota, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PropertyQuota message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PropertyQuota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.PropertyQuota; + + /** + * Decodes a PropertyQuota message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PropertyQuota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.PropertyQuota; + + /** + * Verifies a PropertyQuota 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 PropertyQuota message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PropertyQuota + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.PropertyQuota; + + /** + * Creates a plain object from a PropertyQuota message. Also converts values to other types if specified. + * @param message PropertyQuota + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.PropertyQuota, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PropertyQuota to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PropertyQuota + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QuotaStatus. */ + interface IQuotaStatus { + + /** QuotaStatus consumed */ + consumed?: (number|null); + + /** QuotaStatus remaining */ + remaining?: (number|null); + } + + /** Represents a QuotaStatus. */ + class QuotaStatus implements IQuotaStatus { + + /** + * Constructs a new QuotaStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IQuotaStatus); + + /** QuotaStatus consumed. */ + public consumed: number; + + /** QuotaStatus remaining. */ + public remaining: number; + + /** + * Creates a new QuotaStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns QuotaStatus instance + */ + public static create(properties?: google.analytics.data.v1alpha.IQuotaStatus): google.analytics.data.v1alpha.QuotaStatus; + + /** + * Encodes the specified QuotaStatus message. Does not implicitly {@link google.analytics.data.v1alpha.QuotaStatus.verify|verify} messages. + * @param message QuotaStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IQuotaStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuotaStatus message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.QuotaStatus.verify|verify} messages. + * @param message QuotaStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IQuotaStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuotaStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuotaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.QuotaStatus; + + /** + * Decodes a QuotaStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuotaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.QuotaStatus; + + /** + * Verifies a QuotaStatus 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 QuotaStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuotaStatus + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.QuotaStatus; + + /** + * Creates a plain object from a QuotaStatus message. Also converts values to other types if specified. + * @param message QuotaStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.QuotaStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuotaStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuotaStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunnelBreakdown. */ + interface IFunnelBreakdown { + + /** FunnelBreakdown breakdownDimension */ + breakdownDimension?: (google.analytics.data.v1alpha.IDimension|null); + + /** FunnelBreakdown limit */ + limit?: (number|Long|string|null); + } + + /** Represents a FunnelBreakdown. */ + class FunnelBreakdown implements IFunnelBreakdown { + + /** + * Constructs a new FunnelBreakdown. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFunnelBreakdown); + + /** FunnelBreakdown breakdownDimension. */ + public breakdownDimension?: (google.analytics.data.v1alpha.IDimension|null); + + /** FunnelBreakdown limit. */ + public limit?: (number|Long|string|null); + + /** FunnelBreakdown _limit. */ + public _limit?: "limit"; + + /** + * Creates a new FunnelBreakdown instance using the specified properties. + * @param [properties] Properties to set + * @returns FunnelBreakdown instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFunnelBreakdown): google.analytics.data.v1alpha.FunnelBreakdown; + + /** + * Encodes the specified FunnelBreakdown message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelBreakdown.verify|verify} messages. + * @param message FunnelBreakdown message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFunnelBreakdown, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunnelBreakdown message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelBreakdown.verify|verify} messages. + * @param message FunnelBreakdown message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnelBreakdown, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunnelBreakdown message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunnelBreakdown + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FunnelBreakdown; + + /** + * Decodes a FunnelBreakdown message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunnelBreakdown + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FunnelBreakdown; + + /** + * Verifies a FunnelBreakdown 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 FunnelBreakdown message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunnelBreakdown + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FunnelBreakdown; + + /** + * Creates a plain object from a FunnelBreakdown message. Also converts values to other types if specified. + * @param message FunnelBreakdown + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.FunnelBreakdown, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunnelBreakdown to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunnelBreakdown + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunnelNextAction. */ + interface IFunnelNextAction { + + /** FunnelNextAction nextActionDimension */ + nextActionDimension?: (google.analytics.data.v1alpha.IDimension|null); + + /** FunnelNextAction limit */ + limit?: (number|Long|string|null); + } + + /** Represents a FunnelNextAction. */ + class FunnelNextAction implements IFunnelNextAction { + + /** + * Constructs a new FunnelNextAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFunnelNextAction); + + /** FunnelNextAction nextActionDimension. */ + public nextActionDimension?: (google.analytics.data.v1alpha.IDimension|null); + + /** FunnelNextAction limit. */ + public limit?: (number|Long|string|null); + + /** FunnelNextAction _limit. */ + public _limit?: "limit"; + + /** + * Creates a new FunnelNextAction instance using the specified properties. + * @param [properties] Properties to set + * @returns FunnelNextAction instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFunnelNextAction): google.analytics.data.v1alpha.FunnelNextAction; + + /** + * Encodes the specified FunnelNextAction message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelNextAction.verify|verify} messages. + * @param message FunnelNextAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFunnelNextAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunnelNextAction message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelNextAction.verify|verify} messages. + * @param message FunnelNextAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnelNextAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunnelNextAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunnelNextAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FunnelNextAction; + + /** + * Decodes a FunnelNextAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunnelNextAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FunnelNextAction; + + /** + * Verifies a FunnelNextAction 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 FunnelNextAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunnelNextAction + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FunnelNextAction; + + /** + * Creates a plain object from a FunnelNextAction message. Also converts values to other types if specified. + * @param message FunnelNextAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.FunnelNextAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunnelNextAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunnelNextAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Funnel. */ + interface IFunnel { + + /** Funnel isOpenFunnel */ + isOpenFunnel?: (boolean|null); + + /** Funnel steps */ + steps?: (google.analytics.data.v1alpha.IFunnelStep[]|null); + } + + /** Represents a Funnel. */ + class Funnel implements IFunnel { + + /** + * Constructs a new Funnel. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFunnel); + + /** Funnel isOpenFunnel. */ + public isOpenFunnel: boolean; + + /** Funnel steps. */ + public steps: google.analytics.data.v1alpha.IFunnelStep[]; + + /** + * Creates a new Funnel instance using the specified properties. + * @param [properties] Properties to set + * @returns Funnel instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFunnel): google.analytics.data.v1alpha.Funnel; + + /** + * Encodes the specified Funnel message. Does not implicitly {@link google.analytics.data.v1alpha.Funnel.verify|verify} messages. + * @param message Funnel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFunnel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Funnel message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.Funnel.verify|verify} messages. + * @param message Funnel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Funnel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Funnel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.Funnel; + + /** + * Decodes a Funnel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Funnel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.Funnel; + + /** + * Verifies a Funnel 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 Funnel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Funnel + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.Funnel; + + /** + * Creates a plain object from a Funnel message. Also converts values to other types if specified. + * @param message Funnel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.Funnel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Funnel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Funnel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunnelStep. */ + interface IFunnelStep { + + /** FunnelStep name */ + name?: (string|null); + + /** FunnelStep isDirectlyFollowedBy */ + isDirectlyFollowedBy?: (boolean|null); + + /** FunnelStep withinDurationFromPriorStep */ + withinDurationFromPriorStep?: (google.protobuf.IDuration|null); + + /** FunnelStep filterExpression */ + filterExpression?: (google.analytics.data.v1alpha.IFunnelFilterExpression|null); + } + + /** Represents a FunnelStep. */ + class FunnelStep implements IFunnelStep { + + /** + * Constructs a new FunnelStep. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFunnelStep); + + /** FunnelStep name. */ + public name: string; + + /** FunnelStep isDirectlyFollowedBy. */ + public isDirectlyFollowedBy: boolean; + + /** FunnelStep withinDurationFromPriorStep. */ + public withinDurationFromPriorStep?: (google.protobuf.IDuration|null); + + /** FunnelStep filterExpression. */ + public filterExpression?: (google.analytics.data.v1alpha.IFunnelFilterExpression|null); + + /** FunnelStep _withinDurationFromPriorStep. */ + public _withinDurationFromPriorStep?: "withinDurationFromPriorStep"; + + /** + * Creates a new FunnelStep instance using the specified properties. + * @param [properties] Properties to set + * @returns FunnelStep instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFunnelStep): google.analytics.data.v1alpha.FunnelStep; + + /** + * Encodes the specified FunnelStep message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelStep.verify|verify} messages. + * @param message FunnelStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFunnelStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunnelStep message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelStep.verify|verify} messages. + * @param message FunnelStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnelStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunnelStep message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunnelStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FunnelStep; + + /** + * Decodes a FunnelStep message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunnelStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FunnelStep; + + /** + * Verifies a FunnelStep 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 FunnelStep message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunnelStep + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FunnelStep; + + /** + * Creates a plain object from a FunnelStep message. Also converts values to other types if specified. + * @param message FunnelStep + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.FunnelStep, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunnelStep to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunnelStep + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunnelSubReport. */ + interface IFunnelSubReport { + + /** FunnelSubReport dimensionHeaders */ + dimensionHeaders?: (google.analytics.data.v1alpha.IDimensionHeader[]|null); + + /** FunnelSubReport metricHeaders */ + metricHeaders?: (google.analytics.data.v1alpha.IMetricHeader[]|null); + + /** FunnelSubReport rows */ + rows?: (google.analytics.data.v1alpha.IRow[]|null); + + /** FunnelSubReport metadata */ + metadata?: (google.analytics.data.v1alpha.IFunnelResponseMetadata|null); + } + + /** Represents a FunnelSubReport. */ + class FunnelSubReport implements IFunnelSubReport { + + /** + * Constructs a new FunnelSubReport. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFunnelSubReport); + + /** FunnelSubReport dimensionHeaders. */ + public dimensionHeaders: google.analytics.data.v1alpha.IDimensionHeader[]; + + /** FunnelSubReport metricHeaders. */ + public metricHeaders: google.analytics.data.v1alpha.IMetricHeader[]; + + /** FunnelSubReport rows. */ + public rows: google.analytics.data.v1alpha.IRow[]; + + /** FunnelSubReport metadata. */ + public metadata?: (google.analytics.data.v1alpha.IFunnelResponseMetadata|null); + + /** + * Creates a new FunnelSubReport instance using the specified properties. + * @param [properties] Properties to set + * @returns FunnelSubReport instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFunnelSubReport): google.analytics.data.v1alpha.FunnelSubReport; + + /** + * Encodes the specified FunnelSubReport message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelSubReport.verify|verify} messages. + * @param message FunnelSubReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFunnelSubReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunnelSubReport message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelSubReport.verify|verify} messages. + * @param message FunnelSubReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnelSubReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunnelSubReport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunnelSubReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FunnelSubReport; + + /** + * Decodes a FunnelSubReport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunnelSubReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FunnelSubReport; + + /** + * Verifies a FunnelSubReport 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 FunnelSubReport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunnelSubReport + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FunnelSubReport; + + /** + * Creates a plain object from a FunnelSubReport message. Also converts values to other types if specified. + * @param message FunnelSubReport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.FunnelSubReport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunnelSubReport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunnelSubReport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserSegment. */ + interface IUserSegment { + + /** UserSegment userInclusionCriteria */ + userInclusionCriteria?: (google.analytics.data.v1alpha.IUserSegmentCriteria|null); + + /** UserSegment exclusion */ + exclusion?: (google.analytics.data.v1alpha.IUserSegmentExclusion|null); + } + + /** Represents a UserSegment. */ + class UserSegment implements IUserSegment { + + /** + * Constructs a new UserSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IUserSegment); + + /** UserSegment userInclusionCriteria. */ + public userInclusionCriteria?: (google.analytics.data.v1alpha.IUserSegmentCriteria|null); + + /** UserSegment exclusion. */ + public exclusion?: (google.analytics.data.v1alpha.IUserSegmentExclusion|null); + + /** + * Creates a new UserSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns UserSegment instance + */ + public static create(properties?: google.analytics.data.v1alpha.IUserSegment): google.analytics.data.v1alpha.UserSegment; + + /** + * Encodes the specified UserSegment message. Does not implicitly {@link google.analytics.data.v1alpha.UserSegment.verify|verify} messages. + * @param message UserSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IUserSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserSegment message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.UserSegment.verify|verify} messages. + * @param message UserSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IUserSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.UserSegment; + + /** + * Decodes a UserSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.UserSegment; + + /** + * Verifies a UserSegment 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 UserSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserSegment + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.UserSegment; + + /** + * Creates a plain object from a UserSegment message. Also converts values to other types if specified. + * @param message UserSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.UserSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserSegmentCriteria. */ + interface IUserSegmentCriteria { + + /** UserSegmentCriteria andConditionGroups */ + andConditionGroups?: (google.analytics.data.v1alpha.IUserSegmentConditionGroup[]|null); + + /** UserSegmentCriteria andSequenceGroups */ + andSequenceGroups?: (google.analytics.data.v1alpha.IUserSegmentSequenceGroup[]|null); + } + + /** Represents a UserSegmentCriteria. */ + class UserSegmentCriteria implements IUserSegmentCriteria { + + /** + * Constructs a new UserSegmentCriteria. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IUserSegmentCriteria); + + /** UserSegmentCriteria andConditionGroups. */ + public andConditionGroups: google.analytics.data.v1alpha.IUserSegmentConditionGroup[]; + + /** UserSegmentCriteria andSequenceGroups. */ + public andSequenceGroups: google.analytics.data.v1alpha.IUserSegmentSequenceGroup[]; + + /** + * Creates a new UserSegmentCriteria instance using the specified properties. + * @param [properties] Properties to set + * @returns UserSegmentCriteria instance + */ + public static create(properties?: google.analytics.data.v1alpha.IUserSegmentCriteria): google.analytics.data.v1alpha.UserSegmentCriteria; + + /** + * Encodes the specified UserSegmentCriteria message. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentCriteria.verify|verify} messages. + * @param message UserSegmentCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IUserSegmentCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserSegmentCriteria message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentCriteria.verify|verify} messages. + * @param message UserSegmentCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IUserSegmentCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserSegmentCriteria message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserSegmentCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.UserSegmentCriteria; + + /** + * Decodes a UserSegmentCriteria message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserSegmentCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.UserSegmentCriteria; + + /** + * Verifies a UserSegmentCriteria 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 UserSegmentCriteria message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserSegmentCriteria + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.UserSegmentCriteria; + + /** + * Creates a plain object from a UserSegmentCriteria message. Also converts values to other types if specified. + * @param message UserSegmentCriteria + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.UserSegmentCriteria, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserSegmentCriteria to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserSegmentCriteria + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** UserCriteriaScoping enum. */ + enum UserCriteriaScoping { + USER_CRITERIA_SCOPING_UNSPECIFIED = 0, + USER_CRITERIA_WITHIN_SAME_EVENT = 1, + USER_CRITERIA_WITHIN_SAME_SESSION = 2, + USER_CRITERIA_ACROSS_ALL_SESSIONS = 3 + } + + /** Properties of a UserSegmentConditionGroup. */ + interface IUserSegmentConditionGroup { + + /** UserSegmentConditionGroup conditionScoping */ + conditionScoping?: (google.analytics.data.v1alpha.UserCriteriaScoping|keyof typeof google.analytics.data.v1alpha.UserCriteriaScoping|null); + + /** UserSegmentConditionGroup segmentFilterExpression */ + segmentFilterExpression?: (google.analytics.data.v1alpha.ISegmentFilterExpression|null); + } + + /** Represents a UserSegmentConditionGroup. */ + class UserSegmentConditionGroup implements IUserSegmentConditionGroup { + + /** + * Constructs a new UserSegmentConditionGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IUserSegmentConditionGroup); + + /** UserSegmentConditionGroup conditionScoping. */ + public conditionScoping: (google.analytics.data.v1alpha.UserCriteriaScoping|keyof typeof google.analytics.data.v1alpha.UserCriteriaScoping); + + /** UserSegmentConditionGroup segmentFilterExpression. */ + public segmentFilterExpression?: (google.analytics.data.v1alpha.ISegmentFilterExpression|null); + + /** + * Creates a new UserSegmentConditionGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns UserSegmentConditionGroup instance + */ + public static create(properties?: google.analytics.data.v1alpha.IUserSegmentConditionGroup): google.analytics.data.v1alpha.UserSegmentConditionGroup; + + /** + * Encodes the specified UserSegmentConditionGroup message. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentConditionGroup.verify|verify} messages. + * @param message UserSegmentConditionGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IUserSegmentConditionGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserSegmentConditionGroup message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentConditionGroup.verify|verify} messages. + * @param message UserSegmentConditionGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IUserSegmentConditionGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserSegmentConditionGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserSegmentConditionGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.UserSegmentConditionGroup; + + /** + * Decodes a UserSegmentConditionGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserSegmentConditionGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.UserSegmentConditionGroup; + + /** + * Verifies a UserSegmentConditionGroup 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 UserSegmentConditionGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserSegmentConditionGroup + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.UserSegmentConditionGroup; + + /** + * Creates a plain object from a UserSegmentConditionGroup message. Also converts values to other types if specified. + * @param message UserSegmentConditionGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.UserSegmentConditionGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserSegmentConditionGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserSegmentConditionGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserSegmentSequenceGroup. */ + interface IUserSegmentSequenceGroup { + + /** UserSegmentSequenceGroup sequenceScoping */ + sequenceScoping?: (google.analytics.data.v1alpha.UserCriteriaScoping|keyof typeof google.analytics.data.v1alpha.UserCriteriaScoping|null); + + /** UserSegmentSequenceGroup sequenceMaximumDuration */ + sequenceMaximumDuration?: (google.protobuf.IDuration|null); + + /** UserSegmentSequenceGroup userSequenceSteps */ + userSequenceSteps?: (google.analytics.data.v1alpha.IUserSequenceStep[]|null); + } + + /** Represents a UserSegmentSequenceGroup. */ + class UserSegmentSequenceGroup implements IUserSegmentSequenceGroup { + + /** + * Constructs a new UserSegmentSequenceGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IUserSegmentSequenceGroup); + + /** UserSegmentSequenceGroup sequenceScoping. */ + public sequenceScoping: (google.analytics.data.v1alpha.UserCriteriaScoping|keyof typeof google.analytics.data.v1alpha.UserCriteriaScoping); + + /** UserSegmentSequenceGroup sequenceMaximumDuration. */ + public sequenceMaximumDuration?: (google.protobuf.IDuration|null); + + /** UserSegmentSequenceGroup userSequenceSteps. */ + public userSequenceSteps: google.analytics.data.v1alpha.IUserSequenceStep[]; + + /** + * Creates a new UserSegmentSequenceGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns UserSegmentSequenceGroup instance + */ + public static create(properties?: google.analytics.data.v1alpha.IUserSegmentSequenceGroup): google.analytics.data.v1alpha.UserSegmentSequenceGroup; + + /** + * Encodes the specified UserSegmentSequenceGroup message. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentSequenceGroup.verify|verify} messages. + * @param message UserSegmentSequenceGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IUserSegmentSequenceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserSegmentSequenceGroup message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentSequenceGroup.verify|verify} messages. + * @param message UserSegmentSequenceGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IUserSegmentSequenceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserSegmentSequenceGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserSegmentSequenceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.UserSegmentSequenceGroup; + + /** + * Decodes a UserSegmentSequenceGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserSegmentSequenceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.UserSegmentSequenceGroup; + + /** + * Verifies a UserSegmentSequenceGroup 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 UserSegmentSequenceGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserSegmentSequenceGroup + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.UserSegmentSequenceGroup; + + /** + * Creates a plain object from a UserSegmentSequenceGroup message. Also converts values to other types if specified. + * @param message UserSegmentSequenceGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.UserSegmentSequenceGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserSegmentSequenceGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserSegmentSequenceGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserSequenceStep. */ + interface IUserSequenceStep { + + /** UserSequenceStep isDirectlyFollowedBy */ + isDirectlyFollowedBy?: (boolean|null); + + /** UserSequenceStep stepScoping */ + stepScoping?: (google.analytics.data.v1alpha.UserCriteriaScoping|keyof typeof google.analytics.data.v1alpha.UserCriteriaScoping|null); + + /** UserSequenceStep segmentFilterExpression */ + segmentFilterExpression?: (google.analytics.data.v1alpha.ISegmentFilterExpression|null); + } + + /** Represents a UserSequenceStep. */ + class UserSequenceStep implements IUserSequenceStep { + + /** + * Constructs a new UserSequenceStep. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IUserSequenceStep); + + /** UserSequenceStep isDirectlyFollowedBy. */ + public isDirectlyFollowedBy: boolean; + + /** UserSequenceStep stepScoping. */ + public stepScoping: (google.analytics.data.v1alpha.UserCriteriaScoping|keyof typeof google.analytics.data.v1alpha.UserCriteriaScoping); + + /** UserSequenceStep segmentFilterExpression. */ + public segmentFilterExpression?: (google.analytics.data.v1alpha.ISegmentFilterExpression|null); + + /** + * Creates a new UserSequenceStep instance using the specified properties. + * @param [properties] Properties to set + * @returns UserSequenceStep instance + */ + public static create(properties?: google.analytics.data.v1alpha.IUserSequenceStep): google.analytics.data.v1alpha.UserSequenceStep; + + /** + * Encodes the specified UserSequenceStep message. Does not implicitly {@link google.analytics.data.v1alpha.UserSequenceStep.verify|verify} messages. + * @param message UserSequenceStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IUserSequenceStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserSequenceStep message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.UserSequenceStep.verify|verify} messages. + * @param message UserSequenceStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IUserSequenceStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserSequenceStep message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserSequenceStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.UserSequenceStep; + + /** + * Decodes a UserSequenceStep message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserSequenceStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.UserSequenceStep; + + /** + * Verifies a UserSequenceStep 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 UserSequenceStep message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserSequenceStep + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.UserSequenceStep; + + /** + * Creates a plain object from a UserSequenceStep message. Also converts values to other types if specified. + * @param message UserSequenceStep + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.UserSequenceStep, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserSequenceStep to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserSequenceStep + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserSegmentExclusion. */ + interface IUserSegmentExclusion { + + /** UserSegmentExclusion userExclusionDuration */ + userExclusionDuration?: (google.analytics.data.v1alpha.UserExclusionDuration|keyof typeof google.analytics.data.v1alpha.UserExclusionDuration|null); + + /** UserSegmentExclusion userExclusionCriteria */ + userExclusionCriteria?: (google.analytics.data.v1alpha.IUserSegmentCriteria|null); + } + + /** Represents a UserSegmentExclusion. */ + class UserSegmentExclusion implements IUserSegmentExclusion { + + /** + * Constructs a new UserSegmentExclusion. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IUserSegmentExclusion); + + /** UserSegmentExclusion userExclusionDuration. */ + public userExclusionDuration: (google.analytics.data.v1alpha.UserExclusionDuration|keyof typeof google.analytics.data.v1alpha.UserExclusionDuration); + + /** UserSegmentExclusion userExclusionCriteria. */ + public userExclusionCriteria?: (google.analytics.data.v1alpha.IUserSegmentCriteria|null); + + /** + * Creates a new UserSegmentExclusion instance using the specified properties. + * @param [properties] Properties to set + * @returns UserSegmentExclusion instance + */ + public static create(properties?: google.analytics.data.v1alpha.IUserSegmentExclusion): google.analytics.data.v1alpha.UserSegmentExclusion; + + /** + * Encodes the specified UserSegmentExclusion message. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentExclusion.verify|verify} messages. + * @param message UserSegmentExclusion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IUserSegmentExclusion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserSegmentExclusion message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentExclusion.verify|verify} messages. + * @param message UserSegmentExclusion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IUserSegmentExclusion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserSegmentExclusion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserSegmentExclusion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.UserSegmentExclusion; + + /** + * Decodes a UserSegmentExclusion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserSegmentExclusion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.UserSegmentExclusion; + + /** + * Verifies a UserSegmentExclusion 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 UserSegmentExclusion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserSegmentExclusion + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.UserSegmentExclusion; + + /** + * Creates a plain object from a UserSegmentExclusion message. Also converts values to other types if specified. + * @param message UserSegmentExclusion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.UserSegmentExclusion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserSegmentExclusion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserSegmentExclusion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** UserExclusionDuration enum. */ + enum UserExclusionDuration { + USER_EXCLUSION_DURATION_UNSPECIFIED = 0, + USER_EXCLUSION_TEMPORARY = 1, + USER_EXCLUSION_PERMANENT = 2 + } + + /** Properties of a SessionSegment. */ + interface ISessionSegment { + + /** SessionSegment sessionInclusionCriteria */ + sessionInclusionCriteria?: (google.analytics.data.v1alpha.ISessionSegmentCriteria|null); + + /** SessionSegment exclusion */ + exclusion?: (google.analytics.data.v1alpha.ISessionSegmentExclusion|null); + } + + /** Represents a SessionSegment. */ + class SessionSegment implements ISessionSegment { + + /** + * Constructs a new SessionSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISessionSegment); + + /** SessionSegment sessionInclusionCriteria. */ + public sessionInclusionCriteria?: (google.analytics.data.v1alpha.ISessionSegmentCriteria|null); + + /** SessionSegment exclusion. */ + public exclusion?: (google.analytics.data.v1alpha.ISessionSegmentExclusion|null); + + /** + * Creates a new SessionSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionSegment instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISessionSegment): google.analytics.data.v1alpha.SessionSegment; + + /** + * Encodes the specified SessionSegment message. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegment.verify|verify} messages. + * @param message SessionSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISessionSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionSegment message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegment.verify|verify} messages. + * @param message SessionSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISessionSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.SessionSegment; + + /** + * Decodes a SessionSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.SessionSegment; + + /** + * Verifies a SessionSegment 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 SessionSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionSegment + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.SessionSegment; + + /** + * Creates a plain object from a SessionSegment message. Also converts values to other types if specified. + * @param message SessionSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.SessionSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionSegmentCriteria. */ + interface ISessionSegmentCriteria { + + /** SessionSegmentCriteria andConditionGroups */ + andConditionGroups?: (google.analytics.data.v1alpha.ISessionSegmentConditionGroup[]|null); + } + + /** Represents a SessionSegmentCriteria. */ + class SessionSegmentCriteria implements ISessionSegmentCriteria { + + /** + * Constructs a new SessionSegmentCriteria. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISessionSegmentCriteria); + + /** SessionSegmentCriteria andConditionGroups. */ + public andConditionGroups: google.analytics.data.v1alpha.ISessionSegmentConditionGroup[]; + + /** + * Creates a new SessionSegmentCriteria instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionSegmentCriteria instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISessionSegmentCriteria): google.analytics.data.v1alpha.SessionSegmentCriteria; + + /** + * Encodes the specified SessionSegmentCriteria message. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegmentCriteria.verify|verify} messages. + * @param message SessionSegmentCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISessionSegmentCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionSegmentCriteria message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegmentCriteria.verify|verify} messages. + * @param message SessionSegmentCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISessionSegmentCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionSegmentCriteria message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionSegmentCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.SessionSegmentCriteria; + + /** + * Decodes a SessionSegmentCriteria message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionSegmentCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.SessionSegmentCriteria; + + /** + * Verifies a SessionSegmentCriteria 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 SessionSegmentCriteria message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionSegmentCriteria + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.SessionSegmentCriteria; + + /** + * Creates a plain object from a SessionSegmentCriteria message. Also converts values to other types if specified. + * @param message SessionSegmentCriteria + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.SessionSegmentCriteria, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionSegmentCriteria to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionSegmentCriteria + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** SessionCriteriaScoping enum. */ + enum SessionCriteriaScoping { + SESSION_CRITERIA_SCOPING_UNSPECIFIED = 0, + SESSION_CRITERIA_WITHIN_SAME_EVENT = 1, + SESSION_CRITERIA_WITHIN_SAME_SESSION = 2 + } + + /** Properties of a SessionSegmentConditionGroup. */ + interface ISessionSegmentConditionGroup { + + /** SessionSegmentConditionGroup conditionScoping */ + conditionScoping?: (google.analytics.data.v1alpha.SessionCriteriaScoping|keyof typeof google.analytics.data.v1alpha.SessionCriteriaScoping|null); + + /** SessionSegmentConditionGroup segmentFilterExpression */ + segmentFilterExpression?: (google.analytics.data.v1alpha.ISegmentFilterExpression|null); + } + + /** Represents a SessionSegmentConditionGroup. */ + class SessionSegmentConditionGroup implements ISessionSegmentConditionGroup { + + /** + * Constructs a new SessionSegmentConditionGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISessionSegmentConditionGroup); + + /** SessionSegmentConditionGroup conditionScoping. */ + public conditionScoping: (google.analytics.data.v1alpha.SessionCriteriaScoping|keyof typeof google.analytics.data.v1alpha.SessionCriteriaScoping); + + /** SessionSegmentConditionGroup segmentFilterExpression. */ + public segmentFilterExpression?: (google.analytics.data.v1alpha.ISegmentFilterExpression|null); + + /** + * Creates a new SessionSegmentConditionGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionSegmentConditionGroup instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISessionSegmentConditionGroup): google.analytics.data.v1alpha.SessionSegmentConditionGroup; + + /** + * Encodes the specified SessionSegmentConditionGroup message. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegmentConditionGroup.verify|verify} messages. + * @param message SessionSegmentConditionGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISessionSegmentConditionGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionSegmentConditionGroup message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegmentConditionGroup.verify|verify} messages. + * @param message SessionSegmentConditionGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISessionSegmentConditionGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionSegmentConditionGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionSegmentConditionGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.SessionSegmentConditionGroup; + + /** + * Decodes a SessionSegmentConditionGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionSegmentConditionGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.SessionSegmentConditionGroup; + + /** + * Verifies a SessionSegmentConditionGroup 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 SessionSegmentConditionGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionSegmentConditionGroup + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.SessionSegmentConditionGroup; + + /** + * Creates a plain object from a SessionSegmentConditionGroup message. Also converts values to other types if specified. + * @param message SessionSegmentConditionGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.SessionSegmentConditionGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionSegmentConditionGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionSegmentConditionGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionSegmentExclusion. */ + interface ISessionSegmentExclusion { + + /** SessionSegmentExclusion sessionExclusionDuration */ + sessionExclusionDuration?: (google.analytics.data.v1alpha.SessionExclusionDuration|keyof typeof google.analytics.data.v1alpha.SessionExclusionDuration|null); + + /** SessionSegmentExclusion sessionExclusionCriteria */ + sessionExclusionCriteria?: (google.analytics.data.v1alpha.ISessionSegmentCriteria|null); + } + + /** Represents a SessionSegmentExclusion. */ + class SessionSegmentExclusion implements ISessionSegmentExclusion { + + /** + * Constructs a new SessionSegmentExclusion. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISessionSegmentExclusion); + + /** SessionSegmentExclusion sessionExclusionDuration. */ + public sessionExclusionDuration: (google.analytics.data.v1alpha.SessionExclusionDuration|keyof typeof google.analytics.data.v1alpha.SessionExclusionDuration); + + /** SessionSegmentExclusion sessionExclusionCriteria. */ + public sessionExclusionCriteria?: (google.analytics.data.v1alpha.ISessionSegmentCriteria|null); + + /** + * Creates a new SessionSegmentExclusion instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionSegmentExclusion instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISessionSegmentExclusion): google.analytics.data.v1alpha.SessionSegmentExclusion; + + /** + * Encodes the specified SessionSegmentExclusion message. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegmentExclusion.verify|verify} messages. + * @param message SessionSegmentExclusion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISessionSegmentExclusion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionSegmentExclusion message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegmentExclusion.verify|verify} messages. + * @param message SessionSegmentExclusion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISessionSegmentExclusion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionSegmentExclusion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionSegmentExclusion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.SessionSegmentExclusion; + + /** + * Decodes a SessionSegmentExclusion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionSegmentExclusion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.SessionSegmentExclusion; + + /** + * Verifies a SessionSegmentExclusion 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 SessionSegmentExclusion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionSegmentExclusion + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.SessionSegmentExclusion; + + /** + * Creates a plain object from a SessionSegmentExclusion message. Also converts values to other types if specified. + * @param message SessionSegmentExclusion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.SessionSegmentExclusion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionSegmentExclusion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionSegmentExclusion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** SessionExclusionDuration enum. */ + enum SessionExclusionDuration { + SESSION_EXCLUSION_DURATION_UNSPECIFIED = 0, + SESSION_EXCLUSION_TEMPORARY = 1, + SESSION_EXCLUSION_PERMANENT = 2 + } + + /** Properties of an EventSegment. */ + interface IEventSegment { + + /** EventSegment eventInclusionCriteria */ + eventInclusionCriteria?: (google.analytics.data.v1alpha.IEventSegmentCriteria|null); + + /** EventSegment exclusion */ + exclusion?: (google.analytics.data.v1alpha.IEventSegmentExclusion|null); + } + + /** Represents an EventSegment. */ + class EventSegment implements IEventSegment { + + /** + * Constructs a new EventSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IEventSegment); + + /** EventSegment eventInclusionCriteria. */ + public eventInclusionCriteria?: (google.analytics.data.v1alpha.IEventSegmentCriteria|null); + + /** EventSegment exclusion. */ + public exclusion?: (google.analytics.data.v1alpha.IEventSegmentExclusion|null); + + /** + * Creates a new EventSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns EventSegment instance + */ + public static create(properties?: google.analytics.data.v1alpha.IEventSegment): google.analytics.data.v1alpha.EventSegment; + + /** + * Encodes the specified EventSegment message. Does not implicitly {@link google.analytics.data.v1alpha.EventSegment.verify|verify} messages. + * @param message EventSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IEventSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventSegment message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.EventSegment.verify|verify} messages. + * @param message EventSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IEventSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.EventSegment; + + /** + * Decodes an EventSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.EventSegment; + + /** + * Verifies an EventSegment 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 EventSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventSegment + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.EventSegment; + + /** + * Creates a plain object from an EventSegment message. Also converts values to other types if specified. + * @param message EventSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.EventSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EventSegmentCriteria. */ + interface IEventSegmentCriteria { + + /** EventSegmentCriteria andConditionGroups */ + andConditionGroups?: (google.analytics.data.v1alpha.IEventSegmentConditionGroup[]|null); + } + + /** Represents an EventSegmentCriteria. */ + class EventSegmentCriteria implements IEventSegmentCriteria { + + /** + * Constructs a new EventSegmentCriteria. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IEventSegmentCriteria); + + /** EventSegmentCriteria andConditionGroups. */ + public andConditionGroups: google.analytics.data.v1alpha.IEventSegmentConditionGroup[]; + + /** + * Creates a new EventSegmentCriteria instance using the specified properties. + * @param [properties] Properties to set + * @returns EventSegmentCriteria instance + */ + public static create(properties?: google.analytics.data.v1alpha.IEventSegmentCriteria): google.analytics.data.v1alpha.EventSegmentCriteria; + + /** + * Encodes the specified EventSegmentCriteria message. Does not implicitly {@link google.analytics.data.v1alpha.EventSegmentCriteria.verify|verify} messages. + * @param message EventSegmentCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IEventSegmentCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventSegmentCriteria message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.EventSegmentCriteria.verify|verify} messages. + * @param message EventSegmentCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IEventSegmentCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventSegmentCriteria message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventSegmentCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.EventSegmentCriteria; + + /** + * Decodes an EventSegmentCriteria message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventSegmentCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.EventSegmentCriteria; + + /** + * Verifies an EventSegmentCriteria 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 EventSegmentCriteria message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventSegmentCriteria + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.EventSegmentCriteria; + + /** + * Creates a plain object from an EventSegmentCriteria message. Also converts values to other types if specified. + * @param message EventSegmentCriteria + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.EventSegmentCriteria, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventSegmentCriteria to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventSegmentCriteria + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** EventCriteriaScoping enum. */ + enum EventCriteriaScoping { + EVENT_CRITERIA_SCOPING_UNSPECIFIED = 0, + EVENT_CRITERIA_WITHIN_SAME_EVENT = 1 + } + + /** Properties of an EventSegmentConditionGroup. */ + interface IEventSegmentConditionGroup { + + /** EventSegmentConditionGroup conditionScoping */ + conditionScoping?: (google.analytics.data.v1alpha.EventCriteriaScoping|keyof typeof google.analytics.data.v1alpha.EventCriteriaScoping|null); + + /** EventSegmentConditionGroup segmentFilterExpression */ + segmentFilterExpression?: (google.analytics.data.v1alpha.ISegmentFilterExpression|null); + } + + /** Represents an EventSegmentConditionGroup. */ + class EventSegmentConditionGroup implements IEventSegmentConditionGroup { + + /** + * Constructs a new EventSegmentConditionGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IEventSegmentConditionGroup); + + /** EventSegmentConditionGroup conditionScoping. */ + public conditionScoping: (google.analytics.data.v1alpha.EventCriteriaScoping|keyof typeof google.analytics.data.v1alpha.EventCriteriaScoping); + + /** EventSegmentConditionGroup segmentFilterExpression. */ + public segmentFilterExpression?: (google.analytics.data.v1alpha.ISegmentFilterExpression|null); + + /** + * Creates a new EventSegmentConditionGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns EventSegmentConditionGroup instance + */ + public static create(properties?: google.analytics.data.v1alpha.IEventSegmentConditionGroup): google.analytics.data.v1alpha.EventSegmentConditionGroup; + + /** + * Encodes the specified EventSegmentConditionGroup message. Does not implicitly {@link google.analytics.data.v1alpha.EventSegmentConditionGroup.verify|verify} messages. + * @param message EventSegmentConditionGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IEventSegmentConditionGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventSegmentConditionGroup message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.EventSegmentConditionGroup.verify|verify} messages. + * @param message EventSegmentConditionGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IEventSegmentConditionGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventSegmentConditionGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventSegmentConditionGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.EventSegmentConditionGroup; + + /** + * Decodes an EventSegmentConditionGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventSegmentConditionGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.EventSegmentConditionGroup; + + /** + * Verifies an EventSegmentConditionGroup 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 EventSegmentConditionGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventSegmentConditionGroup + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.EventSegmentConditionGroup; + + /** + * Creates a plain object from an EventSegmentConditionGroup message. Also converts values to other types if specified. + * @param message EventSegmentConditionGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.EventSegmentConditionGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventSegmentConditionGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventSegmentConditionGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EventSegmentExclusion. */ + interface IEventSegmentExclusion { + + /** EventSegmentExclusion eventExclusionDuration */ + eventExclusionDuration?: (google.analytics.data.v1alpha.EventExclusionDuration|keyof typeof google.analytics.data.v1alpha.EventExclusionDuration|null); + + /** EventSegmentExclusion eventExclusionCriteria */ + eventExclusionCriteria?: (google.analytics.data.v1alpha.IEventSegmentCriteria|null); + } + + /** Represents an EventSegmentExclusion. */ + class EventSegmentExclusion implements IEventSegmentExclusion { + + /** + * Constructs a new EventSegmentExclusion. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IEventSegmentExclusion); + + /** EventSegmentExclusion eventExclusionDuration. */ + public eventExclusionDuration: (google.analytics.data.v1alpha.EventExclusionDuration|keyof typeof google.analytics.data.v1alpha.EventExclusionDuration); + + /** EventSegmentExclusion eventExclusionCriteria. */ + public eventExclusionCriteria?: (google.analytics.data.v1alpha.IEventSegmentCriteria|null); + + /** + * Creates a new EventSegmentExclusion instance using the specified properties. + * @param [properties] Properties to set + * @returns EventSegmentExclusion instance + */ + public static create(properties?: google.analytics.data.v1alpha.IEventSegmentExclusion): google.analytics.data.v1alpha.EventSegmentExclusion; + + /** + * Encodes the specified EventSegmentExclusion message. Does not implicitly {@link google.analytics.data.v1alpha.EventSegmentExclusion.verify|verify} messages. + * @param message EventSegmentExclusion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IEventSegmentExclusion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventSegmentExclusion message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.EventSegmentExclusion.verify|verify} messages. + * @param message EventSegmentExclusion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IEventSegmentExclusion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventSegmentExclusion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventSegmentExclusion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.EventSegmentExclusion; + + /** + * Decodes an EventSegmentExclusion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventSegmentExclusion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.EventSegmentExclusion; + + /** + * Verifies an EventSegmentExclusion 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 EventSegmentExclusion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventSegmentExclusion + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.EventSegmentExclusion; + + /** + * Creates a plain object from an EventSegmentExclusion message. Also converts values to other types if specified. + * @param message EventSegmentExclusion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.EventSegmentExclusion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventSegmentExclusion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventSegmentExclusion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** EventExclusionDuration enum. */ + enum EventExclusionDuration { + EVENT_EXCLUSION_DURATION_UNSPECIFIED = 0, + EVENT_EXCLUSION_PERMANENT = 1 + } + + /** Properties of a Segment. */ + interface ISegment { + + /** Segment name */ + name?: (string|null); + + /** Segment userSegment */ + userSegment?: (google.analytics.data.v1alpha.IUserSegment|null); + + /** Segment sessionSegment */ + sessionSegment?: (google.analytics.data.v1alpha.ISessionSegment|null); + + /** Segment eventSegment */ + eventSegment?: (google.analytics.data.v1alpha.IEventSegment|null); + } + + /** Represents a Segment. */ + class Segment implements ISegment { + + /** + * Constructs a new Segment. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISegment); + + /** Segment name. */ + public name: string; + + /** Segment userSegment. */ + public userSegment?: (google.analytics.data.v1alpha.IUserSegment|null); + + /** Segment sessionSegment. */ + public sessionSegment?: (google.analytics.data.v1alpha.ISessionSegment|null); + + /** Segment eventSegment. */ + public eventSegment?: (google.analytics.data.v1alpha.IEventSegment|null); + + /** Segment oneSegmentScope. */ + public oneSegmentScope?: ("userSegment"|"sessionSegment"|"eventSegment"); + + /** + * Creates a new Segment instance using the specified properties. + * @param [properties] Properties to set + * @returns Segment instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISegment): google.analytics.data.v1alpha.Segment; + + /** + * Encodes the specified Segment message. Does not implicitly {@link google.analytics.data.v1alpha.Segment.verify|verify} messages. + * @param message Segment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Segment message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.Segment.verify|verify} messages. + * @param message Segment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Segment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Segment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.Segment; + + /** + * Decodes a Segment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Segment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.Segment; + + /** + * Verifies a Segment 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 Segment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Segment + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.Segment; + + /** + * Creates a plain object from a Segment message. Also converts values to other types if specified. + * @param message Segment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.Segment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Segment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Segment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SegmentFilterExpression. */ + interface ISegmentFilterExpression { + + /** SegmentFilterExpression andGroup */ + andGroup?: (google.analytics.data.v1alpha.ISegmentFilterExpressionList|null); + + /** SegmentFilterExpression orGroup */ + orGroup?: (google.analytics.data.v1alpha.ISegmentFilterExpressionList|null); + + /** SegmentFilterExpression notExpression */ + notExpression?: (google.analytics.data.v1alpha.ISegmentFilterExpression|null); + + /** SegmentFilterExpression segmentFilter */ + segmentFilter?: (google.analytics.data.v1alpha.ISegmentFilter|null); + + /** SegmentFilterExpression segmentEventFilter */ + segmentEventFilter?: (google.analytics.data.v1alpha.ISegmentEventFilter|null); + } + + /** Represents a SegmentFilterExpression. */ + class SegmentFilterExpression implements ISegmentFilterExpression { + + /** + * Constructs a new SegmentFilterExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISegmentFilterExpression); + + /** SegmentFilterExpression andGroup. */ + public andGroup?: (google.analytics.data.v1alpha.ISegmentFilterExpressionList|null); + + /** SegmentFilterExpression orGroup. */ + public orGroup?: (google.analytics.data.v1alpha.ISegmentFilterExpressionList|null); + + /** SegmentFilterExpression notExpression. */ + public notExpression?: (google.analytics.data.v1alpha.ISegmentFilterExpression|null); + + /** SegmentFilterExpression segmentFilter. */ + public segmentFilter?: (google.analytics.data.v1alpha.ISegmentFilter|null); + + /** SegmentFilterExpression segmentEventFilter. */ + public segmentEventFilter?: (google.analytics.data.v1alpha.ISegmentEventFilter|null); + + /** SegmentFilterExpression expr. */ + public expr?: ("andGroup"|"orGroup"|"notExpression"|"segmentFilter"|"segmentEventFilter"); + + /** + * Creates a new SegmentFilterExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns SegmentFilterExpression instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISegmentFilterExpression): google.analytics.data.v1alpha.SegmentFilterExpression; + + /** + * Encodes the specified SegmentFilterExpression message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilterExpression.verify|verify} messages. + * @param message SegmentFilterExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISegmentFilterExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SegmentFilterExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilterExpression.verify|verify} messages. + * @param message SegmentFilterExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISegmentFilterExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SegmentFilterExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SegmentFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.SegmentFilterExpression; + + /** + * Decodes a SegmentFilterExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SegmentFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.SegmentFilterExpression; + + /** + * Verifies a SegmentFilterExpression 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 SegmentFilterExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SegmentFilterExpression + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.SegmentFilterExpression; + + /** + * Creates a plain object from a SegmentFilterExpression message. Also converts values to other types if specified. + * @param message SegmentFilterExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.SegmentFilterExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SegmentFilterExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SegmentFilterExpression + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SegmentFilterExpressionList. */ + interface ISegmentFilterExpressionList { + + /** SegmentFilterExpressionList expressions */ + expressions?: (google.analytics.data.v1alpha.ISegmentFilterExpression[]|null); + } + + /** Represents a SegmentFilterExpressionList. */ + class SegmentFilterExpressionList implements ISegmentFilterExpressionList { + + /** + * Constructs a new SegmentFilterExpressionList. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISegmentFilterExpressionList); + + /** SegmentFilterExpressionList expressions. */ + public expressions: google.analytics.data.v1alpha.ISegmentFilterExpression[]; + + /** + * Creates a new SegmentFilterExpressionList instance using the specified properties. + * @param [properties] Properties to set + * @returns SegmentFilterExpressionList instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISegmentFilterExpressionList): google.analytics.data.v1alpha.SegmentFilterExpressionList; + + /** + * Encodes the specified SegmentFilterExpressionList message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilterExpressionList.verify|verify} messages. + * @param message SegmentFilterExpressionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISegmentFilterExpressionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SegmentFilterExpressionList message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilterExpressionList.verify|verify} messages. + * @param message SegmentFilterExpressionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISegmentFilterExpressionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SegmentFilterExpressionList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SegmentFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.SegmentFilterExpressionList; + + /** + * Decodes a SegmentFilterExpressionList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SegmentFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.SegmentFilterExpressionList; + + /** + * Verifies a SegmentFilterExpressionList 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 SegmentFilterExpressionList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SegmentFilterExpressionList + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.SegmentFilterExpressionList; + + /** + * Creates a plain object from a SegmentFilterExpressionList message. Also converts values to other types if specified. + * @param message SegmentFilterExpressionList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.SegmentFilterExpressionList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SegmentFilterExpressionList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SegmentFilterExpressionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SegmentFilter. */ + interface ISegmentFilter { + + /** SegmentFilter fieldName */ + fieldName?: (string|null); + + /** SegmentFilter stringFilter */ + stringFilter?: (google.analytics.data.v1alpha.IStringFilter|null); + + /** SegmentFilter inListFilter */ + inListFilter?: (google.analytics.data.v1alpha.IInListFilter|null); + + /** SegmentFilter numericFilter */ + numericFilter?: (google.analytics.data.v1alpha.INumericFilter|null); + + /** SegmentFilter betweenFilter */ + betweenFilter?: (google.analytics.data.v1alpha.IBetweenFilter|null); + + /** SegmentFilter filterScoping */ + filterScoping?: (google.analytics.data.v1alpha.ISegmentFilterScoping|null); + } + + /** Represents a SegmentFilter. */ + class SegmentFilter implements ISegmentFilter { + + /** + * Constructs a new SegmentFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISegmentFilter); + + /** SegmentFilter fieldName. */ + public fieldName: string; + + /** SegmentFilter stringFilter. */ + public stringFilter?: (google.analytics.data.v1alpha.IStringFilter|null); + + /** SegmentFilter inListFilter. */ + public inListFilter?: (google.analytics.data.v1alpha.IInListFilter|null); + + /** SegmentFilter numericFilter. */ + public numericFilter?: (google.analytics.data.v1alpha.INumericFilter|null); + + /** SegmentFilter betweenFilter. */ + public betweenFilter?: (google.analytics.data.v1alpha.IBetweenFilter|null); + + /** SegmentFilter filterScoping. */ + public filterScoping?: (google.analytics.data.v1alpha.ISegmentFilterScoping|null); + + /** SegmentFilter oneFilter. */ + public oneFilter?: ("stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"); + + /** + * Creates a new SegmentFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns SegmentFilter instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISegmentFilter): google.analytics.data.v1alpha.SegmentFilter; + + /** + * Encodes the specified SegmentFilter message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilter.verify|verify} messages. + * @param message SegmentFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISegmentFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SegmentFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilter.verify|verify} messages. + * @param message SegmentFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISegmentFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SegmentFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SegmentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.SegmentFilter; + + /** + * Decodes a SegmentFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SegmentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.SegmentFilter; + + /** + * Verifies a SegmentFilter 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 SegmentFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SegmentFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.SegmentFilter; + + /** + * Creates a plain object from a SegmentFilter message. Also converts values to other types if specified. + * @param message SegmentFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.SegmentFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SegmentFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SegmentFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SegmentFilterScoping. */ + interface ISegmentFilterScoping { + + /** SegmentFilterScoping atAnyPointInTime */ + atAnyPointInTime?: (boolean|null); + } + + /** Represents a SegmentFilterScoping. */ + class SegmentFilterScoping implements ISegmentFilterScoping { + + /** + * Constructs a new SegmentFilterScoping. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISegmentFilterScoping); + + /** SegmentFilterScoping atAnyPointInTime. */ + public atAnyPointInTime?: (boolean|null); + + /** SegmentFilterScoping _atAnyPointInTime. */ + public _atAnyPointInTime?: "atAnyPointInTime"; + + /** + * Creates a new SegmentFilterScoping instance using the specified properties. + * @param [properties] Properties to set + * @returns SegmentFilterScoping instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISegmentFilterScoping): google.analytics.data.v1alpha.SegmentFilterScoping; + + /** + * Encodes the specified SegmentFilterScoping message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilterScoping.verify|verify} messages. + * @param message SegmentFilterScoping message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISegmentFilterScoping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SegmentFilterScoping message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilterScoping.verify|verify} messages. + * @param message SegmentFilterScoping message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISegmentFilterScoping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SegmentFilterScoping message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SegmentFilterScoping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.SegmentFilterScoping; + + /** + * Decodes a SegmentFilterScoping message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SegmentFilterScoping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.SegmentFilterScoping; + + /** + * Verifies a SegmentFilterScoping 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 SegmentFilterScoping message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SegmentFilterScoping + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.SegmentFilterScoping; + + /** + * Creates a plain object from a SegmentFilterScoping message. Also converts values to other types if specified. + * @param message SegmentFilterScoping + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.SegmentFilterScoping, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SegmentFilterScoping to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SegmentFilterScoping + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SegmentEventFilter. */ + interface ISegmentEventFilter { + + /** SegmentEventFilter eventName */ + eventName?: (string|null); + + /** SegmentEventFilter segmentParameterFilterExpression */ + segmentParameterFilterExpression?: (google.analytics.data.v1alpha.ISegmentParameterFilterExpression|null); + } + + /** Represents a SegmentEventFilter. */ + class SegmentEventFilter implements ISegmentEventFilter { + + /** + * Constructs a new SegmentEventFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISegmentEventFilter); + + /** SegmentEventFilter eventName. */ + public eventName?: (string|null); + + /** SegmentEventFilter segmentParameterFilterExpression. */ + public segmentParameterFilterExpression?: (google.analytics.data.v1alpha.ISegmentParameterFilterExpression|null); + + /** SegmentEventFilter _eventName. */ + public _eventName?: "eventName"; + + /** SegmentEventFilter _segmentParameterFilterExpression. */ + public _segmentParameterFilterExpression?: "segmentParameterFilterExpression"; + + /** + * Creates a new SegmentEventFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns SegmentEventFilter instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISegmentEventFilter): google.analytics.data.v1alpha.SegmentEventFilter; + + /** + * Encodes the specified SegmentEventFilter message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentEventFilter.verify|verify} messages. + * @param message SegmentEventFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISegmentEventFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SegmentEventFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentEventFilter.verify|verify} messages. + * @param message SegmentEventFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISegmentEventFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SegmentEventFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SegmentEventFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.SegmentEventFilter; + + /** + * Decodes a SegmentEventFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SegmentEventFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.SegmentEventFilter; + + /** + * Verifies a SegmentEventFilter 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 SegmentEventFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SegmentEventFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.SegmentEventFilter; + + /** + * Creates a plain object from a SegmentEventFilter message. Also converts values to other types if specified. + * @param message SegmentEventFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.SegmentEventFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SegmentEventFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SegmentEventFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SegmentParameterFilterExpression. */ + interface ISegmentParameterFilterExpression { + + /** SegmentParameterFilterExpression andGroup */ + andGroup?: (google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList|null); + + /** SegmentParameterFilterExpression orGroup */ + orGroup?: (google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList|null); + + /** SegmentParameterFilterExpression notExpression */ + notExpression?: (google.analytics.data.v1alpha.ISegmentParameterFilterExpression|null); + + /** SegmentParameterFilterExpression segmentParameterFilter */ + segmentParameterFilter?: (google.analytics.data.v1alpha.ISegmentParameterFilter|null); + } + + /** Represents a SegmentParameterFilterExpression. */ + class SegmentParameterFilterExpression implements ISegmentParameterFilterExpression { + + /** + * Constructs a new SegmentParameterFilterExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISegmentParameterFilterExpression); + + /** SegmentParameterFilterExpression andGroup. */ + public andGroup?: (google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList|null); + + /** SegmentParameterFilterExpression orGroup. */ + public orGroup?: (google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList|null); + + /** SegmentParameterFilterExpression notExpression. */ + public notExpression?: (google.analytics.data.v1alpha.ISegmentParameterFilterExpression|null); + + /** SegmentParameterFilterExpression segmentParameterFilter. */ + public segmentParameterFilter?: (google.analytics.data.v1alpha.ISegmentParameterFilter|null); + + /** SegmentParameterFilterExpression expr. */ + public expr?: ("andGroup"|"orGroup"|"notExpression"|"segmentParameterFilter"); + + /** + * Creates a new SegmentParameterFilterExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns SegmentParameterFilterExpression instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISegmentParameterFilterExpression): google.analytics.data.v1alpha.SegmentParameterFilterExpression; + + /** + * Encodes the specified SegmentParameterFilterExpression message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilterExpression.verify|verify} messages. + * @param message SegmentParameterFilterExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISegmentParameterFilterExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SegmentParameterFilterExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilterExpression.verify|verify} messages. + * @param message SegmentParameterFilterExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISegmentParameterFilterExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SegmentParameterFilterExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SegmentParameterFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.SegmentParameterFilterExpression; + + /** + * Decodes a SegmentParameterFilterExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SegmentParameterFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.SegmentParameterFilterExpression; + + /** + * Verifies a SegmentParameterFilterExpression 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 SegmentParameterFilterExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SegmentParameterFilterExpression + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.SegmentParameterFilterExpression; + + /** + * Creates a plain object from a SegmentParameterFilterExpression message. Also converts values to other types if specified. + * @param message SegmentParameterFilterExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.SegmentParameterFilterExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SegmentParameterFilterExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SegmentParameterFilterExpression + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SegmentParameterFilterExpressionList. */ + interface ISegmentParameterFilterExpressionList { + + /** SegmentParameterFilterExpressionList expressions */ + expressions?: (google.analytics.data.v1alpha.ISegmentParameterFilterExpression[]|null); + } + + /** Represents a SegmentParameterFilterExpressionList. */ + class SegmentParameterFilterExpressionList implements ISegmentParameterFilterExpressionList { + + /** + * Constructs a new SegmentParameterFilterExpressionList. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList); + + /** SegmentParameterFilterExpressionList expressions. */ + public expressions: google.analytics.data.v1alpha.ISegmentParameterFilterExpression[]; + + /** + * Creates a new SegmentParameterFilterExpressionList instance using the specified properties. + * @param [properties] Properties to set + * @returns SegmentParameterFilterExpressionList instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList): google.analytics.data.v1alpha.SegmentParameterFilterExpressionList; + + /** + * Encodes the specified SegmentParameterFilterExpressionList message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.verify|verify} messages. + * @param message SegmentParameterFilterExpressionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SegmentParameterFilterExpressionList message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.verify|verify} messages. + * @param message SegmentParameterFilterExpressionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SegmentParameterFilterExpressionList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SegmentParameterFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.SegmentParameterFilterExpressionList; + + /** + * Decodes a SegmentParameterFilterExpressionList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SegmentParameterFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.SegmentParameterFilterExpressionList; + + /** + * Verifies a SegmentParameterFilterExpressionList 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 SegmentParameterFilterExpressionList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SegmentParameterFilterExpressionList + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.SegmentParameterFilterExpressionList; + + /** + * Creates a plain object from a SegmentParameterFilterExpressionList message. Also converts values to other types if specified. + * @param message SegmentParameterFilterExpressionList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.SegmentParameterFilterExpressionList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SegmentParameterFilterExpressionList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SegmentParameterFilterExpressionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SegmentParameterFilter. */ + interface ISegmentParameterFilter { + + /** SegmentParameterFilter eventParameterName */ + eventParameterName?: (string|null); + + /** SegmentParameterFilter itemParameterName */ + itemParameterName?: (string|null); + + /** SegmentParameterFilter stringFilter */ + stringFilter?: (google.analytics.data.v1alpha.IStringFilter|null); + + /** SegmentParameterFilter inListFilter */ + inListFilter?: (google.analytics.data.v1alpha.IInListFilter|null); + + /** SegmentParameterFilter numericFilter */ + numericFilter?: (google.analytics.data.v1alpha.INumericFilter|null); + + /** SegmentParameterFilter betweenFilter */ + betweenFilter?: (google.analytics.data.v1alpha.IBetweenFilter|null); + + /** SegmentParameterFilter filterScoping */ + filterScoping?: (google.analytics.data.v1alpha.ISegmentParameterFilterScoping|null); + } + + /** Represents a SegmentParameterFilter. */ + class SegmentParameterFilter implements ISegmentParameterFilter { + + /** + * Constructs a new SegmentParameterFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISegmentParameterFilter); + + /** SegmentParameterFilter eventParameterName. */ + public eventParameterName?: (string|null); + + /** SegmentParameterFilter itemParameterName. */ + public itemParameterName?: (string|null); + + /** SegmentParameterFilter stringFilter. */ + public stringFilter?: (google.analytics.data.v1alpha.IStringFilter|null); + + /** SegmentParameterFilter inListFilter. */ + public inListFilter?: (google.analytics.data.v1alpha.IInListFilter|null); + + /** SegmentParameterFilter numericFilter. */ + public numericFilter?: (google.analytics.data.v1alpha.INumericFilter|null); + + /** SegmentParameterFilter betweenFilter. */ + public betweenFilter?: (google.analytics.data.v1alpha.IBetweenFilter|null); + + /** SegmentParameterFilter filterScoping. */ + public filterScoping?: (google.analytics.data.v1alpha.ISegmentParameterFilterScoping|null); + + /** SegmentParameterFilter oneParameter. */ + public oneParameter?: ("eventParameterName"|"itemParameterName"); + + /** SegmentParameterFilter oneFilter. */ + public oneFilter?: ("stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"); + + /** + * Creates a new SegmentParameterFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns SegmentParameterFilter instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISegmentParameterFilter): google.analytics.data.v1alpha.SegmentParameterFilter; + + /** + * Encodes the specified SegmentParameterFilter message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilter.verify|verify} messages. + * @param message SegmentParameterFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISegmentParameterFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SegmentParameterFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilter.verify|verify} messages. + * @param message SegmentParameterFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISegmentParameterFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SegmentParameterFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SegmentParameterFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.SegmentParameterFilter; + + /** + * Decodes a SegmentParameterFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SegmentParameterFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.SegmentParameterFilter; + + /** + * Verifies a SegmentParameterFilter 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 SegmentParameterFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SegmentParameterFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.SegmentParameterFilter; + + /** + * Creates a plain object from a SegmentParameterFilter message. Also converts values to other types if specified. + * @param message SegmentParameterFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.SegmentParameterFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SegmentParameterFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SegmentParameterFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SegmentParameterFilterScoping. */ + interface ISegmentParameterFilterScoping { + + /** SegmentParameterFilterScoping inAnyNDayPeriod */ + inAnyNDayPeriod?: (number|Long|string|null); + } + + /** Represents a SegmentParameterFilterScoping. */ + class SegmentParameterFilterScoping implements ISegmentParameterFilterScoping { + + /** + * Constructs a new SegmentParameterFilterScoping. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISegmentParameterFilterScoping); + + /** SegmentParameterFilterScoping inAnyNDayPeriod. */ + public inAnyNDayPeriod?: (number|Long|string|null); + + /** SegmentParameterFilterScoping _inAnyNDayPeriod. */ + public _inAnyNDayPeriod?: "inAnyNDayPeriod"; + + /** + * Creates a new SegmentParameterFilterScoping instance using the specified properties. + * @param [properties] Properties to set + * @returns SegmentParameterFilterScoping instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISegmentParameterFilterScoping): google.analytics.data.v1alpha.SegmentParameterFilterScoping; + + /** + * Encodes the specified SegmentParameterFilterScoping message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilterScoping.verify|verify} messages. + * @param message SegmentParameterFilterScoping message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISegmentParameterFilterScoping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SegmentParameterFilterScoping message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilterScoping.verify|verify} messages. + * @param message SegmentParameterFilterScoping message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISegmentParameterFilterScoping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SegmentParameterFilterScoping message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SegmentParameterFilterScoping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.SegmentParameterFilterScoping; + + /** + * Decodes a SegmentParameterFilterScoping message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SegmentParameterFilterScoping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.SegmentParameterFilterScoping; + + /** + * Verifies a SegmentParameterFilterScoping 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 SegmentParameterFilterScoping message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SegmentParameterFilterScoping + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.SegmentParameterFilterScoping; + + /** + * Creates a plain object from a SegmentParameterFilterScoping message. Also converts values to other types if specified. + * @param message SegmentParameterFilterScoping + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.SegmentParameterFilterScoping, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SegmentParameterFilterScoping to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SegmentParameterFilterScoping + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunnelFilterExpression. */ + interface IFunnelFilterExpression { + + /** FunnelFilterExpression andGroup */ + andGroup?: (google.analytics.data.v1alpha.IFunnelFilterExpressionList|null); + + /** FunnelFilterExpression orGroup */ + orGroup?: (google.analytics.data.v1alpha.IFunnelFilterExpressionList|null); + + /** FunnelFilterExpression notExpression */ + notExpression?: (google.analytics.data.v1alpha.IFunnelFilterExpression|null); + + /** FunnelFilterExpression funnelFieldFilter */ + funnelFieldFilter?: (google.analytics.data.v1alpha.IFunnelFieldFilter|null); + + /** FunnelFilterExpression funnelEventFilter */ + funnelEventFilter?: (google.analytics.data.v1alpha.IFunnelEventFilter|null); + } + + /** Represents a FunnelFilterExpression. */ + class FunnelFilterExpression implements IFunnelFilterExpression { + + /** + * Constructs a new FunnelFilterExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFunnelFilterExpression); + + /** FunnelFilterExpression andGroup. */ + public andGroup?: (google.analytics.data.v1alpha.IFunnelFilterExpressionList|null); + + /** FunnelFilterExpression orGroup. */ + public orGroup?: (google.analytics.data.v1alpha.IFunnelFilterExpressionList|null); + + /** FunnelFilterExpression notExpression. */ + public notExpression?: (google.analytics.data.v1alpha.IFunnelFilterExpression|null); + + /** FunnelFilterExpression funnelFieldFilter. */ + public funnelFieldFilter?: (google.analytics.data.v1alpha.IFunnelFieldFilter|null); + + /** FunnelFilterExpression funnelEventFilter. */ + public funnelEventFilter?: (google.analytics.data.v1alpha.IFunnelEventFilter|null); + + /** FunnelFilterExpression expr. */ + public expr?: ("andGroup"|"orGroup"|"notExpression"|"funnelFieldFilter"|"funnelEventFilter"); + + /** + * Creates a new FunnelFilterExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns FunnelFilterExpression instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFunnelFilterExpression): google.analytics.data.v1alpha.FunnelFilterExpression; + + /** + * Encodes the specified FunnelFilterExpression message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFilterExpression.verify|verify} messages. + * @param message FunnelFilterExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFunnelFilterExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunnelFilterExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFilterExpression.verify|verify} messages. + * @param message FunnelFilterExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnelFilterExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunnelFilterExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunnelFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FunnelFilterExpression; + + /** + * Decodes a FunnelFilterExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunnelFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FunnelFilterExpression; + + /** + * Verifies a FunnelFilterExpression 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 FunnelFilterExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunnelFilterExpression + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FunnelFilterExpression; + + /** + * Creates a plain object from a FunnelFilterExpression message. Also converts values to other types if specified. + * @param message FunnelFilterExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.FunnelFilterExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunnelFilterExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunnelFilterExpression + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunnelFilterExpressionList. */ + interface IFunnelFilterExpressionList { + + /** FunnelFilterExpressionList expressions */ + expressions?: (google.analytics.data.v1alpha.IFunnelFilterExpression[]|null); + } + + /** Represents a FunnelFilterExpressionList. */ + class FunnelFilterExpressionList implements IFunnelFilterExpressionList { + + /** + * Constructs a new FunnelFilterExpressionList. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFunnelFilterExpressionList); + + /** FunnelFilterExpressionList expressions. */ + public expressions: google.analytics.data.v1alpha.IFunnelFilterExpression[]; + + /** + * Creates a new FunnelFilterExpressionList instance using the specified properties. + * @param [properties] Properties to set + * @returns FunnelFilterExpressionList instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFunnelFilterExpressionList): google.analytics.data.v1alpha.FunnelFilterExpressionList; + + /** + * Encodes the specified FunnelFilterExpressionList message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFilterExpressionList.verify|verify} messages. + * @param message FunnelFilterExpressionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFunnelFilterExpressionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunnelFilterExpressionList message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFilterExpressionList.verify|verify} messages. + * @param message FunnelFilterExpressionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnelFilterExpressionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunnelFilterExpressionList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunnelFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FunnelFilterExpressionList; + + /** + * Decodes a FunnelFilterExpressionList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunnelFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FunnelFilterExpressionList; + + /** + * Verifies a FunnelFilterExpressionList 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 FunnelFilterExpressionList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunnelFilterExpressionList + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FunnelFilterExpressionList; + + /** + * Creates a plain object from a FunnelFilterExpressionList message. Also converts values to other types if specified. + * @param message FunnelFilterExpressionList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.FunnelFilterExpressionList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunnelFilterExpressionList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunnelFilterExpressionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunnelFieldFilter. */ + interface IFunnelFieldFilter { + + /** FunnelFieldFilter fieldName */ + fieldName?: (string|null); + + /** FunnelFieldFilter stringFilter */ + stringFilter?: (google.analytics.data.v1alpha.IStringFilter|null); + + /** FunnelFieldFilter inListFilter */ + inListFilter?: (google.analytics.data.v1alpha.IInListFilter|null); + + /** FunnelFieldFilter numericFilter */ + numericFilter?: (google.analytics.data.v1alpha.INumericFilter|null); + + /** FunnelFieldFilter betweenFilter */ + betweenFilter?: (google.analytics.data.v1alpha.IBetweenFilter|null); + } + + /** Represents a FunnelFieldFilter. */ + class FunnelFieldFilter implements IFunnelFieldFilter { + + /** + * Constructs a new FunnelFieldFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFunnelFieldFilter); + + /** FunnelFieldFilter fieldName. */ + public fieldName: string; + + /** FunnelFieldFilter stringFilter. */ + public stringFilter?: (google.analytics.data.v1alpha.IStringFilter|null); + + /** FunnelFieldFilter inListFilter. */ + public inListFilter?: (google.analytics.data.v1alpha.IInListFilter|null); + + /** FunnelFieldFilter numericFilter. */ + public numericFilter?: (google.analytics.data.v1alpha.INumericFilter|null); + + /** FunnelFieldFilter betweenFilter. */ + public betweenFilter?: (google.analytics.data.v1alpha.IBetweenFilter|null); + + /** FunnelFieldFilter oneFilter. */ + public oneFilter?: ("stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"); + + /** + * Creates a new FunnelFieldFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns FunnelFieldFilter instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFunnelFieldFilter): google.analytics.data.v1alpha.FunnelFieldFilter; + + /** + * Encodes the specified FunnelFieldFilter message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFieldFilter.verify|verify} messages. + * @param message FunnelFieldFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFunnelFieldFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunnelFieldFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFieldFilter.verify|verify} messages. + * @param message FunnelFieldFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnelFieldFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunnelFieldFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunnelFieldFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FunnelFieldFilter; + + /** + * Decodes a FunnelFieldFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunnelFieldFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FunnelFieldFilter; + + /** + * Verifies a FunnelFieldFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FunnelFieldFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunnelFieldFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FunnelFieldFilter; + + /** + * Creates a plain object from a FunnelFieldFilter message. Also converts values to other types if specified. + * @param message FunnelFieldFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.FunnelFieldFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunnelFieldFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunnelFieldFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunnelEventFilter. */ + interface IFunnelEventFilter { + + /** FunnelEventFilter eventName */ + eventName?: (string|null); + + /** FunnelEventFilter funnelParameterFilterExpression */ + funnelParameterFilterExpression?: (google.analytics.data.v1alpha.IFunnelParameterFilterExpression|null); + } + + /** Represents a FunnelEventFilter. */ + class FunnelEventFilter implements IFunnelEventFilter { + + /** + * Constructs a new FunnelEventFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFunnelEventFilter); + + /** FunnelEventFilter eventName. */ + public eventName?: (string|null); + + /** FunnelEventFilter funnelParameterFilterExpression. */ + public funnelParameterFilterExpression?: (google.analytics.data.v1alpha.IFunnelParameterFilterExpression|null); + + /** FunnelEventFilter _eventName. */ + public _eventName?: "eventName"; + + /** FunnelEventFilter _funnelParameterFilterExpression. */ + public _funnelParameterFilterExpression?: "funnelParameterFilterExpression"; + + /** + * Creates a new FunnelEventFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns FunnelEventFilter instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFunnelEventFilter): google.analytics.data.v1alpha.FunnelEventFilter; + + /** + * Encodes the specified FunnelEventFilter message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelEventFilter.verify|verify} messages. + * @param message FunnelEventFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFunnelEventFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunnelEventFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelEventFilter.verify|verify} messages. + * @param message FunnelEventFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnelEventFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunnelEventFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunnelEventFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FunnelEventFilter; + + /** + * Decodes a FunnelEventFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunnelEventFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FunnelEventFilter; + + /** + * Verifies a FunnelEventFilter 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 FunnelEventFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunnelEventFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FunnelEventFilter; + + /** + * Creates a plain object from a FunnelEventFilter message. Also converts values to other types if specified. + * @param message FunnelEventFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.FunnelEventFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunnelEventFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunnelEventFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunnelParameterFilterExpression. */ + interface IFunnelParameterFilterExpression { + + /** FunnelParameterFilterExpression andGroup */ + andGroup?: (google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList|null); + + /** FunnelParameterFilterExpression orGroup */ + orGroup?: (google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList|null); + + /** FunnelParameterFilterExpression notExpression */ + notExpression?: (google.analytics.data.v1alpha.IFunnelParameterFilterExpression|null); + + /** FunnelParameterFilterExpression funnelParameterFilter */ + funnelParameterFilter?: (google.analytics.data.v1alpha.IFunnelParameterFilter|null); + } + + /** Represents a FunnelParameterFilterExpression. */ + class FunnelParameterFilterExpression implements IFunnelParameterFilterExpression { + + /** + * Constructs a new FunnelParameterFilterExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFunnelParameterFilterExpression); + + /** FunnelParameterFilterExpression andGroup. */ + public andGroup?: (google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList|null); + + /** FunnelParameterFilterExpression orGroup. */ + public orGroup?: (google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList|null); + + /** FunnelParameterFilterExpression notExpression. */ + public notExpression?: (google.analytics.data.v1alpha.IFunnelParameterFilterExpression|null); + + /** FunnelParameterFilterExpression funnelParameterFilter. */ + public funnelParameterFilter?: (google.analytics.data.v1alpha.IFunnelParameterFilter|null); + + /** FunnelParameterFilterExpression expr. */ + public expr?: ("andGroup"|"orGroup"|"notExpression"|"funnelParameterFilter"); + + /** + * Creates a new FunnelParameterFilterExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns FunnelParameterFilterExpression instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFunnelParameterFilterExpression): google.analytics.data.v1alpha.FunnelParameterFilterExpression; + + /** + * Encodes the specified FunnelParameterFilterExpression message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelParameterFilterExpression.verify|verify} messages. + * @param message FunnelParameterFilterExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFunnelParameterFilterExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunnelParameterFilterExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelParameterFilterExpression.verify|verify} messages. + * @param message FunnelParameterFilterExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnelParameterFilterExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunnelParameterFilterExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunnelParameterFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FunnelParameterFilterExpression; + + /** + * Decodes a FunnelParameterFilterExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunnelParameterFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FunnelParameterFilterExpression; + + /** + * Verifies a FunnelParameterFilterExpression 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 FunnelParameterFilterExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunnelParameterFilterExpression + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FunnelParameterFilterExpression; + + /** + * Creates a plain object from a FunnelParameterFilterExpression message. Also converts values to other types if specified. + * @param message FunnelParameterFilterExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.FunnelParameterFilterExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunnelParameterFilterExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunnelParameterFilterExpression + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunnelParameterFilterExpressionList. */ + interface IFunnelParameterFilterExpressionList { + + /** FunnelParameterFilterExpressionList expressions */ + expressions?: (google.analytics.data.v1alpha.IFunnelParameterFilterExpression[]|null); + } + + /** Represents a FunnelParameterFilterExpressionList. */ + class FunnelParameterFilterExpressionList implements IFunnelParameterFilterExpressionList { + + /** + * Constructs a new FunnelParameterFilterExpressionList. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList); + + /** FunnelParameterFilterExpressionList expressions. */ + public expressions: google.analytics.data.v1alpha.IFunnelParameterFilterExpression[]; + + /** + * Creates a new FunnelParameterFilterExpressionList instance using the specified properties. + * @param [properties] Properties to set + * @returns FunnelParameterFilterExpressionList instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList): google.analytics.data.v1alpha.FunnelParameterFilterExpressionList; + + /** + * Encodes the specified FunnelParameterFilterExpressionList message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.verify|verify} messages. + * @param message FunnelParameterFilterExpressionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunnelParameterFilterExpressionList message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.verify|verify} messages. + * @param message FunnelParameterFilterExpressionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunnelParameterFilterExpressionList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunnelParameterFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FunnelParameterFilterExpressionList; + + /** + * Decodes a FunnelParameterFilterExpressionList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunnelParameterFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FunnelParameterFilterExpressionList; + + /** + * Verifies a FunnelParameterFilterExpressionList 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 FunnelParameterFilterExpressionList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunnelParameterFilterExpressionList + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FunnelParameterFilterExpressionList; + + /** + * Creates a plain object from a FunnelParameterFilterExpressionList message. Also converts values to other types if specified. + * @param message FunnelParameterFilterExpressionList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.FunnelParameterFilterExpressionList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunnelParameterFilterExpressionList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunnelParameterFilterExpressionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunnelParameterFilter. */ + interface IFunnelParameterFilter { + + /** FunnelParameterFilter eventParameterName */ + eventParameterName?: (string|null); + + /** FunnelParameterFilter itemParameterName */ + itemParameterName?: (string|null); + + /** FunnelParameterFilter stringFilter */ + stringFilter?: (google.analytics.data.v1alpha.IStringFilter|null); + + /** FunnelParameterFilter inListFilter */ + inListFilter?: (google.analytics.data.v1alpha.IInListFilter|null); + + /** FunnelParameterFilter numericFilter */ + numericFilter?: (google.analytics.data.v1alpha.INumericFilter|null); + + /** FunnelParameterFilter betweenFilter */ + betweenFilter?: (google.analytics.data.v1alpha.IBetweenFilter|null); + } + + /** Represents a FunnelParameterFilter. */ + class FunnelParameterFilter implements IFunnelParameterFilter { + + /** + * Constructs a new FunnelParameterFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFunnelParameterFilter); + + /** FunnelParameterFilter eventParameterName. */ + public eventParameterName?: (string|null); + + /** FunnelParameterFilter itemParameterName. */ + public itemParameterName?: (string|null); + + /** FunnelParameterFilter stringFilter. */ + public stringFilter?: (google.analytics.data.v1alpha.IStringFilter|null); + + /** FunnelParameterFilter inListFilter. */ + public inListFilter?: (google.analytics.data.v1alpha.IInListFilter|null); + + /** FunnelParameterFilter numericFilter. */ + public numericFilter?: (google.analytics.data.v1alpha.INumericFilter|null); + + /** FunnelParameterFilter betweenFilter. */ + public betweenFilter?: (google.analytics.data.v1alpha.IBetweenFilter|null); + + /** FunnelParameterFilter oneParameter. */ + public oneParameter?: ("eventParameterName"|"itemParameterName"); + + /** FunnelParameterFilter oneFilter. */ + public oneFilter?: ("stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"); + + /** + * Creates a new FunnelParameterFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns FunnelParameterFilter instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFunnelParameterFilter): google.analytics.data.v1alpha.FunnelParameterFilter; + + /** + * Encodes the specified FunnelParameterFilter message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelParameterFilter.verify|verify} messages. + * @param message FunnelParameterFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFunnelParameterFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunnelParameterFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelParameterFilter.verify|verify} messages. + * @param message FunnelParameterFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnelParameterFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunnelParameterFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunnelParameterFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FunnelParameterFilter; + + /** + * Decodes a FunnelParameterFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunnelParameterFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FunnelParameterFilter; + + /** + * Verifies a FunnelParameterFilter 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 FunnelParameterFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunnelParameterFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FunnelParameterFilter; + + /** + * Creates a plain object from a FunnelParameterFilter message. Also converts values to other types if specified. + * @param message FunnelParameterFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.FunnelParameterFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunnelParameterFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunnelParameterFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunnelResponseMetadata. */ + interface IFunnelResponseMetadata { + + /** FunnelResponseMetadata samplingMetadatas */ + samplingMetadatas?: (google.analytics.data.v1alpha.ISamplingMetadata[]|null); + } + + /** Represents a FunnelResponseMetadata. */ + class FunnelResponseMetadata implements IFunnelResponseMetadata { + + /** + * Constructs a new FunnelResponseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.IFunnelResponseMetadata); + + /** FunnelResponseMetadata samplingMetadatas. */ + public samplingMetadatas: google.analytics.data.v1alpha.ISamplingMetadata[]; + + /** + * Creates a new FunnelResponseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns FunnelResponseMetadata instance + */ + public static create(properties?: google.analytics.data.v1alpha.IFunnelResponseMetadata): google.analytics.data.v1alpha.FunnelResponseMetadata; + + /** + * Encodes the specified FunnelResponseMetadata message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelResponseMetadata.verify|verify} messages. + * @param message FunnelResponseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.IFunnelResponseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunnelResponseMetadata message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelResponseMetadata.verify|verify} messages. + * @param message FunnelResponseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.IFunnelResponseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunnelResponseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunnelResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.FunnelResponseMetadata; + + /** + * Decodes a FunnelResponseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunnelResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.FunnelResponseMetadata; + + /** + * Verifies a FunnelResponseMetadata 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 FunnelResponseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunnelResponseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.FunnelResponseMetadata; + + /** + * Creates a plain object from a FunnelResponseMetadata message. Also converts values to other types if specified. + * @param message FunnelResponseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.FunnelResponseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunnelResponseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunnelResponseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SamplingMetadata. */ + interface ISamplingMetadata { + + /** SamplingMetadata samplesReadCount */ + samplesReadCount?: (number|Long|string|null); + + /** SamplingMetadata samplingSpaceSize */ + samplingSpaceSize?: (number|Long|string|null); + } + + /** Represents a SamplingMetadata. */ + class SamplingMetadata implements ISamplingMetadata { + + /** + * Constructs a new SamplingMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1alpha.ISamplingMetadata); + + /** SamplingMetadata samplesReadCount. */ + public samplesReadCount: (number|Long|string); + + /** SamplingMetadata samplingSpaceSize. */ + public samplingSpaceSize: (number|Long|string); + + /** + * Creates a new SamplingMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns SamplingMetadata instance + */ + public static create(properties?: google.analytics.data.v1alpha.ISamplingMetadata): google.analytics.data.v1alpha.SamplingMetadata; + + /** + * Encodes the specified SamplingMetadata message. Does not implicitly {@link google.analytics.data.v1alpha.SamplingMetadata.verify|verify} messages. + * @param message SamplingMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1alpha.ISamplingMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SamplingMetadata message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SamplingMetadata.verify|verify} messages. + * @param message SamplingMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1alpha.ISamplingMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SamplingMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SamplingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1alpha.SamplingMetadata; + + /** + * Decodes a SamplingMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SamplingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1alpha.SamplingMetadata; + + /** + * Verifies a SamplingMetadata 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 SamplingMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SamplingMetadata + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1alpha.SamplingMetadata; + + /** + * Creates a plain object from a SamplingMetadata message. Also converts values to other types if specified. + * @param message SamplingMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1alpha.SamplingMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SamplingMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SamplingMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** MetricType enum. */ + enum MetricType { + METRIC_TYPE_UNSPECIFIED = 0, + TYPE_INTEGER = 1, + TYPE_FLOAT = 2, + TYPE_SECONDS = 4, + TYPE_MILLISECONDS = 5, + TYPE_MINUTES = 6, + TYPE_HOURS = 7, + TYPE_STANDARD = 8, + TYPE_CURRENCY = 9, + TYPE_FEET = 10, + TYPE_MILES = 11, + TYPE_METERS = 12, + TYPE_KILOMETERS = 13 + } + } + + /** Namespace v1beta. */ + namespace v1beta { + + /** Represents a BetaAnalyticsData */ + class BetaAnalyticsData extends $protobuf.rpc.Service { + + /** + * Constructs a new BetaAnalyticsData service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new BetaAnalyticsData service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): BetaAnalyticsData; + + /** + * Calls RunReport. + * @param request RunReportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RunReportResponse + */ + public runReport(request: google.analytics.data.v1beta.IRunReportRequest, callback: google.analytics.data.v1beta.BetaAnalyticsData.RunReportCallback): void; + + /** + * Calls RunReport. + * @param request RunReportRequest message or plain object + * @returns Promise + */ + public runReport(request: google.analytics.data.v1beta.IRunReportRequest): Promise; + + /** + * Calls RunPivotReport. + * @param request RunPivotReportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RunPivotReportResponse + */ + public runPivotReport(request: google.analytics.data.v1beta.IRunPivotReportRequest, callback: google.analytics.data.v1beta.BetaAnalyticsData.RunPivotReportCallback): void; + + /** + * Calls RunPivotReport. + * @param request RunPivotReportRequest message or plain object + * @returns Promise + */ + public runPivotReport(request: google.analytics.data.v1beta.IRunPivotReportRequest): Promise; + + /** + * Calls BatchRunReports. + * @param request BatchRunReportsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchRunReportsResponse + */ + public batchRunReports(request: google.analytics.data.v1beta.IBatchRunReportsRequest, callback: google.analytics.data.v1beta.BetaAnalyticsData.BatchRunReportsCallback): void; + + /** + * Calls BatchRunReports. + * @param request BatchRunReportsRequest message or plain object + * @returns Promise + */ + public batchRunReports(request: google.analytics.data.v1beta.IBatchRunReportsRequest): Promise; + + /** + * Calls BatchRunPivotReports. + * @param request BatchRunPivotReportsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchRunPivotReportsResponse + */ + public batchRunPivotReports(request: google.analytics.data.v1beta.IBatchRunPivotReportsRequest, callback: google.analytics.data.v1beta.BetaAnalyticsData.BatchRunPivotReportsCallback): void; + + /** + * Calls BatchRunPivotReports. + * @param request BatchRunPivotReportsRequest message or plain object + * @returns Promise + */ + public batchRunPivotReports(request: google.analytics.data.v1beta.IBatchRunPivotReportsRequest): Promise; + + /** + * Calls GetMetadata. + * @param request GetMetadataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Metadata + */ + public getMetadata(request: google.analytics.data.v1beta.IGetMetadataRequest, callback: google.analytics.data.v1beta.BetaAnalyticsData.GetMetadataCallback): void; + + /** + * Calls GetMetadata. + * @param request GetMetadataRequest message or plain object + * @returns Promise + */ + public getMetadata(request: google.analytics.data.v1beta.IGetMetadataRequest): Promise; + + /** + * Calls RunRealtimeReport. + * @param request RunRealtimeReportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RunRealtimeReportResponse + */ + public runRealtimeReport(request: google.analytics.data.v1beta.IRunRealtimeReportRequest, callback: google.analytics.data.v1beta.BetaAnalyticsData.RunRealtimeReportCallback): void; + + /** + * Calls RunRealtimeReport. + * @param request RunRealtimeReportRequest message or plain object + * @returns Promise + */ + public runRealtimeReport(request: google.analytics.data.v1beta.IRunRealtimeReportRequest): Promise; + + /** + * Calls CheckCompatibility. + * @param request CheckCompatibilityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CheckCompatibilityResponse + */ + public checkCompatibility(request: google.analytics.data.v1beta.ICheckCompatibilityRequest, callback: google.analytics.data.v1beta.BetaAnalyticsData.CheckCompatibilityCallback): void; + + /** + * Calls CheckCompatibility. + * @param request CheckCompatibilityRequest message or plain object + * @returns Promise + */ + public checkCompatibility(request: google.analytics.data.v1beta.ICheckCompatibilityRequest): Promise; + } + + namespace BetaAnalyticsData { + + /** + * Callback as used by {@link google.analytics.data.v1beta.BetaAnalyticsData|runReport}. + * @param error Error, if any + * @param [response] RunReportResponse + */ + type RunReportCallback = (error: (Error|null), response?: google.analytics.data.v1beta.RunReportResponse) => void; + + /** + * Callback as used by {@link google.analytics.data.v1beta.BetaAnalyticsData|runPivotReport}. + * @param error Error, if any + * @param [response] RunPivotReportResponse + */ + type RunPivotReportCallback = (error: (Error|null), response?: google.analytics.data.v1beta.RunPivotReportResponse) => void; + + /** + * Callback as used by {@link google.analytics.data.v1beta.BetaAnalyticsData|batchRunReports}. + * @param error Error, if any + * @param [response] BatchRunReportsResponse + */ + type BatchRunReportsCallback = (error: (Error|null), response?: google.analytics.data.v1beta.BatchRunReportsResponse) => void; + + /** + * Callback as used by {@link google.analytics.data.v1beta.BetaAnalyticsData|batchRunPivotReports}. + * @param error Error, if any + * @param [response] BatchRunPivotReportsResponse + */ + type BatchRunPivotReportsCallback = (error: (Error|null), response?: google.analytics.data.v1beta.BatchRunPivotReportsResponse) => void; + + /** + * Callback as used by {@link google.analytics.data.v1beta.BetaAnalyticsData|getMetadata}. + * @param error Error, if any + * @param [response] Metadata + */ + type GetMetadataCallback = (error: (Error|null), response?: google.analytics.data.v1beta.Metadata) => void; + + /** + * Callback as used by {@link google.analytics.data.v1beta.BetaAnalyticsData|runRealtimeReport}. + * @param error Error, if any + * @param [response] RunRealtimeReportResponse + */ + type RunRealtimeReportCallback = (error: (Error|null), response?: google.analytics.data.v1beta.RunRealtimeReportResponse) => void; + + /** + * Callback as used by {@link google.analytics.data.v1beta.BetaAnalyticsData|checkCompatibility}. + * @param error Error, if any + * @param [response] CheckCompatibilityResponse + */ + type CheckCompatibilityCallback = (error: (Error|null), response?: google.analytics.data.v1beta.CheckCompatibilityResponse) => void; + } + + /** Properties of a CheckCompatibilityRequest. */ + interface ICheckCompatibilityRequest { + + /** CheckCompatibilityRequest property */ + property?: (string|null); + + /** CheckCompatibilityRequest dimensions */ + dimensions?: (google.analytics.data.v1beta.IDimension[]|null); + + /** CheckCompatibilityRequest metrics */ + metrics?: (google.analytics.data.v1beta.IMetric[]|null); + + /** CheckCompatibilityRequest dimensionFilter */ + dimensionFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** CheckCompatibilityRequest metricFilter */ + metricFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** CheckCompatibilityRequest compatibilityFilter */ + compatibilityFilter?: (google.analytics.data.v1beta.Compatibility|keyof typeof google.analytics.data.v1beta.Compatibility|null); + } + + /** Represents a CheckCompatibilityRequest. */ + class CheckCompatibilityRequest implements ICheckCompatibilityRequest { + + /** + * Constructs a new CheckCompatibilityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.ICheckCompatibilityRequest); + + /** CheckCompatibilityRequest property. */ + public property: string; + + /** CheckCompatibilityRequest dimensions. */ + public dimensions: google.analytics.data.v1beta.IDimension[]; + + /** CheckCompatibilityRequest metrics. */ + public metrics: google.analytics.data.v1beta.IMetric[]; + + /** CheckCompatibilityRequest dimensionFilter. */ + public dimensionFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** CheckCompatibilityRequest metricFilter. */ + public metricFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** CheckCompatibilityRequest compatibilityFilter. */ + public compatibilityFilter: (google.analytics.data.v1beta.Compatibility|keyof typeof google.analytics.data.v1beta.Compatibility); + + /** + * Creates a new CheckCompatibilityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckCompatibilityRequest instance + */ + public static create(properties?: google.analytics.data.v1beta.ICheckCompatibilityRequest): google.analytics.data.v1beta.CheckCompatibilityRequest; + + /** + * Encodes the specified CheckCompatibilityRequest message. Does not implicitly {@link google.analytics.data.v1beta.CheckCompatibilityRequest.verify|verify} messages. + * @param message CheckCompatibilityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.ICheckCompatibilityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckCompatibilityRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.CheckCompatibilityRequest.verify|verify} messages. + * @param message CheckCompatibilityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.ICheckCompatibilityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckCompatibilityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckCompatibilityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.CheckCompatibilityRequest; + + /** + * Decodes a CheckCompatibilityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckCompatibilityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.CheckCompatibilityRequest; + + /** + * Verifies a CheckCompatibilityRequest 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 CheckCompatibilityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckCompatibilityRequest + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.CheckCompatibilityRequest; + + /** + * Creates a plain object from a CheckCompatibilityRequest message. Also converts values to other types if specified. + * @param message CheckCompatibilityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.CheckCompatibilityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckCompatibilityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckCompatibilityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckCompatibilityResponse. */ + interface ICheckCompatibilityResponse { + + /** CheckCompatibilityResponse dimensionCompatibilities */ + dimensionCompatibilities?: (google.analytics.data.v1beta.IDimensionCompatibility[]|null); + + /** CheckCompatibilityResponse metricCompatibilities */ + metricCompatibilities?: (google.analytics.data.v1beta.IMetricCompatibility[]|null); + } + + /** Represents a CheckCompatibilityResponse. */ + class CheckCompatibilityResponse implements ICheckCompatibilityResponse { + + /** + * Constructs a new CheckCompatibilityResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.ICheckCompatibilityResponse); + + /** CheckCompatibilityResponse dimensionCompatibilities. */ + public dimensionCompatibilities: google.analytics.data.v1beta.IDimensionCompatibility[]; + + /** CheckCompatibilityResponse metricCompatibilities. */ + public metricCompatibilities: google.analytics.data.v1beta.IMetricCompatibility[]; + + /** + * Creates a new CheckCompatibilityResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckCompatibilityResponse instance + */ + public static create(properties?: google.analytics.data.v1beta.ICheckCompatibilityResponse): google.analytics.data.v1beta.CheckCompatibilityResponse; + + /** + * Encodes the specified CheckCompatibilityResponse message. Does not implicitly {@link google.analytics.data.v1beta.CheckCompatibilityResponse.verify|verify} messages. + * @param message CheckCompatibilityResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.ICheckCompatibilityResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckCompatibilityResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.CheckCompatibilityResponse.verify|verify} messages. + * @param message CheckCompatibilityResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.ICheckCompatibilityResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckCompatibilityResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckCompatibilityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.CheckCompatibilityResponse; + + /** + * Decodes a CheckCompatibilityResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckCompatibilityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.CheckCompatibilityResponse; + + /** + * Verifies a CheckCompatibilityResponse 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 CheckCompatibilityResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckCompatibilityResponse + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.CheckCompatibilityResponse; + + /** + * Creates a plain object from a CheckCompatibilityResponse message. Also converts values to other types if specified. + * @param message CheckCompatibilityResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.CheckCompatibilityResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckCompatibilityResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckCompatibilityResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Metadata. */ + interface IMetadata { + + /** Metadata name */ + name?: (string|null); + + /** Metadata dimensions */ + dimensions?: (google.analytics.data.v1beta.IDimensionMetadata[]|null); + + /** Metadata metrics */ + metrics?: (google.analytics.data.v1beta.IMetricMetadata[]|null); + } + + /** Represents a Metadata. */ + class Metadata implements IMetadata { + + /** + * Constructs a new Metadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IMetadata); + + /** Metadata name. */ + public name: string; + + /** Metadata dimensions. */ + public dimensions: google.analytics.data.v1beta.IDimensionMetadata[]; + + /** Metadata metrics. */ + public metrics: google.analytics.data.v1beta.IMetricMetadata[]; + + /** + * Creates a new Metadata instance using the specified properties. + * @param [properties] Properties to set + * @returns Metadata instance + */ + public static create(properties?: google.analytics.data.v1beta.IMetadata): google.analytics.data.v1beta.Metadata; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.analytics.data.v1beta.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.Metadata; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.Metadata; + + /** + * Verifies a Metadata 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 Metadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metadata + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.Metadata; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @param message Metadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunReportRequest. */ + interface IRunReportRequest { + + /** RunReportRequest property */ + property?: (string|null); + + /** RunReportRequest dimensions */ + dimensions?: (google.analytics.data.v1beta.IDimension[]|null); + + /** RunReportRequest metrics */ + metrics?: (google.analytics.data.v1beta.IMetric[]|null); + + /** RunReportRequest dateRanges */ + dateRanges?: (google.analytics.data.v1beta.IDateRange[]|null); + + /** RunReportRequest dimensionFilter */ + dimensionFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** RunReportRequest metricFilter */ + metricFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** RunReportRequest offset */ + offset?: (number|Long|string|null); + + /** RunReportRequest limit */ + limit?: (number|Long|string|null); + + /** RunReportRequest metricAggregations */ + metricAggregations?: (google.analytics.data.v1beta.MetricAggregation[]|null); + + /** RunReportRequest orderBys */ + orderBys?: (google.analytics.data.v1beta.IOrderBy[]|null); + + /** RunReportRequest currencyCode */ + currencyCode?: (string|null); + + /** RunReportRequest cohortSpec */ + cohortSpec?: (google.analytics.data.v1beta.ICohortSpec|null); + + /** RunReportRequest keepEmptyRows */ + keepEmptyRows?: (boolean|null); + + /** RunReportRequest returnPropertyQuota */ + returnPropertyQuota?: (boolean|null); + } + + /** Represents a RunReportRequest. */ + class RunReportRequest implements IRunReportRequest { + + /** + * Constructs a new RunReportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IRunReportRequest); + + /** RunReportRequest property. */ + public property: string; + + /** RunReportRequest dimensions. */ + public dimensions: google.analytics.data.v1beta.IDimension[]; + + /** RunReportRequest metrics. */ + public metrics: google.analytics.data.v1beta.IMetric[]; + + /** RunReportRequest dateRanges. */ + public dateRanges: google.analytics.data.v1beta.IDateRange[]; + + /** RunReportRequest dimensionFilter. */ + public dimensionFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** RunReportRequest metricFilter. */ + public metricFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** RunReportRequest offset. */ + public offset: (number|Long|string); + + /** RunReportRequest limit. */ + public limit: (number|Long|string); + + /** RunReportRequest metricAggregations. */ + public metricAggregations: google.analytics.data.v1beta.MetricAggregation[]; + + /** RunReportRequest orderBys. */ + public orderBys: google.analytics.data.v1beta.IOrderBy[]; + + /** RunReportRequest currencyCode. */ + public currencyCode: string; + + /** RunReportRequest cohortSpec. */ + public cohortSpec?: (google.analytics.data.v1beta.ICohortSpec|null); + + /** RunReportRequest keepEmptyRows. */ + public keepEmptyRows: boolean; + + /** RunReportRequest returnPropertyQuota. */ + public returnPropertyQuota: boolean; + + /** + * Creates a new RunReportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunReportRequest instance + */ + public static create(properties?: google.analytics.data.v1beta.IRunReportRequest): google.analytics.data.v1beta.RunReportRequest; + + /** + * Encodes the specified RunReportRequest message. Does not implicitly {@link google.analytics.data.v1beta.RunReportRequest.verify|verify} messages. + * @param message RunReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IRunReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunReportRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.RunReportRequest.verify|verify} messages. + * @param message RunReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IRunReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunReportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.RunReportRequest; + + /** + * Decodes a RunReportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.RunReportRequest; + + /** + * Verifies a RunReportRequest 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 RunReportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunReportRequest + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.RunReportRequest; + + /** + * Creates a plain object from a RunReportRequest message. Also converts values to other types if specified. + * @param message RunReportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.RunReportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunReportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunReportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunReportResponse. */ + interface IRunReportResponse { + + /** RunReportResponse dimensionHeaders */ + dimensionHeaders?: (google.analytics.data.v1beta.IDimensionHeader[]|null); + + /** RunReportResponse metricHeaders */ + metricHeaders?: (google.analytics.data.v1beta.IMetricHeader[]|null); + + /** RunReportResponse rows */ + rows?: (google.analytics.data.v1beta.IRow[]|null); + + /** RunReportResponse totals */ + totals?: (google.analytics.data.v1beta.IRow[]|null); + + /** RunReportResponse maximums */ + maximums?: (google.analytics.data.v1beta.IRow[]|null); + + /** RunReportResponse minimums */ + minimums?: (google.analytics.data.v1beta.IRow[]|null); + + /** RunReportResponse rowCount */ + rowCount?: (number|null); + + /** RunReportResponse metadata */ + metadata?: (google.analytics.data.v1beta.IResponseMetaData|null); + + /** RunReportResponse propertyQuota */ + propertyQuota?: (google.analytics.data.v1beta.IPropertyQuota|null); + + /** RunReportResponse kind */ + kind?: (string|null); + } + + /** Represents a RunReportResponse. */ + class RunReportResponse implements IRunReportResponse { + + /** + * Constructs a new RunReportResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IRunReportResponse); + + /** RunReportResponse dimensionHeaders. */ + public dimensionHeaders: google.analytics.data.v1beta.IDimensionHeader[]; + + /** RunReportResponse metricHeaders. */ + public metricHeaders: google.analytics.data.v1beta.IMetricHeader[]; + + /** RunReportResponse rows. */ + public rows: google.analytics.data.v1beta.IRow[]; + + /** RunReportResponse totals. */ + public totals: google.analytics.data.v1beta.IRow[]; + + /** RunReportResponse maximums. */ + public maximums: google.analytics.data.v1beta.IRow[]; + + /** RunReportResponse minimums. */ + public minimums: google.analytics.data.v1beta.IRow[]; + + /** RunReportResponse rowCount. */ + public rowCount: number; + + /** RunReportResponse metadata. */ + public metadata?: (google.analytics.data.v1beta.IResponseMetaData|null); + + /** RunReportResponse propertyQuota. */ + public propertyQuota?: (google.analytics.data.v1beta.IPropertyQuota|null); + + /** RunReportResponse kind. */ + public kind: string; + + /** + * Creates a new RunReportResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunReportResponse instance + */ + public static create(properties?: google.analytics.data.v1beta.IRunReportResponse): google.analytics.data.v1beta.RunReportResponse; + + /** + * Encodes the specified RunReportResponse message. Does not implicitly {@link google.analytics.data.v1beta.RunReportResponse.verify|verify} messages. + * @param message RunReportResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IRunReportResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunReportResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.RunReportResponse.verify|verify} messages. + * @param message RunReportResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IRunReportResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunReportResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.RunReportResponse; + + /** + * Decodes a RunReportResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.RunReportResponse; + + /** + * Verifies a RunReportResponse 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 RunReportResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunReportResponse + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.RunReportResponse; + + /** + * Creates a plain object from a RunReportResponse message. Also converts values to other types if specified. + * @param message RunReportResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.RunReportResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunReportResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunReportResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunPivotReportRequest. */ + interface IRunPivotReportRequest { + + /** RunPivotReportRequest property */ + property?: (string|null); + + /** RunPivotReportRequest dimensions */ + dimensions?: (google.analytics.data.v1beta.IDimension[]|null); + + /** RunPivotReportRequest metrics */ + metrics?: (google.analytics.data.v1beta.IMetric[]|null); + + /** RunPivotReportRequest dateRanges */ + dateRanges?: (google.analytics.data.v1beta.IDateRange[]|null); + + /** RunPivotReportRequest pivots */ + pivots?: (google.analytics.data.v1beta.IPivot[]|null); + + /** RunPivotReportRequest dimensionFilter */ + dimensionFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** RunPivotReportRequest metricFilter */ + metricFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** RunPivotReportRequest currencyCode */ + currencyCode?: (string|null); + + /** RunPivotReportRequest cohortSpec */ + cohortSpec?: (google.analytics.data.v1beta.ICohortSpec|null); + + /** RunPivotReportRequest keepEmptyRows */ + keepEmptyRows?: (boolean|null); + + /** RunPivotReportRequest returnPropertyQuota */ + returnPropertyQuota?: (boolean|null); + } + + /** Represents a RunPivotReportRequest. */ + class RunPivotReportRequest implements IRunPivotReportRequest { + + /** + * Constructs a new RunPivotReportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IRunPivotReportRequest); + + /** RunPivotReportRequest property. */ + public property: string; + + /** RunPivotReportRequest dimensions. */ + public dimensions: google.analytics.data.v1beta.IDimension[]; + + /** RunPivotReportRequest metrics. */ + public metrics: google.analytics.data.v1beta.IMetric[]; + + /** RunPivotReportRequest dateRanges. */ + public dateRanges: google.analytics.data.v1beta.IDateRange[]; + + /** RunPivotReportRequest pivots. */ + public pivots: google.analytics.data.v1beta.IPivot[]; + + /** RunPivotReportRequest dimensionFilter. */ + public dimensionFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** RunPivotReportRequest metricFilter. */ + public metricFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** RunPivotReportRequest currencyCode. */ + public currencyCode: string; + + /** RunPivotReportRequest cohortSpec. */ + public cohortSpec?: (google.analytics.data.v1beta.ICohortSpec|null); + + /** RunPivotReportRequest keepEmptyRows. */ + public keepEmptyRows: boolean; + + /** RunPivotReportRequest returnPropertyQuota. */ + public returnPropertyQuota: boolean; + + /** + * Creates a new RunPivotReportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunPivotReportRequest instance + */ + public static create(properties?: google.analytics.data.v1beta.IRunPivotReportRequest): google.analytics.data.v1beta.RunPivotReportRequest; + + /** + * Encodes the specified RunPivotReportRequest message. Does not implicitly {@link google.analytics.data.v1beta.RunPivotReportRequest.verify|verify} messages. + * @param message RunPivotReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IRunPivotReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunPivotReportRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.RunPivotReportRequest.verify|verify} messages. + * @param message RunPivotReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IRunPivotReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunPivotReportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunPivotReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.RunPivotReportRequest; + + /** + * Decodes a RunPivotReportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunPivotReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.RunPivotReportRequest; + + /** + * Verifies a RunPivotReportRequest 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 RunPivotReportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunPivotReportRequest + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.RunPivotReportRequest; + + /** + * Creates a plain object from a RunPivotReportRequest message. Also converts values to other types if specified. + * @param message RunPivotReportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.RunPivotReportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunPivotReportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunPivotReportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunPivotReportResponse. */ + interface IRunPivotReportResponse { + + /** RunPivotReportResponse pivotHeaders */ + pivotHeaders?: (google.analytics.data.v1beta.IPivotHeader[]|null); + + /** RunPivotReportResponse dimensionHeaders */ + dimensionHeaders?: (google.analytics.data.v1beta.IDimensionHeader[]|null); + + /** RunPivotReportResponse metricHeaders */ + metricHeaders?: (google.analytics.data.v1beta.IMetricHeader[]|null); + + /** RunPivotReportResponse rows */ + rows?: (google.analytics.data.v1beta.IRow[]|null); + + /** RunPivotReportResponse aggregates */ + aggregates?: (google.analytics.data.v1beta.IRow[]|null); + + /** RunPivotReportResponse metadata */ + metadata?: (google.analytics.data.v1beta.IResponseMetaData|null); + + /** RunPivotReportResponse propertyQuota */ + propertyQuota?: (google.analytics.data.v1beta.IPropertyQuota|null); + + /** RunPivotReportResponse kind */ + kind?: (string|null); + } + + /** Represents a RunPivotReportResponse. */ + class RunPivotReportResponse implements IRunPivotReportResponse { + + /** + * Constructs a new RunPivotReportResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IRunPivotReportResponse); + + /** RunPivotReportResponse pivotHeaders. */ + public pivotHeaders: google.analytics.data.v1beta.IPivotHeader[]; + + /** RunPivotReportResponse dimensionHeaders. */ + public dimensionHeaders: google.analytics.data.v1beta.IDimensionHeader[]; + + /** RunPivotReportResponse metricHeaders. */ + public metricHeaders: google.analytics.data.v1beta.IMetricHeader[]; + + /** RunPivotReportResponse rows. */ + public rows: google.analytics.data.v1beta.IRow[]; + + /** RunPivotReportResponse aggregates. */ + public aggregates: google.analytics.data.v1beta.IRow[]; + + /** RunPivotReportResponse metadata. */ + public metadata?: (google.analytics.data.v1beta.IResponseMetaData|null); + + /** RunPivotReportResponse propertyQuota. */ + public propertyQuota?: (google.analytics.data.v1beta.IPropertyQuota|null); + + /** RunPivotReportResponse kind. */ + public kind: string; + + /** + * Creates a new RunPivotReportResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunPivotReportResponse instance + */ + public static create(properties?: google.analytics.data.v1beta.IRunPivotReportResponse): google.analytics.data.v1beta.RunPivotReportResponse; + + /** + * Encodes the specified RunPivotReportResponse message. Does not implicitly {@link google.analytics.data.v1beta.RunPivotReportResponse.verify|verify} messages. + * @param message RunPivotReportResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IRunPivotReportResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunPivotReportResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.RunPivotReportResponse.verify|verify} messages. + * @param message RunPivotReportResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IRunPivotReportResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunPivotReportResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunPivotReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.RunPivotReportResponse; + + /** + * Decodes a RunPivotReportResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunPivotReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.RunPivotReportResponse; + + /** + * Verifies a RunPivotReportResponse 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 RunPivotReportResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunPivotReportResponse + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.RunPivotReportResponse; + + /** + * Creates a plain object from a RunPivotReportResponse message. Also converts values to other types if specified. + * @param message RunPivotReportResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.RunPivotReportResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunPivotReportResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunPivotReportResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRunReportsRequest. */ + interface IBatchRunReportsRequest { + + /** BatchRunReportsRequest property */ + property?: (string|null); + + /** BatchRunReportsRequest requests */ + requests?: (google.analytics.data.v1beta.IRunReportRequest[]|null); + } + + /** Represents a BatchRunReportsRequest. */ + class BatchRunReportsRequest implements IBatchRunReportsRequest { + + /** + * Constructs a new BatchRunReportsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IBatchRunReportsRequest); + + /** BatchRunReportsRequest property. */ + public property: string; + + /** BatchRunReportsRequest requests. */ + public requests: google.analytics.data.v1beta.IRunReportRequest[]; + + /** + * Creates a new BatchRunReportsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRunReportsRequest instance + */ + public static create(properties?: google.analytics.data.v1beta.IBatchRunReportsRequest): google.analytics.data.v1beta.BatchRunReportsRequest; + + /** + * Encodes the specified BatchRunReportsRequest message. Does not implicitly {@link google.analytics.data.v1beta.BatchRunReportsRequest.verify|verify} messages. + * @param message BatchRunReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IBatchRunReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRunReportsRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.BatchRunReportsRequest.verify|verify} messages. + * @param message BatchRunReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IBatchRunReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRunReportsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRunReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.BatchRunReportsRequest; + + /** + * Decodes a BatchRunReportsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRunReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.BatchRunReportsRequest; + + /** + * Verifies a BatchRunReportsRequest 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 BatchRunReportsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRunReportsRequest + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.BatchRunReportsRequest; + + /** + * Creates a plain object from a BatchRunReportsRequest message. Also converts values to other types if specified. + * @param message BatchRunReportsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.BatchRunReportsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRunReportsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRunReportsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRunReportsResponse. */ + interface IBatchRunReportsResponse { + + /** BatchRunReportsResponse reports */ + reports?: (google.analytics.data.v1beta.IRunReportResponse[]|null); + + /** BatchRunReportsResponse kind */ + kind?: (string|null); + } + + /** Represents a BatchRunReportsResponse. */ + class BatchRunReportsResponse implements IBatchRunReportsResponse { + + /** + * Constructs a new BatchRunReportsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IBatchRunReportsResponse); + + /** BatchRunReportsResponse reports. */ + public reports: google.analytics.data.v1beta.IRunReportResponse[]; + + /** BatchRunReportsResponse kind. */ + public kind: string; + + /** + * Creates a new BatchRunReportsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRunReportsResponse instance + */ + public static create(properties?: google.analytics.data.v1beta.IBatchRunReportsResponse): google.analytics.data.v1beta.BatchRunReportsResponse; + + /** + * Encodes the specified BatchRunReportsResponse message. Does not implicitly {@link google.analytics.data.v1beta.BatchRunReportsResponse.verify|verify} messages. + * @param message BatchRunReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IBatchRunReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRunReportsResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.BatchRunReportsResponse.verify|verify} messages. + * @param message BatchRunReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IBatchRunReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRunReportsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRunReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.BatchRunReportsResponse; + + /** + * Decodes a BatchRunReportsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRunReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.BatchRunReportsResponse; + + /** + * Verifies a BatchRunReportsResponse 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 BatchRunReportsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRunReportsResponse + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.BatchRunReportsResponse; + + /** + * Creates a plain object from a BatchRunReportsResponse message. Also converts values to other types if specified. + * @param message BatchRunReportsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.BatchRunReportsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRunReportsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRunReportsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRunPivotReportsRequest. */ + interface IBatchRunPivotReportsRequest { + + /** BatchRunPivotReportsRequest property */ + property?: (string|null); + + /** BatchRunPivotReportsRequest requests */ + requests?: (google.analytics.data.v1beta.IRunPivotReportRequest[]|null); + } + + /** Represents a BatchRunPivotReportsRequest. */ + class BatchRunPivotReportsRequest implements IBatchRunPivotReportsRequest { + + /** + * Constructs a new BatchRunPivotReportsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IBatchRunPivotReportsRequest); + + /** BatchRunPivotReportsRequest property. */ + public property: string; + + /** BatchRunPivotReportsRequest requests. */ + public requests: google.analytics.data.v1beta.IRunPivotReportRequest[]; + + /** + * Creates a new BatchRunPivotReportsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRunPivotReportsRequest instance + */ + public static create(properties?: google.analytics.data.v1beta.IBatchRunPivotReportsRequest): google.analytics.data.v1beta.BatchRunPivotReportsRequest; + + /** + * Encodes the specified BatchRunPivotReportsRequest message. Does not implicitly {@link google.analytics.data.v1beta.BatchRunPivotReportsRequest.verify|verify} messages. + * @param message BatchRunPivotReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IBatchRunPivotReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRunPivotReportsRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.BatchRunPivotReportsRequest.verify|verify} messages. + * @param message BatchRunPivotReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IBatchRunPivotReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRunPivotReportsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRunPivotReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.BatchRunPivotReportsRequest; + + /** + * Decodes a BatchRunPivotReportsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRunPivotReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.BatchRunPivotReportsRequest; + + /** + * Verifies a BatchRunPivotReportsRequest 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 BatchRunPivotReportsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRunPivotReportsRequest + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.BatchRunPivotReportsRequest; + + /** + * Creates a plain object from a BatchRunPivotReportsRequest message. Also converts values to other types if specified. + * @param message BatchRunPivotReportsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.BatchRunPivotReportsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRunPivotReportsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRunPivotReportsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRunPivotReportsResponse. */ + interface IBatchRunPivotReportsResponse { + + /** BatchRunPivotReportsResponse pivotReports */ + pivotReports?: (google.analytics.data.v1beta.IRunPivotReportResponse[]|null); + + /** BatchRunPivotReportsResponse kind */ + kind?: (string|null); + } + + /** Represents a BatchRunPivotReportsResponse. */ + class BatchRunPivotReportsResponse implements IBatchRunPivotReportsResponse { + + /** + * Constructs a new BatchRunPivotReportsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IBatchRunPivotReportsResponse); + + /** BatchRunPivotReportsResponse pivotReports. */ + public pivotReports: google.analytics.data.v1beta.IRunPivotReportResponse[]; + + /** BatchRunPivotReportsResponse kind. */ + public kind: string; + + /** + * Creates a new BatchRunPivotReportsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRunPivotReportsResponse instance + */ + public static create(properties?: google.analytics.data.v1beta.IBatchRunPivotReportsResponse): google.analytics.data.v1beta.BatchRunPivotReportsResponse; + + /** + * Encodes the specified BatchRunPivotReportsResponse message. Does not implicitly {@link google.analytics.data.v1beta.BatchRunPivotReportsResponse.verify|verify} messages. + * @param message BatchRunPivotReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IBatchRunPivotReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRunPivotReportsResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.BatchRunPivotReportsResponse.verify|verify} messages. + * @param message BatchRunPivotReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IBatchRunPivotReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRunPivotReportsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRunPivotReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.BatchRunPivotReportsResponse; + + /** + * Decodes a BatchRunPivotReportsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRunPivotReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.BatchRunPivotReportsResponse; + + /** + * Verifies a BatchRunPivotReportsResponse 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 BatchRunPivotReportsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRunPivotReportsResponse + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.BatchRunPivotReportsResponse; + + /** + * Creates a plain object from a BatchRunPivotReportsResponse message. Also converts values to other types if specified. + * @param message BatchRunPivotReportsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.BatchRunPivotReportsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRunPivotReportsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRunPivotReportsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMetadataRequest. */ + interface IGetMetadataRequest { + + /** GetMetadataRequest name */ + name?: (string|null); + } + + /** Represents a GetMetadataRequest. */ + class GetMetadataRequest implements IGetMetadataRequest { + + /** + * Constructs a new GetMetadataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IGetMetadataRequest); + + /** GetMetadataRequest name. */ + public name: string; + + /** + * Creates a new GetMetadataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMetadataRequest instance + */ + public static create(properties?: google.analytics.data.v1beta.IGetMetadataRequest): google.analytics.data.v1beta.GetMetadataRequest; + + /** + * Encodes the specified GetMetadataRequest message. Does not implicitly {@link google.analytics.data.v1beta.GetMetadataRequest.verify|verify} messages. + * @param message GetMetadataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IGetMetadataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMetadataRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.GetMetadataRequest.verify|verify} messages. + * @param message GetMetadataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IGetMetadataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMetadataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.GetMetadataRequest; + + /** + * Decodes a GetMetadataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.GetMetadataRequest; + + /** + * Verifies a GetMetadataRequest 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 GetMetadataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMetadataRequest + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.GetMetadataRequest; + + /** + * Creates a plain object from a GetMetadataRequest message. Also converts values to other types if specified. + * @param message GetMetadataRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.GetMetadataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMetadataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMetadataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunRealtimeReportRequest. */ + interface IRunRealtimeReportRequest { + + /** RunRealtimeReportRequest property */ + property?: (string|null); + + /** RunRealtimeReportRequest dimensions */ + dimensions?: (google.analytics.data.v1beta.IDimension[]|null); + + /** RunRealtimeReportRequest metrics */ + metrics?: (google.analytics.data.v1beta.IMetric[]|null); + + /** RunRealtimeReportRequest dimensionFilter */ + dimensionFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** RunRealtimeReportRequest metricFilter */ + metricFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** RunRealtimeReportRequest limit */ + limit?: (number|Long|string|null); + + /** RunRealtimeReportRequest metricAggregations */ + metricAggregations?: (google.analytics.data.v1beta.MetricAggregation[]|null); + + /** RunRealtimeReportRequest orderBys */ + orderBys?: (google.analytics.data.v1beta.IOrderBy[]|null); + + /** RunRealtimeReportRequest returnPropertyQuota */ + returnPropertyQuota?: (boolean|null); + + /** RunRealtimeReportRequest minuteRanges */ + minuteRanges?: (google.analytics.data.v1beta.IMinuteRange[]|null); + } + + /** Represents a RunRealtimeReportRequest. */ + class RunRealtimeReportRequest implements IRunRealtimeReportRequest { + + /** + * Constructs a new RunRealtimeReportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IRunRealtimeReportRequest); + + /** RunRealtimeReportRequest property. */ + public property: string; + + /** RunRealtimeReportRequest dimensions. */ + public dimensions: google.analytics.data.v1beta.IDimension[]; + + /** RunRealtimeReportRequest metrics. */ + public metrics: google.analytics.data.v1beta.IMetric[]; + + /** RunRealtimeReportRequest dimensionFilter. */ + public dimensionFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** RunRealtimeReportRequest metricFilter. */ + public metricFilter?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** RunRealtimeReportRequest limit. */ + public limit: (number|Long|string); + + /** RunRealtimeReportRequest metricAggregations. */ + public metricAggregations: google.analytics.data.v1beta.MetricAggregation[]; + + /** RunRealtimeReportRequest orderBys. */ + public orderBys: google.analytics.data.v1beta.IOrderBy[]; + + /** RunRealtimeReportRequest returnPropertyQuota. */ + public returnPropertyQuota: boolean; + + /** RunRealtimeReportRequest minuteRanges. */ + public minuteRanges: google.analytics.data.v1beta.IMinuteRange[]; + + /** + * Creates a new RunRealtimeReportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunRealtimeReportRequest instance + */ + public static create(properties?: google.analytics.data.v1beta.IRunRealtimeReportRequest): google.analytics.data.v1beta.RunRealtimeReportRequest; + + /** + * Encodes the specified RunRealtimeReportRequest message. Does not implicitly {@link google.analytics.data.v1beta.RunRealtimeReportRequest.verify|verify} messages. + * @param message RunRealtimeReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IRunRealtimeReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunRealtimeReportRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.RunRealtimeReportRequest.verify|verify} messages. + * @param message RunRealtimeReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IRunRealtimeReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunRealtimeReportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunRealtimeReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.RunRealtimeReportRequest; + + /** + * Decodes a RunRealtimeReportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunRealtimeReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.RunRealtimeReportRequest; + + /** + * Verifies a RunRealtimeReportRequest 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 RunRealtimeReportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunRealtimeReportRequest + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.RunRealtimeReportRequest; + + /** + * Creates a plain object from a RunRealtimeReportRequest message. Also converts values to other types if specified. + * @param message RunRealtimeReportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.RunRealtimeReportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunRealtimeReportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunRealtimeReportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunRealtimeReportResponse. */ + interface IRunRealtimeReportResponse { + + /** RunRealtimeReportResponse dimensionHeaders */ + dimensionHeaders?: (google.analytics.data.v1beta.IDimensionHeader[]|null); + + /** RunRealtimeReportResponse metricHeaders */ + metricHeaders?: (google.analytics.data.v1beta.IMetricHeader[]|null); + + /** RunRealtimeReportResponse rows */ + rows?: (google.analytics.data.v1beta.IRow[]|null); + + /** RunRealtimeReportResponse totals */ + totals?: (google.analytics.data.v1beta.IRow[]|null); + + /** RunRealtimeReportResponse maximums */ + maximums?: (google.analytics.data.v1beta.IRow[]|null); + + /** RunRealtimeReportResponse minimums */ + minimums?: (google.analytics.data.v1beta.IRow[]|null); + + /** RunRealtimeReportResponse rowCount */ + rowCount?: (number|null); + + /** RunRealtimeReportResponse propertyQuota */ + propertyQuota?: (google.analytics.data.v1beta.IPropertyQuota|null); + + /** RunRealtimeReportResponse kind */ + kind?: (string|null); + } + + /** Represents a RunRealtimeReportResponse. */ + class RunRealtimeReportResponse implements IRunRealtimeReportResponse { + + /** + * Constructs a new RunRealtimeReportResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IRunRealtimeReportResponse); + + /** RunRealtimeReportResponse dimensionHeaders. */ + public dimensionHeaders: google.analytics.data.v1beta.IDimensionHeader[]; + + /** RunRealtimeReportResponse metricHeaders. */ + public metricHeaders: google.analytics.data.v1beta.IMetricHeader[]; + + /** RunRealtimeReportResponse rows. */ + public rows: google.analytics.data.v1beta.IRow[]; + + /** RunRealtimeReportResponse totals. */ + public totals: google.analytics.data.v1beta.IRow[]; + + /** RunRealtimeReportResponse maximums. */ + public maximums: google.analytics.data.v1beta.IRow[]; + + /** RunRealtimeReportResponse minimums. */ + public minimums: google.analytics.data.v1beta.IRow[]; + + /** RunRealtimeReportResponse rowCount. */ + public rowCount: number; + + /** RunRealtimeReportResponse propertyQuota. */ + public propertyQuota?: (google.analytics.data.v1beta.IPropertyQuota|null); + + /** RunRealtimeReportResponse kind. */ + public kind: string; + + /** + * Creates a new RunRealtimeReportResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunRealtimeReportResponse instance + */ + public static create(properties?: google.analytics.data.v1beta.IRunRealtimeReportResponse): google.analytics.data.v1beta.RunRealtimeReportResponse; + + /** + * Encodes the specified RunRealtimeReportResponse message. Does not implicitly {@link google.analytics.data.v1beta.RunRealtimeReportResponse.verify|verify} messages. + * @param message RunRealtimeReportResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IRunRealtimeReportResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunRealtimeReportResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.RunRealtimeReportResponse.verify|verify} messages. + * @param message RunRealtimeReportResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IRunRealtimeReportResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunRealtimeReportResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunRealtimeReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.RunRealtimeReportResponse; + + /** + * Decodes a RunRealtimeReportResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunRealtimeReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.RunRealtimeReportResponse; + + /** + * Verifies a RunRealtimeReportResponse 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 RunRealtimeReportResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunRealtimeReportResponse + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.RunRealtimeReportResponse; + + /** + * Creates a plain object from a RunRealtimeReportResponse message. Also converts values to other types if specified. + * @param message RunRealtimeReportResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.RunRealtimeReportResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunRealtimeReportResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunRealtimeReportResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DateRange. */ + interface IDateRange { + + /** DateRange startDate */ + startDate?: (string|null); + + /** DateRange endDate */ + endDate?: (string|null); + + /** DateRange name */ + name?: (string|null); + } + + /** Represents a DateRange. */ + class DateRange implements IDateRange { + + /** + * Constructs a new DateRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IDateRange); + + /** DateRange startDate. */ + public startDate: string; + + /** DateRange endDate. */ + public endDate: string; + + /** DateRange name. */ + public name: string; + + /** + * Creates a new DateRange instance using the specified properties. + * @param [properties] Properties to set + * @returns DateRange instance + */ + public static create(properties?: google.analytics.data.v1beta.IDateRange): google.analytics.data.v1beta.DateRange; + + /** + * Encodes the specified DateRange message. Does not implicitly {@link google.analytics.data.v1beta.DateRange.verify|verify} messages. + * @param message DateRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IDateRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateRange message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DateRange.verify|verify} messages. + * @param message DateRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IDateRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.DateRange; + + /** + * Decodes a DateRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.DateRange; + + /** + * Verifies a DateRange 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 DateRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateRange + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.DateRange; + + /** + * Creates a plain object from a DateRange message. Also converts values to other types if specified. + * @param message DateRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.DateRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MinuteRange. */ + interface IMinuteRange { + + /** MinuteRange startMinutesAgo */ + startMinutesAgo?: (number|null); + + /** MinuteRange endMinutesAgo */ + endMinutesAgo?: (number|null); + + /** MinuteRange name */ + name?: (string|null); + } + + /** Represents a MinuteRange. */ + class MinuteRange implements IMinuteRange { + + /** + * Constructs a new MinuteRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IMinuteRange); + + /** MinuteRange startMinutesAgo. */ + public startMinutesAgo?: (number|null); + + /** MinuteRange endMinutesAgo. */ + public endMinutesAgo?: (number|null); + + /** MinuteRange name. */ + public name: string; + + /** MinuteRange _startMinutesAgo. */ + public _startMinutesAgo?: "startMinutesAgo"; + + /** MinuteRange _endMinutesAgo. */ + public _endMinutesAgo?: "endMinutesAgo"; + + /** + * Creates a new MinuteRange instance using the specified properties. + * @param [properties] Properties to set + * @returns MinuteRange instance + */ + public static create(properties?: google.analytics.data.v1beta.IMinuteRange): google.analytics.data.v1beta.MinuteRange; + + /** + * Encodes the specified MinuteRange message. Does not implicitly {@link google.analytics.data.v1beta.MinuteRange.verify|verify} messages. + * @param message MinuteRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IMinuteRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MinuteRange message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.MinuteRange.verify|verify} messages. + * @param message MinuteRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IMinuteRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MinuteRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MinuteRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.MinuteRange; + + /** + * Decodes a MinuteRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MinuteRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.MinuteRange; + + /** + * Verifies a MinuteRange 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 MinuteRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MinuteRange + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.MinuteRange; + + /** + * Creates a plain object from a MinuteRange message. Also converts values to other types if specified. + * @param message MinuteRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.MinuteRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MinuteRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MinuteRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Dimension. */ + interface IDimension { + + /** Dimension name */ + name?: (string|null); + + /** Dimension dimensionExpression */ + dimensionExpression?: (google.analytics.data.v1beta.IDimensionExpression|null); + } + + /** Represents a Dimension. */ + class Dimension implements IDimension { + + /** + * Constructs a new Dimension. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IDimension); + + /** Dimension name. */ + public name: string; + + /** Dimension dimensionExpression. */ + public dimensionExpression?: (google.analytics.data.v1beta.IDimensionExpression|null); + + /** + * Creates a new Dimension instance using the specified properties. + * @param [properties] Properties to set + * @returns Dimension instance + */ + public static create(properties?: google.analytics.data.v1beta.IDimension): google.analytics.data.v1beta.Dimension; + + /** + * Encodes the specified Dimension message. Does not implicitly {@link google.analytics.data.v1beta.Dimension.verify|verify} messages. + * @param message Dimension message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IDimension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dimension message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Dimension.verify|verify} messages. + * @param message Dimension message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IDimension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dimension message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dimension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.Dimension; + + /** + * Decodes a Dimension message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dimension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.Dimension; + + /** + * Verifies a Dimension 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 Dimension message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dimension + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.Dimension; + + /** + * Creates a plain object from a Dimension message. Also converts values to other types if specified. + * @param message Dimension + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.Dimension, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dimension to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dimension + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DimensionExpression. */ + interface IDimensionExpression { + + /** DimensionExpression lowerCase */ + lowerCase?: (google.analytics.data.v1beta.DimensionExpression.ICaseExpression|null); + + /** DimensionExpression upperCase */ + upperCase?: (google.analytics.data.v1beta.DimensionExpression.ICaseExpression|null); + + /** DimensionExpression concatenate */ + concatenate?: (google.analytics.data.v1beta.DimensionExpression.IConcatenateExpression|null); + } + + /** Represents a DimensionExpression. */ + class DimensionExpression implements IDimensionExpression { + + /** + * Constructs a new DimensionExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IDimensionExpression); + + /** DimensionExpression lowerCase. */ + public lowerCase?: (google.analytics.data.v1beta.DimensionExpression.ICaseExpression|null); + + /** DimensionExpression upperCase. */ + public upperCase?: (google.analytics.data.v1beta.DimensionExpression.ICaseExpression|null); + + /** DimensionExpression concatenate. */ + public concatenate?: (google.analytics.data.v1beta.DimensionExpression.IConcatenateExpression|null); + + /** DimensionExpression oneExpression. */ + public oneExpression?: ("lowerCase"|"upperCase"|"concatenate"); + + /** + * Creates a new DimensionExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns DimensionExpression instance + */ + public static create(properties?: google.analytics.data.v1beta.IDimensionExpression): google.analytics.data.v1beta.DimensionExpression; + + /** + * Encodes the specified DimensionExpression message. Does not implicitly {@link google.analytics.data.v1beta.DimensionExpression.verify|verify} messages. + * @param message DimensionExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IDimensionExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DimensionExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DimensionExpression.verify|verify} messages. + * @param message DimensionExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IDimensionExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DimensionExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DimensionExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.DimensionExpression; + + /** + * Decodes a DimensionExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DimensionExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.DimensionExpression; + + /** + * Verifies a DimensionExpression 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 DimensionExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DimensionExpression + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.DimensionExpression; + + /** + * Creates a plain object from a DimensionExpression message. Also converts values to other types if specified. + * @param message DimensionExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.DimensionExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DimensionExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DimensionExpression + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DimensionExpression { + + /** Properties of a CaseExpression. */ + interface ICaseExpression { + + /** CaseExpression dimensionName */ + dimensionName?: (string|null); + } + + /** Represents a CaseExpression. */ + class CaseExpression implements ICaseExpression { + + /** + * Constructs a new CaseExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.DimensionExpression.ICaseExpression); + + /** CaseExpression dimensionName. */ + public dimensionName: string; + + /** + * Creates a new CaseExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns CaseExpression instance + */ + public static create(properties?: google.analytics.data.v1beta.DimensionExpression.ICaseExpression): google.analytics.data.v1beta.DimensionExpression.CaseExpression; + + /** + * Encodes the specified CaseExpression message. Does not implicitly {@link google.analytics.data.v1beta.DimensionExpression.CaseExpression.verify|verify} messages. + * @param message CaseExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.DimensionExpression.ICaseExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CaseExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DimensionExpression.CaseExpression.verify|verify} messages. + * @param message CaseExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.DimensionExpression.ICaseExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CaseExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CaseExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.DimensionExpression.CaseExpression; + + /** + * Decodes a CaseExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CaseExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.DimensionExpression.CaseExpression; + + /** + * Verifies a CaseExpression 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 CaseExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CaseExpression + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.DimensionExpression.CaseExpression; + + /** + * Creates a plain object from a CaseExpression message. Also converts values to other types if specified. + * @param message CaseExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.DimensionExpression.CaseExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CaseExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CaseExpression + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConcatenateExpression. */ + interface IConcatenateExpression { + + /** ConcatenateExpression dimensionNames */ + dimensionNames?: (string[]|null); + + /** ConcatenateExpression delimiter */ + delimiter?: (string|null); + } + + /** Represents a ConcatenateExpression. */ + class ConcatenateExpression implements IConcatenateExpression { + + /** + * Constructs a new ConcatenateExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.DimensionExpression.IConcatenateExpression); + + /** ConcatenateExpression dimensionNames. */ + public dimensionNames: string[]; + + /** ConcatenateExpression delimiter. */ + public delimiter: string; + + /** + * Creates a new ConcatenateExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns ConcatenateExpression instance + */ + public static create(properties?: google.analytics.data.v1beta.DimensionExpression.IConcatenateExpression): google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression; + + /** + * Encodes the specified ConcatenateExpression message. Does not implicitly {@link google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression.verify|verify} messages. + * @param message ConcatenateExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.DimensionExpression.IConcatenateExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConcatenateExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression.verify|verify} messages. + * @param message ConcatenateExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.DimensionExpression.IConcatenateExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConcatenateExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConcatenateExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression; + + /** + * Decodes a ConcatenateExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConcatenateExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression; + + /** + * Verifies a ConcatenateExpression 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 ConcatenateExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConcatenateExpression + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression; + + /** + * Creates a plain object from a ConcatenateExpression message. Also converts values to other types if specified. + * @param message ConcatenateExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConcatenateExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConcatenateExpression + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Metric. */ + interface IMetric { + + /** Metric name */ + name?: (string|null); + + /** Metric expression */ + expression?: (string|null); + + /** Metric invisible */ + invisible?: (boolean|null); + } + + /** Represents a Metric. */ + class Metric implements IMetric { + + /** + * Constructs a new Metric. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IMetric); + + /** Metric name. */ + public name: string; + + /** Metric expression. */ + public expression: string; + + /** Metric invisible. */ + public invisible: boolean; + + /** + * Creates a new Metric instance using the specified properties. + * @param [properties] Properties to set + * @returns Metric instance + */ + public static create(properties?: google.analytics.data.v1beta.IMetric): google.analytics.data.v1beta.Metric; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.analytics.data.v1beta.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.Metric; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.Metric; + + /** + * Verifies a Metric 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 Metric message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metric + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.Metric; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @param message Metric + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.Metric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metric to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metric + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FilterExpression. */ + interface IFilterExpression { + + /** FilterExpression andGroup */ + andGroup?: (google.analytics.data.v1beta.IFilterExpressionList|null); + + /** FilterExpression orGroup */ + orGroup?: (google.analytics.data.v1beta.IFilterExpressionList|null); + + /** FilterExpression notExpression */ + notExpression?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** FilterExpression filter */ + filter?: (google.analytics.data.v1beta.IFilter|null); + } + + /** Represents a FilterExpression. */ + class FilterExpression implements IFilterExpression { + + /** + * Constructs a new FilterExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IFilterExpression); + + /** FilterExpression andGroup. */ + public andGroup?: (google.analytics.data.v1beta.IFilterExpressionList|null); + + /** FilterExpression orGroup. */ + public orGroup?: (google.analytics.data.v1beta.IFilterExpressionList|null); + + /** FilterExpression notExpression. */ + public notExpression?: (google.analytics.data.v1beta.IFilterExpression|null); + + /** FilterExpression filter. */ + public filter?: (google.analytics.data.v1beta.IFilter|null); + + /** FilterExpression expr. */ + public expr?: ("andGroup"|"orGroup"|"notExpression"|"filter"); + + /** + * Creates a new FilterExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns FilterExpression instance + */ + public static create(properties?: google.analytics.data.v1beta.IFilterExpression): google.analytics.data.v1beta.FilterExpression; + + /** + * Encodes the specified FilterExpression message. Does not implicitly {@link google.analytics.data.v1beta.FilterExpression.verify|verify} messages. + * @param message FilterExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IFilterExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FilterExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.FilterExpression.verify|verify} messages. + * @param message FilterExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IFilterExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FilterExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.FilterExpression; + + /** + * Decodes a FilterExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.FilterExpression; + + /** + * Verifies a FilterExpression 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 FilterExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FilterExpression + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.FilterExpression; + + /** + * Creates a plain object from a FilterExpression message. Also converts values to other types if specified. + * @param message FilterExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.FilterExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FilterExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FilterExpression + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FilterExpressionList. */ + interface IFilterExpressionList { + + /** FilterExpressionList expressions */ + expressions?: (google.analytics.data.v1beta.IFilterExpression[]|null); + } + + /** Represents a FilterExpressionList. */ + class FilterExpressionList implements IFilterExpressionList { + + /** + * Constructs a new FilterExpressionList. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IFilterExpressionList); + + /** FilterExpressionList expressions. */ + public expressions: google.analytics.data.v1beta.IFilterExpression[]; + + /** + * Creates a new FilterExpressionList instance using the specified properties. + * @param [properties] Properties to set + * @returns FilterExpressionList instance + */ + public static create(properties?: google.analytics.data.v1beta.IFilterExpressionList): google.analytics.data.v1beta.FilterExpressionList; + + /** + * Encodes the specified FilterExpressionList message. Does not implicitly {@link google.analytics.data.v1beta.FilterExpressionList.verify|verify} messages. + * @param message FilterExpressionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IFilterExpressionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FilterExpressionList message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.FilterExpressionList.verify|verify} messages. + * @param message FilterExpressionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IFilterExpressionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FilterExpressionList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.FilterExpressionList; + + /** + * Decodes a FilterExpressionList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.FilterExpressionList; + + /** + * Verifies a FilterExpressionList 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 FilterExpressionList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FilterExpressionList + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.FilterExpressionList; + + /** + * Creates a plain object from a FilterExpressionList message. Also converts values to other types if specified. + * @param message FilterExpressionList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.FilterExpressionList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FilterExpressionList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FilterExpressionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Filter. */ + interface IFilter { + + /** Filter fieldName */ + fieldName?: (string|null); + + /** Filter stringFilter */ + stringFilter?: (google.analytics.data.v1beta.Filter.IStringFilter|null); + + /** Filter inListFilter */ + inListFilter?: (google.analytics.data.v1beta.Filter.IInListFilter|null); + + /** Filter numericFilter */ + numericFilter?: (google.analytics.data.v1beta.Filter.INumericFilter|null); + + /** Filter betweenFilter */ + betweenFilter?: (google.analytics.data.v1beta.Filter.IBetweenFilter|null); + } + + /** Represents a Filter. */ + class Filter implements IFilter { + + /** + * Constructs a new Filter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IFilter); + + /** Filter fieldName. */ + public fieldName: string; + + /** Filter stringFilter. */ + public stringFilter?: (google.analytics.data.v1beta.Filter.IStringFilter|null); + + /** Filter inListFilter. */ + public inListFilter?: (google.analytics.data.v1beta.Filter.IInListFilter|null); + + /** Filter numericFilter. */ + public numericFilter?: (google.analytics.data.v1beta.Filter.INumericFilter|null); + + /** Filter betweenFilter. */ + public betweenFilter?: (google.analytics.data.v1beta.Filter.IBetweenFilter|null); + + /** Filter oneFilter. */ + public oneFilter?: ("stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"); + + /** + * Creates a new Filter instance using the specified properties. + * @param [properties] Properties to set + * @returns Filter instance + */ + public static create(properties?: google.analytics.data.v1beta.IFilter): google.analytics.data.v1beta.Filter; + + /** + * Encodes the specified Filter message. Does not implicitly {@link google.analytics.data.v1beta.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Filter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.Filter; + + /** + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.Filter; + + /** + * Verifies a Filter 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 Filter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Filter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.Filter; + + /** + * Creates a plain object from a Filter message. Also converts values to other types if specified. + * @param message Filter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.Filter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Filter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Filter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Filter { + + /** Properties of a StringFilter. */ + interface IStringFilter { + + /** StringFilter matchType */ + matchType?: (google.analytics.data.v1beta.Filter.StringFilter.MatchType|keyof typeof google.analytics.data.v1beta.Filter.StringFilter.MatchType|null); + + /** StringFilter value */ + value?: (string|null); + + /** StringFilter caseSensitive */ + caseSensitive?: (boolean|null); + } + + /** Represents a StringFilter. */ + class StringFilter implements IStringFilter { + + /** + * Constructs a new StringFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.Filter.IStringFilter); + + /** StringFilter matchType. */ + public matchType: (google.analytics.data.v1beta.Filter.StringFilter.MatchType|keyof typeof google.analytics.data.v1beta.Filter.StringFilter.MatchType); + + /** StringFilter value. */ + public value: string; + + /** StringFilter caseSensitive. */ + public caseSensitive: boolean; + + /** + * Creates a new StringFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns StringFilter instance + */ + public static create(properties?: google.analytics.data.v1beta.Filter.IStringFilter): google.analytics.data.v1beta.Filter.StringFilter; + + /** + * Encodes the specified StringFilter message. Does not implicitly {@link google.analytics.data.v1beta.Filter.StringFilter.verify|verify} messages. + * @param message StringFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.Filter.IStringFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Filter.StringFilter.verify|verify} messages. + * @param message StringFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.Filter.IStringFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.Filter.StringFilter; + + /** + * Decodes a StringFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.Filter.StringFilter; + + /** + * Verifies a StringFilter 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 StringFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.Filter.StringFilter; + + /** + * Creates a plain object from a StringFilter message. Also converts values to other types if specified. + * @param message StringFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.Filter.StringFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StringFilter { + + /** 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 InListFilter. */ + interface IInListFilter { + + /** InListFilter values */ + values?: (string[]|null); + + /** InListFilter caseSensitive */ + caseSensitive?: (boolean|null); + } + + /** Represents an InListFilter. */ + class InListFilter implements IInListFilter { + + /** + * Constructs a new InListFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.Filter.IInListFilter); + + /** InListFilter values. */ + public values: string[]; + + /** InListFilter caseSensitive. */ + public caseSensitive: boolean; + + /** + * Creates a new InListFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns InListFilter instance + */ + public static create(properties?: google.analytics.data.v1beta.Filter.IInListFilter): google.analytics.data.v1beta.Filter.InListFilter; + + /** + * Encodes the specified InListFilter message. Does not implicitly {@link google.analytics.data.v1beta.Filter.InListFilter.verify|verify} messages. + * @param message InListFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.Filter.IInListFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InListFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Filter.InListFilter.verify|verify} messages. + * @param message InListFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.Filter.IInListFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InListFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InListFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.Filter.InListFilter; + + /** + * Decodes an InListFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InListFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.Filter.InListFilter; + + /** + * Verifies an InListFilter 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 InListFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InListFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.Filter.InListFilter; + + /** + * Creates a plain object from an InListFilter message. Also converts values to other types if specified. + * @param message InListFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.Filter.InListFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InListFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InListFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NumericFilter. */ + interface INumericFilter { + + /** NumericFilter operation */ + operation?: (google.analytics.data.v1beta.Filter.NumericFilter.Operation|keyof typeof google.analytics.data.v1beta.Filter.NumericFilter.Operation|null); + + /** NumericFilter value */ + value?: (google.analytics.data.v1beta.INumericValue|null); + } + + /** Represents a NumericFilter. */ + class NumericFilter implements INumericFilter { + + /** + * Constructs a new NumericFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.Filter.INumericFilter); + + /** NumericFilter operation. */ + public operation: (google.analytics.data.v1beta.Filter.NumericFilter.Operation|keyof typeof google.analytics.data.v1beta.Filter.NumericFilter.Operation); + + /** NumericFilter value. */ + public value?: (google.analytics.data.v1beta.INumericValue|null); + + /** + * Creates a new NumericFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns NumericFilter instance + */ + public static create(properties?: google.analytics.data.v1beta.Filter.INumericFilter): google.analytics.data.v1beta.Filter.NumericFilter; + + /** + * Encodes the specified NumericFilter message. Does not implicitly {@link google.analytics.data.v1beta.Filter.NumericFilter.verify|verify} messages. + * @param message NumericFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.Filter.INumericFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NumericFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Filter.NumericFilter.verify|verify} messages. + * @param message NumericFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.Filter.INumericFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NumericFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NumericFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.Filter.NumericFilter; + + /** + * Decodes a NumericFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NumericFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.Filter.NumericFilter; + + /** + * Verifies a NumericFilter 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 NumericFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NumericFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.Filter.NumericFilter; + + /** + * Creates a plain object from a NumericFilter message. Also converts values to other types if specified. + * @param message NumericFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.Filter.NumericFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NumericFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NumericFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NumericFilter { + + /** 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 a BetweenFilter. */ + interface IBetweenFilter { + + /** BetweenFilter fromValue */ + fromValue?: (google.analytics.data.v1beta.INumericValue|null); + + /** BetweenFilter toValue */ + toValue?: (google.analytics.data.v1beta.INumericValue|null); + } + + /** Represents a BetweenFilter. */ + class BetweenFilter implements IBetweenFilter { + + /** + * Constructs a new BetweenFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.Filter.IBetweenFilter); + + /** BetweenFilter fromValue. */ + public fromValue?: (google.analytics.data.v1beta.INumericValue|null); + + /** BetweenFilter toValue. */ + public toValue?: (google.analytics.data.v1beta.INumericValue|null); + + /** + * Creates a new BetweenFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns BetweenFilter instance + */ + public static create(properties?: google.analytics.data.v1beta.Filter.IBetweenFilter): google.analytics.data.v1beta.Filter.BetweenFilter; + + /** + * Encodes the specified BetweenFilter message. Does not implicitly {@link google.analytics.data.v1beta.Filter.BetweenFilter.verify|verify} messages. + * @param message BetweenFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.Filter.IBetweenFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BetweenFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Filter.BetweenFilter.verify|verify} messages. + * @param message BetweenFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.Filter.IBetweenFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BetweenFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BetweenFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.Filter.BetweenFilter; + + /** + * Decodes a BetweenFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BetweenFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.Filter.BetweenFilter; + + /** + * Verifies a BetweenFilter 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 BetweenFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BetweenFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.Filter.BetweenFilter; + + /** + * Creates a plain object from a BetweenFilter message. Also converts values to other types if specified. + * @param message BetweenFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.Filter.BetweenFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BetweenFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BetweenFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OrderBy. */ + interface IOrderBy { + + /** OrderBy metric */ + metric?: (google.analytics.data.v1beta.OrderBy.IMetricOrderBy|null); + + /** OrderBy dimension */ + dimension?: (google.analytics.data.v1beta.OrderBy.IDimensionOrderBy|null); + + /** OrderBy pivot */ + pivot?: (google.analytics.data.v1beta.OrderBy.IPivotOrderBy|null); + + /** OrderBy desc */ + desc?: (boolean|null); + } + + /** Represents an OrderBy. */ + class OrderBy implements IOrderBy { + + /** + * Constructs a new OrderBy. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IOrderBy); + + /** OrderBy metric. */ + public metric?: (google.analytics.data.v1beta.OrderBy.IMetricOrderBy|null); + + /** OrderBy dimension. */ + public dimension?: (google.analytics.data.v1beta.OrderBy.IDimensionOrderBy|null); + + /** OrderBy pivot. */ + public pivot?: (google.analytics.data.v1beta.OrderBy.IPivotOrderBy|null); + + /** OrderBy desc. */ + public desc: boolean; + + /** OrderBy oneOrderBy. */ + public oneOrderBy?: ("metric"|"dimension"|"pivot"); + + /** + * Creates a new OrderBy instance using the specified properties. + * @param [properties] Properties to set + * @returns OrderBy instance + */ + public static create(properties?: google.analytics.data.v1beta.IOrderBy): google.analytics.data.v1beta.OrderBy; + + /** + * Encodes the specified OrderBy message. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.verify|verify} messages. + * @param message OrderBy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IOrderBy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrderBy message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.verify|verify} messages. + * @param message OrderBy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IOrderBy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrderBy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.OrderBy; + + /** + * Decodes an OrderBy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.OrderBy; + + /** + * Verifies an OrderBy 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 OrderBy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrderBy + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.OrderBy; + + /** + * Creates a plain object from an OrderBy message. Also converts values to other types if specified. + * @param message OrderBy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.OrderBy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrderBy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrderBy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OrderBy { + + /** 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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.IMetricOrderBy): google.analytics.data.v1beta.OrderBy.MetricOrderBy; + + /** + * Encodes the specified MetricOrderBy message. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.IMetricOrderBy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricOrderBy message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.DimensionOrderBy.OrderType|keyof typeof google.analytics.data.v1beta.OrderBy.DimensionOrderBy.OrderType|null); + } + + /** Represents a DimensionOrderBy. */ + class DimensionOrderBy implements IDimensionOrderBy { + + /** + * Constructs a new DimensionOrderBy. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.OrderBy.IDimensionOrderBy); + + /** DimensionOrderBy dimensionName. */ + public dimensionName: string; + + /** DimensionOrderBy orderType. */ + public orderType: (google.analytics.data.v1beta.OrderBy.DimensionOrderBy.OrderType|keyof typeof google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.IDimensionOrderBy): google.analytics.data.v1beta.OrderBy.DimensionOrderBy; + + /** + * Encodes the specified DimensionOrderBy message. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.IDimensionOrderBy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DimensionOrderBy message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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 a PivotOrderBy. */ + interface IPivotOrderBy { + + /** PivotOrderBy metricName */ + metricName?: (string|null); + + /** PivotOrderBy pivotSelections */ + pivotSelections?: (google.analytics.data.v1beta.OrderBy.PivotOrderBy.IPivotSelection[]|null); + } + + /** Represents a PivotOrderBy. */ + class PivotOrderBy implements IPivotOrderBy { + + /** + * Constructs a new PivotOrderBy. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.OrderBy.IPivotOrderBy); + + /** PivotOrderBy metricName. */ + public metricName: string; + + /** PivotOrderBy pivotSelections. */ + public pivotSelections: google.analytics.data.v1beta.OrderBy.PivotOrderBy.IPivotSelection[]; + + /** + * Creates a new PivotOrderBy instance using the specified properties. + * @param [properties] Properties to set + * @returns PivotOrderBy instance + */ + public static create(properties?: google.analytics.data.v1beta.OrderBy.IPivotOrderBy): google.analytics.data.v1beta.OrderBy.PivotOrderBy; + + /** + * Encodes the specified PivotOrderBy message. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.PivotOrderBy.verify|verify} messages. + * @param message PivotOrderBy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.OrderBy.IPivotOrderBy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PivotOrderBy message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.PivotOrderBy.verify|verify} messages. + * @param message PivotOrderBy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.OrderBy.IPivotOrderBy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PivotOrderBy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PivotOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.OrderBy.PivotOrderBy; + + /** + * Decodes a PivotOrderBy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PivotOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.OrderBy.PivotOrderBy; + + /** + * Verifies a PivotOrderBy 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 PivotOrderBy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PivotOrderBy + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.OrderBy.PivotOrderBy; + + /** + * Creates a plain object from a PivotOrderBy message. Also converts values to other types if specified. + * @param message PivotOrderBy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.OrderBy.PivotOrderBy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PivotOrderBy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PivotOrderBy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PivotOrderBy { + + /** Properties of a PivotSelection. */ + interface IPivotSelection { + + /** PivotSelection dimensionName */ + dimensionName?: (string|null); + + /** PivotSelection dimensionValue */ + dimensionValue?: (string|null); + } + + /** Represents a PivotSelection. */ + class PivotSelection implements IPivotSelection { + + /** + * Constructs a new PivotSelection. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.OrderBy.PivotOrderBy.IPivotSelection); + + /** PivotSelection dimensionName. */ + public dimensionName: string; + + /** PivotSelection dimensionValue. */ + public dimensionValue: string; + + /** + * Creates a new PivotSelection instance using the specified properties. + * @param [properties] Properties to set + * @returns PivotSelection instance + */ + public static create(properties?: google.analytics.data.v1beta.OrderBy.PivotOrderBy.IPivotSelection): google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection; + + /** + * Encodes the specified PivotSelection message. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection.verify|verify} messages. + * @param message PivotSelection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.OrderBy.PivotOrderBy.IPivotSelection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PivotSelection message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection.verify|verify} messages. + * @param message PivotSelection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.OrderBy.PivotOrderBy.IPivotSelection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PivotSelection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PivotSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection; + + /** + * Decodes a PivotSelection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PivotSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection; + + /** + * Verifies a PivotSelection 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 PivotSelection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PivotSelection + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection; + + /** + * Creates a plain object from a PivotSelection message. Also converts values to other types if specified. + * @param message PivotSelection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PivotSelection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PivotSelection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a Pivot. */ + interface IPivot { + + /** Pivot fieldNames */ + fieldNames?: (string[]|null); + + /** Pivot orderBys */ + orderBys?: (google.analytics.data.v1beta.IOrderBy[]|null); + + /** Pivot offset */ + offset?: (number|Long|string|null); + + /** Pivot limit */ + limit?: (number|Long|string|null); + + /** Pivot metricAggregations */ + metricAggregations?: (google.analytics.data.v1beta.MetricAggregation[]|null); + } + + /** Represents a Pivot. */ + class Pivot implements IPivot { + + /** + * Constructs a new Pivot. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IPivot); + + /** Pivot fieldNames. */ + public fieldNames: string[]; + + /** Pivot orderBys. */ + public orderBys: google.analytics.data.v1beta.IOrderBy[]; + + /** Pivot offset. */ + public offset: (number|Long|string); + + /** Pivot limit. */ + public limit: (number|Long|string); + + /** Pivot metricAggregations. */ + public metricAggregations: google.analytics.data.v1beta.MetricAggregation[]; + + /** + * Creates a new Pivot instance using the specified properties. + * @param [properties] Properties to set + * @returns Pivot instance + */ + public static create(properties?: google.analytics.data.v1beta.IPivot): google.analytics.data.v1beta.Pivot; + + /** + * Encodes the specified Pivot message. Does not implicitly {@link google.analytics.data.v1beta.Pivot.verify|verify} messages. + * @param message Pivot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IPivot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Pivot message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Pivot.verify|verify} messages. + * @param message Pivot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IPivot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Pivot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Pivot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.Pivot; + + /** + * Decodes a Pivot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Pivot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.Pivot; + + /** + * Verifies a Pivot 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 Pivot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Pivot + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.Pivot; + + /** + * Creates a plain object from a Pivot message. Also converts values to other types if specified. + * @param message Pivot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.Pivot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Pivot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Pivot + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CohortSpec. */ + interface ICohortSpec { + + /** CohortSpec cohorts */ + cohorts?: (google.analytics.data.v1beta.ICohort[]|null); + + /** CohortSpec cohortsRange */ + cohortsRange?: (google.analytics.data.v1beta.ICohortsRange|null); + + /** CohortSpec cohortReportSettings */ + cohortReportSettings?: (google.analytics.data.v1beta.ICohortReportSettings|null); + } + + /** Represents a CohortSpec. */ + class CohortSpec implements ICohortSpec { + + /** + * Constructs a new CohortSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.ICohortSpec); + + /** CohortSpec cohorts. */ + public cohorts: google.analytics.data.v1beta.ICohort[]; + + /** CohortSpec cohortsRange. */ + public cohortsRange?: (google.analytics.data.v1beta.ICohortsRange|null); + + /** CohortSpec cohortReportSettings. */ + public cohortReportSettings?: (google.analytics.data.v1beta.ICohortReportSettings|null); + + /** + * Creates a new CohortSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns CohortSpec instance + */ + public static create(properties?: google.analytics.data.v1beta.ICohortSpec): google.analytics.data.v1beta.CohortSpec; + + /** + * Encodes the specified CohortSpec message. Does not implicitly {@link google.analytics.data.v1beta.CohortSpec.verify|verify} messages. + * @param message CohortSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.ICohortSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CohortSpec message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.CohortSpec.verify|verify} messages. + * @param message CohortSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.ICohortSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CohortSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CohortSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.CohortSpec; + + /** + * Decodes a CohortSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CohortSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.CohortSpec; + + /** + * Verifies a CohortSpec 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 CohortSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CohortSpec + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.CohortSpec; + + /** + * Creates a plain object from a CohortSpec message. Also converts values to other types if specified. + * @param message CohortSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.CohortSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CohortSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CohortSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cohort. */ + interface ICohort { + + /** Cohort name */ + name?: (string|null); + + /** Cohort dimension */ + dimension?: (string|null); + + /** Cohort dateRange */ + dateRange?: (google.analytics.data.v1beta.IDateRange|null); + } + + /** Represents a Cohort. */ + class Cohort implements ICohort { + + /** + * Constructs a new Cohort. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.ICohort); + + /** Cohort name. */ + public name: string; + + /** Cohort dimension. */ + public dimension: string; + + /** Cohort dateRange. */ + public dateRange?: (google.analytics.data.v1beta.IDateRange|null); + + /** + * Creates a new Cohort instance using the specified properties. + * @param [properties] Properties to set + * @returns Cohort instance + */ + public static create(properties?: google.analytics.data.v1beta.ICohort): google.analytics.data.v1beta.Cohort; + + /** + * Encodes the specified Cohort message. Does not implicitly {@link google.analytics.data.v1beta.Cohort.verify|verify} messages. + * @param message Cohort message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.ICohort, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cohort message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Cohort.verify|verify} messages. + * @param message Cohort message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.ICohort, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cohort message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cohort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.Cohort; + + /** + * Decodes a Cohort message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cohort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.Cohort; + + /** + * Verifies a Cohort 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 Cohort message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cohort + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.Cohort; + + /** + * Creates a plain object from a Cohort message. Also converts values to other types if specified. + * @param message Cohort + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.Cohort, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cohort to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cohort + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CohortsRange. */ + interface ICohortsRange { + + /** CohortsRange granularity */ + granularity?: (google.analytics.data.v1beta.CohortsRange.Granularity|keyof typeof google.analytics.data.v1beta.CohortsRange.Granularity|null); + + /** CohortsRange startOffset */ + startOffset?: (number|null); + + /** CohortsRange endOffset */ + endOffset?: (number|null); + } + + /** Represents a CohortsRange. */ + class CohortsRange implements ICohortsRange { + + /** + * Constructs a new CohortsRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.ICohortsRange); + + /** CohortsRange granularity. */ + public granularity: (google.analytics.data.v1beta.CohortsRange.Granularity|keyof typeof google.analytics.data.v1beta.CohortsRange.Granularity); + + /** CohortsRange startOffset. */ + public startOffset: number; + + /** CohortsRange endOffset. */ + public endOffset: number; + + /** + * Creates a new CohortsRange instance using the specified properties. + * @param [properties] Properties to set + * @returns CohortsRange instance + */ + public static create(properties?: google.analytics.data.v1beta.ICohortsRange): google.analytics.data.v1beta.CohortsRange; + + /** + * Encodes the specified CohortsRange message. Does not implicitly {@link google.analytics.data.v1beta.CohortsRange.verify|verify} messages. + * @param message CohortsRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.ICohortsRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CohortsRange message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.CohortsRange.verify|verify} messages. + * @param message CohortsRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.ICohortsRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CohortsRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CohortsRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.CohortsRange; + + /** + * Decodes a CohortsRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CohortsRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.CohortsRange; + + /** + * Verifies a CohortsRange 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 CohortsRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CohortsRange + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.CohortsRange; + + /** + * Creates a plain object from a CohortsRange message. Also converts values to other types if specified. + * @param message CohortsRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.CohortsRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CohortsRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CohortsRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CohortsRange { + + /** Granularity enum. */ + enum Granularity { + GRANULARITY_UNSPECIFIED = 0, + DAILY = 1, + WEEKLY = 2, + MONTHLY = 3 + } + } + + /** Properties of a CohortReportSettings. */ + interface ICohortReportSettings { + + /** CohortReportSettings accumulate */ + accumulate?: (boolean|null); + } + + /** Represents a CohortReportSettings. */ + class CohortReportSettings implements ICohortReportSettings { + + /** + * Constructs a new CohortReportSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.ICohortReportSettings); + + /** CohortReportSettings accumulate. */ + public accumulate: boolean; + + /** + * Creates a new CohortReportSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CohortReportSettings instance + */ + public static create(properties?: google.analytics.data.v1beta.ICohortReportSettings): google.analytics.data.v1beta.CohortReportSettings; + + /** + * Encodes the specified CohortReportSettings message. Does not implicitly {@link google.analytics.data.v1beta.CohortReportSettings.verify|verify} messages. + * @param message CohortReportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.ICohortReportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CohortReportSettings message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.CohortReportSettings.verify|verify} messages. + * @param message CohortReportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.ICohortReportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CohortReportSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CohortReportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.CohortReportSettings; + + /** + * Decodes a CohortReportSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CohortReportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.CohortReportSettings; + + /** + * Verifies a CohortReportSettings 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 CohortReportSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CohortReportSettings + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.CohortReportSettings; + + /** + * Creates a plain object from a CohortReportSettings message. Also converts values to other types if specified. + * @param message CohortReportSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.CohortReportSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CohortReportSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CohortReportSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResponseMetaData. */ + interface IResponseMetaData { + + /** ResponseMetaData dataLossFromOtherRow */ + dataLossFromOtherRow?: (boolean|null); + + /** ResponseMetaData schemaRestrictionResponse */ + schemaRestrictionResponse?: (google.analytics.data.v1beta.ResponseMetaData.ISchemaRestrictionResponse|null); + + /** ResponseMetaData currencyCode */ + currencyCode?: (string|null); + + /** ResponseMetaData timeZone */ + timeZone?: (string|null); + + /** ResponseMetaData emptyReason */ + emptyReason?: (string|null); + + /** ResponseMetaData subjectToThresholding */ + subjectToThresholding?: (boolean|null); + } + + /** Represents a ResponseMetaData. */ + class ResponseMetaData implements IResponseMetaData { + + /** + * Constructs a new ResponseMetaData. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IResponseMetaData); + + /** ResponseMetaData dataLossFromOtherRow. */ + public dataLossFromOtherRow: boolean; + + /** ResponseMetaData schemaRestrictionResponse. */ + public schemaRestrictionResponse?: (google.analytics.data.v1beta.ResponseMetaData.ISchemaRestrictionResponse|null); + + /** ResponseMetaData currencyCode. */ + public currencyCode?: (string|null); + + /** ResponseMetaData timeZone. */ + public timeZone?: (string|null); + + /** ResponseMetaData emptyReason. */ + public emptyReason?: (string|null); + + /** ResponseMetaData subjectToThresholding. */ + public subjectToThresholding?: (boolean|null); + + /** ResponseMetaData _schemaRestrictionResponse. */ + public _schemaRestrictionResponse?: "schemaRestrictionResponse"; + + /** ResponseMetaData _currencyCode. */ + public _currencyCode?: "currencyCode"; + + /** ResponseMetaData _timeZone. */ + public _timeZone?: "timeZone"; + + /** ResponseMetaData _emptyReason. */ + public _emptyReason?: "emptyReason"; + + /** ResponseMetaData _subjectToThresholding. */ + public _subjectToThresholding?: "subjectToThresholding"; + + /** + * Creates a new ResponseMetaData instance using the specified properties. + * @param [properties] Properties to set + * @returns ResponseMetaData instance + */ + public static create(properties?: google.analytics.data.v1beta.IResponseMetaData): google.analytics.data.v1beta.ResponseMetaData; + + /** + * Encodes the specified ResponseMetaData message. Does not implicitly {@link google.analytics.data.v1beta.ResponseMetaData.verify|verify} messages. + * @param message ResponseMetaData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IResponseMetaData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResponseMetaData message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.ResponseMetaData.verify|verify} messages. + * @param message ResponseMetaData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IResponseMetaData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResponseMetaData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResponseMetaData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.ResponseMetaData; + + /** + * Decodes a ResponseMetaData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResponseMetaData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.ResponseMetaData; + + /** + * Verifies a ResponseMetaData 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 ResponseMetaData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResponseMetaData + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.ResponseMetaData; + + /** + * Creates a plain object from a ResponseMetaData message. Also converts values to other types if specified. + * @param message ResponseMetaData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.ResponseMetaData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResponseMetaData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResponseMetaData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResponseMetaData { + + /** Properties of a SchemaRestrictionResponse. */ + interface ISchemaRestrictionResponse { + + /** SchemaRestrictionResponse activeMetricRestrictions */ + activeMetricRestrictions?: (google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.IActiveMetricRestriction[]|null); + } + + /** Represents a SchemaRestrictionResponse. */ + class SchemaRestrictionResponse implements ISchemaRestrictionResponse { + + /** + * Constructs a new SchemaRestrictionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.ResponseMetaData.ISchemaRestrictionResponse); + + /** SchemaRestrictionResponse activeMetricRestrictions. */ + public activeMetricRestrictions: google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.IActiveMetricRestriction[]; + + /** + * Creates a new SchemaRestrictionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SchemaRestrictionResponse instance + */ + public static create(properties?: google.analytics.data.v1beta.ResponseMetaData.ISchemaRestrictionResponse): google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse; + + /** + * Encodes the specified SchemaRestrictionResponse message. Does not implicitly {@link google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.verify|verify} messages. + * @param message SchemaRestrictionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.ResponseMetaData.ISchemaRestrictionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchemaRestrictionResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.verify|verify} messages. + * @param message SchemaRestrictionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.ResponseMetaData.ISchemaRestrictionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchemaRestrictionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchemaRestrictionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse; + + /** + * Decodes a SchemaRestrictionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchemaRestrictionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse; + + /** + * Verifies a SchemaRestrictionResponse 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 SchemaRestrictionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchemaRestrictionResponse + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse; + + /** + * Creates a plain object from a SchemaRestrictionResponse message. Also converts values to other types if specified. + * @param message SchemaRestrictionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchemaRestrictionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchemaRestrictionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SchemaRestrictionResponse { + + /** Properties of an ActiveMetricRestriction. */ + interface IActiveMetricRestriction { + + /** ActiveMetricRestriction metricName */ + metricName?: (string|null); + + /** ActiveMetricRestriction restrictedMetricTypes */ + restrictedMetricTypes?: (google.analytics.data.v1beta.RestrictedMetricType[]|null); + } + + /** Represents an ActiveMetricRestriction. */ + class ActiveMetricRestriction implements IActiveMetricRestriction { + + /** + * Constructs a new ActiveMetricRestriction. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.IActiveMetricRestriction); + + /** ActiveMetricRestriction metricName. */ + public metricName?: (string|null); + + /** ActiveMetricRestriction restrictedMetricTypes. */ + public restrictedMetricTypes: google.analytics.data.v1beta.RestrictedMetricType[]; + + /** ActiveMetricRestriction _metricName. */ + public _metricName?: "metricName"; + + /** + * Creates a new ActiveMetricRestriction instance using the specified properties. + * @param [properties] Properties to set + * @returns ActiveMetricRestriction instance + */ + public static create(properties?: google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.IActiveMetricRestriction): google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction; + + /** + * Encodes the specified ActiveMetricRestriction message. Does not implicitly {@link google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction.verify|verify} messages. + * @param message ActiveMetricRestriction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.IActiveMetricRestriction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActiveMetricRestriction message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction.verify|verify} messages. + * @param message ActiveMetricRestriction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.IActiveMetricRestriction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActiveMetricRestriction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActiveMetricRestriction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction; + + /** + * Decodes an ActiveMetricRestriction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActiveMetricRestriction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction; + + /** + * Verifies an ActiveMetricRestriction 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 ActiveMetricRestriction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActiveMetricRestriction + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction; + + /** + * Creates a plain object from an ActiveMetricRestriction message. Also converts values to other types if specified. + * @param message ActiveMetricRestriction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActiveMetricRestriction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActiveMetricRestriction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a DimensionHeader. */ + interface IDimensionHeader { + + /** DimensionHeader name */ + name?: (string|null); + } + + /** Represents a DimensionHeader. */ + class DimensionHeader implements IDimensionHeader { + + /** + * Constructs a new DimensionHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IDimensionHeader); + + /** DimensionHeader name. */ + public name: string; + + /** + * Creates a new DimensionHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns DimensionHeader instance + */ + public static create(properties?: google.analytics.data.v1beta.IDimensionHeader): google.analytics.data.v1beta.DimensionHeader; + + /** + * Encodes the specified DimensionHeader message. Does not implicitly {@link google.analytics.data.v1beta.DimensionHeader.verify|verify} messages. + * @param message DimensionHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IDimensionHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DimensionHeader message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DimensionHeader.verify|verify} messages. + * @param message DimensionHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IDimensionHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DimensionHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.DimensionHeader; + + /** + * Decodes a DimensionHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.DimensionHeader; + + /** + * Verifies a DimensionHeader 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 DimensionHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DimensionHeader + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.DimensionHeader; + + /** + * Creates a plain object from a DimensionHeader message. Also converts values to other types if specified. + * @param message DimensionHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.DimensionHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DimensionHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DimensionHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricHeader. */ + interface IMetricHeader { + + /** MetricHeader name */ + name?: (string|null); + + /** MetricHeader type */ + type?: (google.analytics.data.v1beta.MetricType|keyof typeof google.analytics.data.v1beta.MetricType|null); + } + + /** Represents a MetricHeader. */ + class MetricHeader implements IMetricHeader { + + /** + * Constructs a new MetricHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IMetricHeader); + + /** MetricHeader name. */ + public name: string; + + /** MetricHeader type. */ + public type: (google.analytics.data.v1beta.MetricType|keyof typeof google.analytics.data.v1beta.MetricType); + + /** + * Creates a new MetricHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricHeader instance + */ + public static create(properties?: google.analytics.data.v1beta.IMetricHeader): google.analytics.data.v1beta.MetricHeader; + + /** + * Encodes the specified MetricHeader message. Does not implicitly {@link google.analytics.data.v1beta.MetricHeader.verify|verify} messages. + * @param message MetricHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IMetricHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricHeader message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.MetricHeader.verify|verify} messages. + * @param message MetricHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IMetricHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.MetricHeader; + + /** + * Decodes a MetricHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.MetricHeader; + + /** + * Verifies a MetricHeader 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 MetricHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricHeader + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.MetricHeader; + + /** + * Creates a plain object from a MetricHeader message. Also converts values to other types if specified. + * @param message MetricHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.MetricHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PivotHeader. */ + interface IPivotHeader { + + /** PivotHeader pivotDimensionHeaders */ + pivotDimensionHeaders?: (google.analytics.data.v1beta.IPivotDimensionHeader[]|null); + + /** PivotHeader rowCount */ + rowCount?: (number|null); + } + + /** Represents a PivotHeader. */ + class PivotHeader implements IPivotHeader { + + /** + * Constructs a new PivotHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IPivotHeader); + + /** PivotHeader pivotDimensionHeaders. */ + public pivotDimensionHeaders: google.analytics.data.v1beta.IPivotDimensionHeader[]; + + /** PivotHeader rowCount. */ + public rowCount: number; + + /** + * Creates a new PivotHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns PivotHeader instance + */ + public static create(properties?: google.analytics.data.v1beta.IPivotHeader): google.analytics.data.v1beta.PivotHeader; + + /** + * Encodes the specified PivotHeader message. Does not implicitly {@link google.analytics.data.v1beta.PivotHeader.verify|verify} messages. + * @param message PivotHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IPivotHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PivotHeader message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.PivotHeader.verify|verify} messages. + * @param message PivotHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IPivotHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PivotHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PivotHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.PivotHeader; + + /** + * Decodes a PivotHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PivotHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.PivotHeader; + + /** + * Verifies a PivotHeader 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 PivotHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PivotHeader + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.PivotHeader; + + /** + * Creates a plain object from a PivotHeader message. Also converts values to other types if specified. + * @param message PivotHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.PivotHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PivotHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PivotHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PivotDimensionHeader. */ + interface IPivotDimensionHeader { + + /** PivotDimensionHeader dimensionValues */ + dimensionValues?: (google.analytics.data.v1beta.IDimensionValue[]|null); + } + + /** Represents a PivotDimensionHeader. */ + class PivotDimensionHeader implements IPivotDimensionHeader { + + /** + * Constructs a new PivotDimensionHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IPivotDimensionHeader); + + /** PivotDimensionHeader dimensionValues. */ + public dimensionValues: google.analytics.data.v1beta.IDimensionValue[]; + + /** + * Creates a new PivotDimensionHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns PivotDimensionHeader instance + */ + public static create(properties?: google.analytics.data.v1beta.IPivotDimensionHeader): google.analytics.data.v1beta.PivotDimensionHeader; + + /** + * Encodes the specified PivotDimensionHeader message. Does not implicitly {@link google.analytics.data.v1beta.PivotDimensionHeader.verify|verify} messages. + * @param message PivotDimensionHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IPivotDimensionHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PivotDimensionHeader message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.PivotDimensionHeader.verify|verify} messages. + * @param message PivotDimensionHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IPivotDimensionHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PivotDimensionHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PivotDimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.PivotDimensionHeader; + + /** + * Decodes a PivotDimensionHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PivotDimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.PivotDimensionHeader; + + /** + * Verifies a PivotDimensionHeader 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 PivotDimensionHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PivotDimensionHeader + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.PivotDimensionHeader; + + /** + * Creates a plain object from a PivotDimensionHeader message. Also converts values to other types if specified. + * @param message PivotDimensionHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.PivotDimensionHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PivotDimensionHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PivotDimensionHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Row. */ + interface IRow { + + /** Row dimensionValues */ + dimensionValues?: (google.analytics.data.v1beta.IDimensionValue[]|null); + + /** Row metricValues */ + metricValues?: (google.analytics.data.v1beta.IMetricValue[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IRow); + + /** Row dimensionValues. */ + public dimensionValues: google.analytics.data.v1beta.IDimensionValue[]; + + /** Row metricValues. */ + public metricValues: google.analytics.data.v1beta.IMetricValue[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.analytics.data.v1beta.IRow): google.analytics.data.v1beta.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.analytics.data.v1beta.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.Row; + + /** + * Verifies a Row 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 Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Row + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DimensionValue. */ + interface IDimensionValue { + + /** DimensionValue value */ + value?: (string|null); + } + + /** Represents a DimensionValue. */ + class DimensionValue implements IDimensionValue { + + /** + * Constructs a new DimensionValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IDimensionValue); + + /** DimensionValue value. */ + public value?: (string|null); + + /** DimensionValue oneValue. */ + public oneValue?: "value"; + + /** + * Creates a new DimensionValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DimensionValue instance + */ + public static create(properties?: google.analytics.data.v1beta.IDimensionValue): google.analytics.data.v1beta.DimensionValue; + + /** + * Encodes the specified DimensionValue message. Does not implicitly {@link google.analytics.data.v1beta.DimensionValue.verify|verify} messages. + * @param message DimensionValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IDimensionValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DimensionValue message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DimensionValue.verify|verify} messages. + * @param message DimensionValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IDimensionValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DimensionValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DimensionValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.DimensionValue; + + /** + * Decodes a DimensionValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DimensionValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.DimensionValue; + + /** + * Verifies a DimensionValue 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 DimensionValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DimensionValue + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.DimensionValue; + + /** + * Creates a plain object from a DimensionValue message. Also converts values to other types if specified. + * @param message DimensionValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.DimensionValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DimensionValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DimensionValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricValue. */ + interface IMetricValue { + + /** MetricValue value */ + value?: (string|null); + } + + /** Represents a MetricValue. */ + class MetricValue implements IMetricValue { + + /** + * Constructs a new MetricValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IMetricValue); + + /** MetricValue value. */ + public value?: (string|null); + + /** MetricValue oneValue. */ + public oneValue?: "value"; + + /** + * Creates a new MetricValue instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricValue instance + */ + public static create(properties?: google.analytics.data.v1beta.IMetricValue): google.analytics.data.v1beta.MetricValue; + + /** + * Encodes the specified MetricValue message. Does not implicitly {@link google.analytics.data.v1beta.MetricValue.verify|verify} messages. + * @param message MetricValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IMetricValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricValue message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.MetricValue.verify|verify} messages. + * @param message MetricValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IMetricValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.MetricValue; + + /** + * Decodes a MetricValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.MetricValue; + + /** + * Verifies a MetricValue 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 MetricValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricValue + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.MetricValue; + + /** + * Creates a plain object from a MetricValue message. Also converts values to other types if specified. + * @param message MetricValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.MetricValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricValue + * @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.data.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.data.v1beta.INumericValue): google.analytics.data.v1beta.NumericValue; + + /** + * Encodes the specified NumericValue message. Does not implicitly {@link google.analytics.data.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.data.v1beta.INumericValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NumericValue message, length delimited. Does not implicitly {@link google.analytics.data.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.data.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.data.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.data.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.data.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.data.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 a PropertyQuota. */ + interface IPropertyQuota { + + /** PropertyQuota tokensPerDay */ + tokensPerDay?: (google.analytics.data.v1beta.IQuotaStatus|null); + + /** PropertyQuota tokensPerHour */ + tokensPerHour?: (google.analytics.data.v1beta.IQuotaStatus|null); + + /** PropertyQuota concurrentRequests */ + concurrentRequests?: (google.analytics.data.v1beta.IQuotaStatus|null); + + /** PropertyQuota serverErrorsPerProjectPerHour */ + serverErrorsPerProjectPerHour?: (google.analytics.data.v1beta.IQuotaStatus|null); + + /** PropertyQuota potentiallyThresholdedRequestsPerHour */ + potentiallyThresholdedRequestsPerHour?: (google.analytics.data.v1beta.IQuotaStatus|null); + + /** PropertyQuota tokensPerProjectPerHour */ + tokensPerProjectPerHour?: (google.analytics.data.v1beta.IQuotaStatus|null); + } + + /** Represents a PropertyQuota. */ + class PropertyQuota implements IPropertyQuota { + + /** + * Constructs a new PropertyQuota. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IPropertyQuota); + + /** PropertyQuota tokensPerDay. */ + public tokensPerDay?: (google.analytics.data.v1beta.IQuotaStatus|null); + + /** PropertyQuota tokensPerHour. */ + public tokensPerHour?: (google.analytics.data.v1beta.IQuotaStatus|null); + + /** PropertyQuota concurrentRequests. */ + public concurrentRequests?: (google.analytics.data.v1beta.IQuotaStatus|null); + + /** PropertyQuota serverErrorsPerProjectPerHour. */ + public serverErrorsPerProjectPerHour?: (google.analytics.data.v1beta.IQuotaStatus|null); + + /** PropertyQuota potentiallyThresholdedRequestsPerHour. */ + public potentiallyThresholdedRequestsPerHour?: (google.analytics.data.v1beta.IQuotaStatus|null); + + /** PropertyQuota tokensPerProjectPerHour. */ + public tokensPerProjectPerHour?: (google.analytics.data.v1beta.IQuotaStatus|null); + + /** + * Creates a new PropertyQuota instance using the specified properties. + * @param [properties] Properties to set + * @returns PropertyQuota instance + */ + public static create(properties?: google.analytics.data.v1beta.IPropertyQuota): google.analytics.data.v1beta.PropertyQuota; + + /** + * Encodes the specified PropertyQuota message. Does not implicitly {@link google.analytics.data.v1beta.PropertyQuota.verify|verify} messages. + * @param message PropertyQuota message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IPropertyQuota, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PropertyQuota message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.PropertyQuota.verify|verify} messages. + * @param message PropertyQuota message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IPropertyQuota, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PropertyQuota message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PropertyQuota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.PropertyQuota; + + /** + * Decodes a PropertyQuota message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PropertyQuota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.PropertyQuota; + + /** + * Verifies a PropertyQuota 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 PropertyQuota message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PropertyQuota + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.PropertyQuota; + + /** + * Creates a plain object from a PropertyQuota message. Also converts values to other types if specified. + * @param message PropertyQuota + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.PropertyQuota, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PropertyQuota to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PropertyQuota + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QuotaStatus. */ + interface IQuotaStatus { + + /** QuotaStatus consumed */ + consumed?: (number|null); + + /** QuotaStatus remaining */ + remaining?: (number|null); + } + + /** Represents a QuotaStatus. */ + class QuotaStatus implements IQuotaStatus { + + /** + * Constructs a new QuotaStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IQuotaStatus); + + /** QuotaStatus consumed. */ + public consumed: number; + + /** QuotaStatus remaining. */ + public remaining: number; + + /** + * Creates a new QuotaStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns QuotaStatus instance + */ + public static create(properties?: google.analytics.data.v1beta.IQuotaStatus): google.analytics.data.v1beta.QuotaStatus; + + /** + * Encodes the specified QuotaStatus message. Does not implicitly {@link google.analytics.data.v1beta.QuotaStatus.verify|verify} messages. + * @param message QuotaStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IQuotaStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuotaStatus message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.QuotaStatus.verify|verify} messages. + * @param message QuotaStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IQuotaStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuotaStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuotaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.QuotaStatus; + + /** + * Decodes a QuotaStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuotaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.QuotaStatus; + + /** + * Verifies a QuotaStatus 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 QuotaStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuotaStatus + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.QuotaStatus; + + /** + * Creates a plain object from a QuotaStatus message. Also converts values to other types if specified. + * @param message QuotaStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.QuotaStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuotaStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuotaStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DimensionMetadata. */ + interface IDimensionMetadata { + + /** DimensionMetadata apiName */ + apiName?: (string|null); + + /** DimensionMetadata uiName */ + uiName?: (string|null); + + /** DimensionMetadata description */ + description?: (string|null); + + /** DimensionMetadata deprecatedApiNames */ + deprecatedApiNames?: (string[]|null); + + /** DimensionMetadata customDefinition */ + customDefinition?: (boolean|null); + + /** DimensionMetadata category */ + category?: (string|null); + } + + /** Represents a DimensionMetadata. */ + class DimensionMetadata implements IDimensionMetadata { + + /** + * Constructs a new DimensionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IDimensionMetadata); + + /** DimensionMetadata apiName. */ + public apiName: string; + + /** DimensionMetadata uiName. */ + public uiName: string; + + /** DimensionMetadata description. */ + public description: string; + + /** DimensionMetadata deprecatedApiNames. */ + public deprecatedApiNames: string[]; + + /** DimensionMetadata customDefinition. */ + public customDefinition: boolean; + + /** DimensionMetadata category. */ + public category: string; + + /** + * Creates a new DimensionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DimensionMetadata instance + */ + public static create(properties?: google.analytics.data.v1beta.IDimensionMetadata): google.analytics.data.v1beta.DimensionMetadata; + + /** + * Encodes the specified DimensionMetadata message. Does not implicitly {@link google.analytics.data.v1beta.DimensionMetadata.verify|verify} messages. + * @param message DimensionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IDimensionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DimensionMetadata message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DimensionMetadata.verify|verify} messages. + * @param message DimensionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IDimensionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DimensionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DimensionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.DimensionMetadata; + + /** + * Decodes a DimensionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DimensionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.DimensionMetadata; + + /** + * Verifies a DimensionMetadata 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 DimensionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DimensionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.DimensionMetadata; + + /** + * Creates a plain object from a DimensionMetadata message. Also converts values to other types if specified. + * @param message DimensionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.DimensionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DimensionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DimensionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricMetadata. */ + interface IMetricMetadata { + + /** MetricMetadata apiName */ + apiName?: (string|null); + + /** MetricMetadata uiName */ + uiName?: (string|null); + + /** MetricMetadata description */ + description?: (string|null); + + /** MetricMetadata deprecatedApiNames */ + deprecatedApiNames?: (string[]|null); + + /** MetricMetadata type */ + type?: (google.analytics.data.v1beta.MetricType|keyof typeof google.analytics.data.v1beta.MetricType|null); + + /** MetricMetadata expression */ + expression?: (string|null); + + /** MetricMetadata customDefinition */ + customDefinition?: (boolean|null); + + /** MetricMetadata blockedReasons */ + blockedReasons?: (google.analytics.data.v1beta.MetricMetadata.BlockedReason[]|null); + + /** MetricMetadata category */ + category?: (string|null); + } + + /** Represents a MetricMetadata. */ + class MetricMetadata implements IMetricMetadata { + + /** + * Constructs a new MetricMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IMetricMetadata); + + /** MetricMetadata apiName. */ + public apiName: string; + + /** MetricMetadata uiName. */ + public uiName: string; + + /** MetricMetadata description. */ + public description: string; + + /** MetricMetadata deprecatedApiNames. */ + public deprecatedApiNames: string[]; + + /** MetricMetadata type. */ + public type: (google.analytics.data.v1beta.MetricType|keyof typeof google.analytics.data.v1beta.MetricType); + + /** MetricMetadata expression. */ + public expression: string; + + /** MetricMetadata customDefinition. */ + public customDefinition: boolean; + + /** MetricMetadata blockedReasons. */ + public blockedReasons: google.analytics.data.v1beta.MetricMetadata.BlockedReason[]; + + /** MetricMetadata category. */ + public category: string; + + /** + * Creates a new MetricMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricMetadata instance + */ + public static create(properties?: google.analytics.data.v1beta.IMetricMetadata): google.analytics.data.v1beta.MetricMetadata; + + /** + * Encodes the specified MetricMetadata message. Does not implicitly {@link google.analytics.data.v1beta.MetricMetadata.verify|verify} messages. + * @param message MetricMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IMetricMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricMetadata message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.MetricMetadata.verify|verify} messages. + * @param message MetricMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IMetricMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.MetricMetadata; + + /** + * Decodes a MetricMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.MetricMetadata; + + /** + * Verifies a MetricMetadata 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 MetricMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricMetadata + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.MetricMetadata; + + /** + * Creates a plain object from a MetricMetadata message. Also converts values to other types if specified. + * @param message MetricMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.MetricMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MetricMetadata { + + /** BlockedReason enum. */ + enum BlockedReason { + BLOCKED_REASON_UNSPECIFIED = 0, + NO_REVENUE_METRICS = 1, + NO_COST_METRICS = 2 + } + } + + /** Properties of a DimensionCompatibility. */ + interface IDimensionCompatibility { + + /** DimensionCompatibility dimensionMetadata */ + dimensionMetadata?: (google.analytics.data.v1beta.IDimensionMetadata|null); + + /** DimensionCompatibility compatibility */ + compatibility?: (google.analytics.data.v1beta.Compatibility|keyof typeof google.analytics.data.v1beta.Compatibility|null); + } + + /** Represents a DimensionCompatibility. */ + class DimensionCompatibility implements IDimensionCompatibility { + + /** + * Constructs a new DimensionCompatibility. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IDimensionCompatibility); + + /** DimensionCompatibility dimensionMetadata. */ + public dimensionMetadata?: (google.analytics.data.v1beta.IDimensionMetadata|null); + + /** DimensionCompatibility compatibility. */ + public compatibility?: (google.analytics.data.v1beta.Compatibility|keyof typeof google.analytics.data.v1beta.Compatibility|null); + + /** DimensionCompatibility _dimensionMetadata. */ + public _dimensionMetadata?: "dimensionMetadata"; + + /** DimensionCompatibility _compatibility. */ + public _compatibility?: "compatibility"; + + /** + * Creates a new DimensionCompatibility instance using the specified properties. + * @param [properties] Properties to set + * @returns DimensionCompatibility instance + */ + public static create(properties?: google.analytics.data.v1beta.IDimensionCompatibility): google.analytics.data.v1beta.DimensionCompatibility; + + /** + * Encodes the specified DimensionCompatibility message. Does not implicitly {@link google.analytics.data.v1beta.DimensionCompatibility.verify|verify} messages. + * @param message DimensionCompatibility message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IDimensionCompatibility, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DimensionCompatibility message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DimensionCompatibility.verify|verify} messages. + * @param message DimensionCompatibility message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IDimensionCompatibility, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DimensionCompatibility message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DimensionCompatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.DimensionCompatibility; + + /** + * Decodes a DimensionCompatibility message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DimensionCompatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.DimensionCompatibility; + + /** + * Verifies a DimensionCompatibility 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 DimensionCompatibility message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DimensionCompatibility + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.DimensionCompatibility; + + /** + * Creates a plain object from a DimensionCompatibility message. Also converts values to other types if specified. + * @param message DimensionCompatibility + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.DimensionCompatibility, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DimensionCompatibility to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DimensionCompatibility + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricCompatibility. */ + interface IMetricCompatibility { + + /** MetricCompatibility metricMetadata */ + metricMetadata?: (google.analytics.data.v1beta.IMetricMetadata|null); + + /** MetricCompatibility compatibility */ + compatibility?: (google.analytics.data.v1beta.Compatibility|keyof typeof google.analytics.data.v1beta.Compatibility|null); + } + + /** Represents a MetricCompatibility. */ + class MetricCompatibility implements IMetricCompatibility { + + /** + * Constructs a new MetricCompatibility. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.IMetricCompatibility); + + /** MetricCompatibility metricMetadata. */ + public metricMetadata?: (google.analytics.data.v1beta.IMetricMetadata|null); + + /** MetricCompatibility compatibility. */ + public compatibility?: (google.analytics.data.v1beta.Compatibility|keyof typeof google.analytics.data.v1beta.Compatibility|null); + + /** MetricCompatibility _metricMetadata. */ + public _metricMetadata?: "metricMetadata"; + + /** MetricCompatibility _compatibility. */ + public _compatibility?: "compatibility"; + + /** + * Creates a new MetricCompatibility instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricCompatibility instance + */ + public static create(properties?: google.analytics.data.v1beta.IMetricCompatibility): google.analytics.data.v1beta.MetricCompatibility; + + /** + * Encodes the specified MetricCompatibility message. Does not implicitly {@link google.analytics.data.v1beta.MetricCompatibility.verify|verify} messages. + * @param message MetricCompatibility message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.IMetricCompatibility, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricCompatibility message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.MetricCompatibility.verify|verify} messages. + * @param message MetricCompatibility message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.IMetricCompatibility, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricCompatibility message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricCompatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.data.v1beta.MetricCompatibility; + + /** + * Decodes a MetricCompatibility message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricCompatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.data.v1beta.MetricCompatibility; + + /** + * Verifies a MetricCompatibility 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 MetricCompatibility message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricCompatibility + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.MetricCompatibility; + + /** + * Creates a plain object from a MetricCompatibility message. Also converts values to other types if specified. + * @param message MetricCompatibility + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.MetricCompatibility, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricCompatibility to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricCompatibility + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** MetricAggregation enum. */ + enum MetricAggregation { + METRIC_AGGREGATION_UNSPECIFIED = 0, + TOTAL = 1, + MINIMUM = 5, + MAXIMUM = 6, + COUNT = 4 + } + + /** MetricType enum. */ + enum MetricType { + METRIC_TYPE_UNSPECIFIED = 0, + TYPE_INTEGER = 1, + TYPE_FLOAT = 2, + TYPE_SECONDS = 4, + TYPE_MILLISECONDS = 5, + TYPE_MINUTES = 6, + TYPE_HOURS = 7, + TYPE_STANDARD = 8, + TYPE_CURRENCY = 9, + TYPE_FEET = 10, + TYPE_MILES = 11, + TYPE_METERS = 12, + TYPE_KILOMETERS = 13 + } + + /** RestrictedMetricType enum. */ + enum RestrictedMetricType { + RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0, + COST_DATA = 1, + REVENUE_DATA = 2 + } + + /** Compatibility enum. */ + enum Compatibility { + COMPATIBILITY_UNSPECIFIED = 0, + COMPATIBLE = 1, + INCOMPATIBLE = 2 + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @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.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @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.api.Http; + + /** + * Verifies a Http 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 Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @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.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @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.api.HttpRule; + + /** + * Verifies a HttpRule 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @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.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @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.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @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.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @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.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor 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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @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.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @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.api.ResourceReference; + + /** + * Verifies a ResourceReference 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-analytics-data/protos/protos.js b/packages/google-analytics-data/protos/protos.js new file mode 100644 index 00000000000..ecab3f520ba --- /dev/null +++ b/packages/google-analytics-data/protos/protos.js @@ -0,0 +1,45533 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_analytics_data_protos || ($protobuf.roots._google_analytics_data_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(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]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.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.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + 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]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.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.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + 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]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.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.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.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.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(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]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.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.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(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]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.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.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.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.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(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]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.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.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(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]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.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.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.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.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(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]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.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.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(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]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.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.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + 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]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.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.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(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]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.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.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + 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]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.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.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.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.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + 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]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.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.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.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.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.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.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.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.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.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.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + 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]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.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.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + 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]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.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.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(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]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.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.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + 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]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.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.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + 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]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.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.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + 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]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.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.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + 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]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.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.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + return protobuf; + })(); + + google.analytics = (function() { + + /** + * Namespace analytics. + * @memberof google + * @namespace + */ + var analytics = {}; + + analytics.data = (function() { + + /** + * Namespace data. + * @memberof google.analytics + * @namespace + */ + var data = {}; + + data.v1alpha = (function() { + + /** + * Namespace v1alpha. + * @memberof google.analytics.data + * @namespace + */ + var v1alpha = {}; + + v1alpha.AlphaAnalyticsData = (function() { + + /** + * Constructs a new AlphaAnalyticsData service. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents an AlphaAnalyticsData + * @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 AlphaAnalyticsData(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AlphaAnalyticsData.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlphaAnalyticsData; + + /** + * Creates new AlphaAnalyticsData service using the specified rpc implementation. + * @function create + * @memberof google.analytics.data.v1alpha.AlphaAnalyticsData + * @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 {AlphaAnalyticsData} RPC service. Useful where requests and/or responses are streamed. + */ + AlphaAnalyticsData.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.analytics.data.v1alpha.AlphaAnalyticsData|runFunnelReport}. + * @memberof google.analytics.data.v1alpha.AlphaAnalyticsData + * @typedef RunFunnelReportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.data.v1alpha.RunFunnelReportResponse} [response] RunFunnelReportResponse + */ + + /** + * Calls RunFunnelReport. + * @function runFunnelReport + * @memberof google.analytics.data.v1alpha.AlphaAnalyticsData + * @instance + * @param {google.analytics.data.v1alpha.IRunFunnelReportRequest} request RunFunnelReportRequest message or plain object + * @param {google.analytics.data.v1alpha.AlphaAnalyticsData.RunFunnelReportCallback} callback Node-style callback called with the error, if any, and RunFunnelReportResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlphaAnalyticsData.prototype.runFunnelReport = function runFunnelReport(request, callback) { + return this.rpcCall(runFunnelReport, $root.google.analytics.data.v1alpha.RunFunnelReportRequest, $root.google.analytics.data.v1alpha.RunFunnelReportResponse, request, callback); + }, "name", { value: "RunFunnelReport" }); + + /** + * Calls RunFunnelReport. + * @function runFunnelReport + * @memberof google.analytics.data.v1alpha.AlphaAnalyticsData + * @instance + * @param {google.analytics.data.v1alpha.IRunFunnelReportRequest} request RunFunnelReportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AlphaAnalyticsData; + })(); + + v1alpha.RunFunnelReportRequest = (function() { + + /** + * Properties of a RunFunnelReportRequest. + * @memberof google.analytics.data.v1alpha + * @interface IRunFunnelReportRequest + * @property {string|null} [property] RunFunnelReportRequest property + * @property {Array.|null} [dateRanges] RunFunnelReportRequest dateRanges + * @property {google.analytics.data.v1alpha.IFunnel|null} [funnel] RunFunnelReportRequest funnel + * @property {google.analytics.data.v1alpha.IFunnelBreakdown|null} [funnelBreakdown] RunFunnelReportRequest funnelBreakdown + * @property {google.analytics.data.v1alpha.IFunnelNextAction|null} [funnelNextAction] RunFunnelReportRequest funnelNextAction + * @property {google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType|null} [funnelVisualizationType] RunFunnelReportRequest funnelVisualizationType + * @property {Array.|null} [segments] RunFunnelReportRequest segments + * @property {number|Long|null} [limit] RunFunnelReportRequest limit + * @property {google.analytics.data.v1alpha.IFilterExpression|null} [dimensionFilter] RunFunnelReportRequest dimensionFilter + * @property {boolean|null} [returnPropertyQuota] RunFunnelReportRequest returnPropertyQuota + */ + + /** + * Constructs a new RunFunnelReportRequest. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a RunFunnelReportRequest. + * @implements IRunFunnelReportRequest + * @constructor + * @param {google.analytics.data.v1alpha.IRunFunnelReportRequest=} [properties] Properties to set + */ + function RunFunnelReportRequest(properties) { + this.dateRanges = []; + this.segments = []; + 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]]; + } + + /** + * RunFunnelReportRequest property. + * @member {string} property + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @instance + */ + RunFunnelReportRequest.prototype.property = ""; + + /** + * RunFunnelReportRequest dateRanges. + * @member {Array.} dateRanges + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @instance + */ + RunFunnelReportRequest.prototype.dateRanges = $util.emptyArray; + + /** + * RunFunnelReportRequest funnel. + * @member {google.analytics.data.v1alpha.IFunnel|null|undefined} funnel + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @instance + */ + RunFunnelReportRequest.prototype.funnel = null; + + /** + * RunFunnelReportRequest funnelBreakdown. + * @member {google.analytics.data.v1alpha.IFunnelBreakdown|null|undefined} funnelBreakdown + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @instance + */ + RunFunnelReportRequest.prototype.funnelBreakdown = null; + + /** + * RunFunnelReportRequest funnelNextAction. + * @member {google.analytics.data.v1alpha.IFunnelNextAction|null|undefined} funnelNextAction + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @instance + */ + RunFunnelReportRequest.prototype.funnelNextAction = null; + + /** + * RunFunnelReportRequest funnelVisualizationType. + * @member {google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType} funnelVisualizationType + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @instance + */ + RunFunnelReportRequest.prototype.funnelVisualizationType = 0; + + /** + * RunFunnelReportRequest segments. + * @member {Array.} segments + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @instance + */ + RunFunnelReportRequest.prototype.segments = $util.emptyArray; + + /** + * RunFunnelReportRequest limit. + * @member {number|Long} limit + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @instance + */ + RunFunnelReportRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RunFunnelReportRequest dimensionFilter. + * @member {google.analytics.data.v1alpha.IFilterExpression|null|undefined} dimensionFilter + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @instance + */ + RunFunnelReportRequest.prototype.dimensionFilter = null; + + /** + * RunFunnelReportRequest returnPropertyQuota. + * @member {boolean} returnPropertyQuota + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @instance + */ + RunFunnelReportRequest.prototype.returnPropertyQuota = false; + + /** + * Creates a new RunFunnelReportRequest instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @static + * @param {google.analytics.data.v1alpha.IRunFunnelReportRequest=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.RunFunnelReportRequest} RunFunnelReportRequest instance + */ + RunFunnelReportRequest.create = function create(properties) { + return new RunFunnelReportRequest(properties); + }; + + /** + * Encodes the specified RunFunnelReportRequest message. Does not implicitly {@link google.analytics.data.v1alpha.RunFunnelReportRequest.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @static + * @param {google.analytics.data.v1alpha.IRunFunnelReportRequest} message RunFunnelReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunFunnelReportRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && Object.hasOwnProperty.call(message, "property")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); + if (message.dateRanges != null && message.dateRanges.length) + for (var i = 0; i < message.dateRanges.length; ++i) + $root.google.analytics.data.v1alpha.DateRange.encode(message.dateRanges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.funnel != null && Object.hasOwnProperty.call(message, "funnel")) + $root.google.analytics.data.v1alpha.Funnel.encode(message.funnel, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.funnelBreakdown != null && Object.hasOwnProperty.call(message, "funnelBreakdown")) + $root.google.analytics.data.v1alpha.FunnelBreakdown.encode(message.funnelBreakdown, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.funnelNextAction != null && Object.hasOwnProperty.call(message, "funnelNextAction")) + $root.google.analytics.data.v1alpha.FunnelNextAction.encode(message.funnelNextAction, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.funnelVisualizationType != null && Object.hasOwnProperty.call(message, "funnelVisualizationType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.funnelVisualizationType); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.analytics.data.v1alpha.Segment.encode(message.segments[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.limit); + if (message.dimensionFilter != null && Object.hasOwnProperty.call(message, "dimensionFilter")) + $root.google.analytics.data.v1alpha.FilterExpression.encode(message.dimensionFilter, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.returnPropertyQuota != null && Object.hasOwnProperty.call(message, "returnPropertyQuota")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.returnPropertyQuota); + return writer; + }; + + /** + * Encodes the specified RunFunnelReportRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.RunFunnelReportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @static + * @param {google.analytics.data.v1alpha.IRunFunnelReportRequest} message RunFunnelReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunFunnelReportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunFunnelReportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.RunFunnelReportRequest} RunFunnelReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunFunnelReportRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.RunFunnelReportRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.property = reader.string(); + break; + } + case 2: { + if (!(message.dateRanges && message.dateRanges.length)) + message.dateRanges = []; + message.dateRanges.push($root.google.analytics.data.v1alpha.DateRange.decode(reader, reader.uint32())); + break; + } + case 3: { + message.funnel = $root.google.analytics.data.v1alpha.Funnel.decode(reader, reader.uint32()); + break; + } + case 4: { + message.funnelBreakdown = $root.google.analytics.data.v1alpha.FunnelBreakdown.decode(reader, reader.uint32()); + break; + } + case 5: { + message.funnelNextAction = $root.google.analytics.data.v1alpha.FunnelNextAction.decode(reader, reader.uint32()); + break; + } + case 6: { + message.funnelVisualizationType = reader.int32(); + break; + } + case 7: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.analytics.data.v1alpha.Segment.decode(reader, reader.uint32())); + break; + } + case 9: { + message.limit = reader.int64(); + break; + } + case 10: { + message.dimensionFilter = $root.google.analytics.data.v1alpha.FilterExpression.decode(reader, reader.uint32()); + break; + } + case 12: { + message.returnPropertyQuota = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunFunnelReportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.RunFunnelReportRequest} RunFunnelReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunFunnelReportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunFunnelReportRequest message. + * @function verify + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunFunnelReportRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) + if (!$util.isString(message.property)) + return "property: string expected"; + 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.data.v1alpha.DateRange.verify(message.dateRanges[i]); + if (error) + return "dateRanges." + error; + } + } + if (message.funnel != null && message.hasOwnProperty("funnel")) { + var error = $root.google.analytics.data.v1alpha.Funnel.verify(message.funnel); + if (error) + return "funnel." + error; + } + if (message.funnelBreakdown != null && message.hasOwnProperty("funnelBreakdown")) { + var error = $root.google.analytics.data.v1alpha.FunnelBreakdown.verify(message.funnelBreakdown); + if (error) + return "funnelBreakdown." + error; + } + if (message.funnelNextAction != null && message.hasOwnProperty("funnelNextAction")) { + var error = $root.google.analytics.data.v1alpha.FunnelNextAction.verify(message.funnelNextAction); + if (error) + return "funnelNextAction." + error; + } + if (message.funnelVisualizationType != null && message.hasOwnProperty("funnelVisualizationType")) + switch (message.funnelVisualizationType) { + default: + return "funnelVisualizationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.analytics.data.v1alpha.Segment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + 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.dimensionFilter != null && message.hasOwnProperty("dimensionFilter")) { + var error = $root.google.analytics.data.v1alpha.FilterExpression.verify(message.dimensionFilter); + if (error) + return "dimensionFilter." + error; + } + if (message.returnPropertyQuota != null && message.hasOwnProperty("returnPropertyQuota")) + if (typeof message.returnPropertyQuota !== "boolean") + return "returnPropertyQuota: boolean expected"; + return null; + }; + + /** + * Creates a RunFunnelReportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.RunFunnelReportRequest} RunFunnelReportRequest + */ + RunFunnelReportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.RunFunnelReportRequest) + return object; + var message = new $root.google.analytics.data.v1alpha.RunFunnelReportRequest(); + if (object.property != null) + message.property = String(object.property); + if (object.dateRanges) { + if (!Array.isArray(object.dateRanges)) + throw TypeError(".google.analytics.data.v1alpha.RunFunnelReportRequest.dateRanges: array expected"); + message.dateRanges = []; + for (var i = 0; i < object.dateRanges.length; ++i) { + if (typeof object.dateRanges[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.RunFunnelReportRequest.dateRanges: object expected"); + message.dateRanges[i] = $root.google.analytics.data.v1alpha.DateRange.fromObject(object.dateRanges[i]); + } + } + if (object.funnel != null) { + if (typeof object.funnel !== "object") + throw TypeError(".google.analytics.data.v1alpha.RunFunnelReportRequest.funnel: object expected"); + message.funnel = $root.google.analytics.data.v1alpha.Funnel.fromObject(object.funnel); + } + if (object.funnelBreakdown != null) { + if (typeof object.funnelBreakdown !== "object") + throw TypeError(".google.analytics.data.v1alpha.RunFunnelReportRequest.funnelBreakdown: object expected"); + message.funnelBreakdown = $root.google.analytics.data.v1alpha.FunnelBreakdown.fromObject(object.funnelBreakdown); + } + if (object.funnelNextAction != null) { + if (typeof object.funnelNextAction !== "object") + throw TypeError(".google.analytics.data.v1alpha.RunFunnelReportRequest.funnelNextAction: object expected"); + message.funnelNextAction = $root.google.analytics.data.v1alpha.FunnelNextAction.fromObject(object.funnelNextAction); + } + switch (object.funnelVisualizationType) { + default: + if (typeof object.funnelVisualizationType === "number") { + message.funnelVisualizationType = object.funnelVisualizationType; + break; + } + break; + case "FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED": + case 0: + message.funnelVisualizationType = 0; + break; + case "STANDARD_FUNNEL": + case 1: + message.funnelVisualizationType = 1; + break; + case "TRENDED_FUNNEL": + case 2: + message.funnelVisualizationType = 2; + break; + } + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.analytics.data.v1alpha.RunFunnelReportRequest.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.RunFunnelReportRequest.segments: object expected"); + message.segments[i] = $root.google.analytics.data.v1alpha.Segment.fromObject(object.segments[i]); + } + } + 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.dimensionFilter != null) { + if (typeof object.dimensionFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.RunFunnelReportRequest.dimensionFilter: object expected"); + message.dimensionFilter = $root.google.analytics.data.v1alpha.FilterExpression.fromObject(object.dimensionFilter); + } + if (object.returnPropertyQuota != null) + message.returnPropertyQuota = Boolean(object.returnPropertyQuota); + return message; + }; + + /** + * Creates a plain object from a RunFunnelReportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @static + * @param {google.analytics.data.v1alpha.RunFunnelReportRequest} message RunFunnelReportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunFunnelReportRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dateRanges = []; + object.segments = []; + } + if (options.defaults) { + object.property = ""; + object.funnel = null; + object.funnelBreakdown = null; + object.funnelNextAction = null; + object.funnelVisualizationType = options.enums === String ? "FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED" : 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.dimensionFilter = null; + object.returnPropertyQuota = false; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = message.property; + if (message.dateRanges && message.dateRanges.length) { + object.dateRanges = []; + for (var j = 0; j < message.dateRanges.length; ++j) + object.dateRanges[j] = $root.google.analytics.data.v1alpha.DateRange.toObject(message.dateRanges[j], options); + } + if (message.funnel != null && message.hasOwnProperty("funnel")) + object.funnel = $root.google.analytics.data.v1alpha.Funnel.toObject(message.funnel, options); + if (message.funnelBreakdown != null && message.hasOwnProperty("funnelBreakdown")) + object.funnelBreakdown = $root.google.analytics.data.v1alpha.FunnelBreakdown.toObject(message.funnelBreakdown, options); + if (message.funnelNextAction != null && message.hasOwnProperty("funnelNextAction")) + object.funnelNextAction = $root.google.analytics.data.v1alpha.FunnelNextAction.toObject(message.funnelNextAction, options); + if (message.funnelVisualizationType != null && message.hasOwnProperty("funnelVisualizationType")) + object.funnelVisualizationType = options.enums === String ? $root.google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType[message.funnelVisualizationType] === undefined ? message.funnelVisualizationType : $root.google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType[message.funnelVisualizationType] : message.funnelVisualizationType; + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.analytics.data.v1alpha.Segment.toObject(message.segments[j], options); + } + 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.dimensionFilter != null && message.hasOwnProperty("dimensionFilter")) + object.dimensionFilter = $root.google.analytics.data.v1alpha.FilterExpression.toObject(message.dimensionFilter, options); + if (message.returnPropertyQuota != null && message.hasOwnProperty("returnPropertyQuota")) + object.returnPropertyQuota = message.returnPropertyQuota; + return object; + }; + + /** + * Converts this RunFunnelReportRequest to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @instance + * @returns {Object.} JSON object + */ + RunFunnelReportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunFunnelReportRequest + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.RunFunnelReportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunFunnelReportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.RunFunnelReportRequest"; + }; + + /** + * FunnelVisualizationType enum. + * @name google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType + * @enum {number} + * @property {number} FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED=0 FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED value + * @property {number} STANDARD_FUNNEL=1 STANDARD_FUNNEL value + * @property {number} TRENDED_FUNNEL=2 TRENDED_FUNNEL value + */ + RunFunnelReportRequest.FunnelVisualizationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD_FUNNEL"] = 1; + values[valuesById[2] = "TRENDED_FUNNEL"] = 2; + return values; + })(); + + return RunFunnelReportRequest; + })(); + + v1alpha.RunFunnelReportResponse = (function() { + + /** + * Properties of a RunFunnelReportResponse. + * @memberof google.analytics.data.v1alpha + * @interface IRunFunnelReportResponse + * @property {google.analytics.data.v1alpha.IFunnelSubReport|null} [funnelTable] RunFunnelReportResponse funnelTable + * @property {google.analytics.data.v1alpha.IFunnelSubReport|null} [funnelVisualization] RunFunnelReportResponse funnelVisualization + * @property {google.analytics.data.v1alpha.IPropertyQuota|null} [propertyQuota] RunFunnelReportResponse propertyQuota + * @property {string|null} [kind] RunFunnelReportResponse kind + */ + + /** + * Constructs a new RunFunnelReportResponse. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a RunFunnelReportResponse. + * @implements IRunFunnelReportResponse + * @constructor + * @param {google.analytics.data.v1alpha.IRunFunnelReportResponse=} [properties] Properties to set + */ + function RunFunnelReportResponse(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]]; + } + + /** + * RunFunnelReportResponse funnelTable. + * @member {google.analytics.data.v1alpha.IFunnelSubReport|null|undefined} funnelTable + * @memberof google.analytics.data.v1alpha.RunFunnelReportResponse + * @instance + */ + RunFunnelReportResponse.prototype.funnelTable = null; + + /** + * RunFunnelReportResponse funnelVisualization. + * @member {google.analytics.data.v1alpha.IFunnelSubReport|null|undefined} funnelVisualization + * @memberof google.analytics.data.v1alpha.RunFunnelReportResponse + * @instance + */ + RunFunnelReportResponse.prototype.funnelVisualization = null; + + /** + * RunFunnelReportResponse propertyQuota. + * @member {google.analytics.data.v1alpha.IPropertyQuota|null|undefined} propertyQuota + * @memberof google.analytics.data.v1alpha.RunFunnelReportResponse + * @instance + */ + RunFunnelReportResponse.prototype.propertyQuota = null; + + /** + * RunFunnelReportResponse kind. + * @member {string} kind + * @memberof google.analytics.data.v1alpha.RunFunnelReportResponse + * @instance + */ + RunFunnelReportResponse.prototype.kind = ""; + + /** + * Creates a new RunFunnelReportResponse instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.RunFunnelReportResponse + * @static + * @param {google.analytics.data.v1alpha.IRunFunnelReportResponse=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.RunFunnelReportResponse} RunFunnelReportResponse instance + */ + RunFunnelReportResponse.create = function create(properties) { + return new RunFunnelReportResponse(properties); + }; + + /** + * Encodes the specified RunFunnelReportResponse message. Does not implicitly {@link google.analytics.data.v1alpha.RunFunnelReportResponse.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.RunFunnelReportResponse + * @static + * @param {google.analytics.data.v1alpha.IRunFunnelReportResponse} message RunFunnelReportResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunFunnelReportResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.funnelTable != null && Object.hasOwnProperty.call(message, "funnelTable")) + $root.google.analytics.data.v1alpha.FunnelSubReport.encode(message.funnelTable, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.funnelVisualization != null && Object.hasOwnProperty.call(message, "funnelVisualization")) + $root.google.analytics.data.v1alpha.FunnelSubReport.encode(message.funnelVisualization, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.propertyQuota != null && Object.hasOwnProperty.call(message, "propertyQuota")) + $root.google.analytics.data.v1alpha.PropertyQuota.encode(message.propertyQuota, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kind); + return writer; + }; + + /** + * Encodes the specified RunFunnelReportResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.RunFunnelReportResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.RunFunnelReportResponse + * @static + * @param {google.analytics.data.v1alpha.IRunFunnelReportResponse} message RunFunnelReportResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunFunnelReportResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunFunnelReportResponse message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.RunFunnelReportResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.RunFunnelReportResponse} RunFunnelReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunFunnelReportResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.RunFunnelReportResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.funnelTable = $root.google.analytics.data.v1alpha.FunnelSubReport.decode(reader, reader.uint32()); + break; + } + case 2: { + message.funnelVisualization = $root.google.analytics.data.v1alpha.FunnelSubReport.decode(reader, reader.uint32()); + break; + } + case 3: { + message.propertyQuota = $root.google.analytics.data.v1alpha.PropertyQuota.decode(reader, reader.uint32()); + break; + } + case 4: { + message.kind = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunFunnelReportResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.RunFunnelReportResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.RunFunnelReportResponse} RunFunnelReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunFunnelReportResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunFunnelReportResponse message. + * @function verify + * @memberof google.analytics.data.v1alpha.RunFunnelReportResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunFunnelReportResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.funnelTable != null && message.hasOwnProperty("funnelTable")) { + var error = $root.google.analytics.data.v1alpha.FunnelSubReport.verify(message.funnelTable); + if (error) + return "funnelTable." + error; + } + if (message.funnelVisualization != null && message.hasOwnProperty("funnelVisualization")) { + var error = $root.google.analytics.data.v1alpha.FunnelSubReport.verify(message.funnelVisualization); + if (error) + return "funnelVisualization." + error; + } + if (message.propertyQuota != null && message.hasOwnProperty("propertyQuota")) { + var error = $root.google.analytics.data.v1alpha.PropertyQuota.verify(message.propertyQuota); + if (error) + return "propertyQuota." + error; + } + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + return null; + }; + + /** + * Creates a RunFunnelReportResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.RunFunnelReportResponse + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.RunFunnelReportResponse} RunFunnelReportResponse + */ + RunFunnelReportResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.RunFunnelReportResponse) + return object; + var message = new $root.google.analytics.data.v1alpha.RunFunnelReportResponse(); + if (object.funnelTable != null) { + if (typeof object.funnelTable !== "object") + throw TypeError(".google.analytics.data.v1alpha.RunFunnelReportResponse.funnelTable: object expected"); + message.funnelTable = $root.google.analytics.data.v1alpha.FunnelSubReport.fromObject(object.funnelTable); + } + if (object.funnelVisualization != null) { + if (typeof object.funnelVisualization !== "object") + throw TypeError(".google.analytics.data.v1alpha.RunFunnelReportResponse.funnelVisualization: object expected"); + message.funnelVisualization = $root.google.analytics.data.v1alpha.FunnelSubReport.fromObject(object.funnelVisualization); + } + if (object.propertyQuota != null) { + if (typeof object.propertyQuota !== "object") + throw TypeError(".google.analytics.data.v1alpha.RunFunnelReportResponse.propertyQuota: object expected"); + message.propertyQuota = $root.google.analytics.data.v1alpha.PropertyQuota.fromObject(object.propertyQuota); + } + if (object.kind != null) + message.kind = String(object.kind); + return message; + }; + + /** + * Creates a plain object from a RunFunnelReportResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.RunFunnelReportResponse + * @static + * @param {google.analytics.data.v1alpha.RunFunnelReportResponse} message RunFunnelReportResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunFunnelReportResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.funnelTable = null; + object.funnelVisualization = null; + object.propertyQuota = null; + object.kind = ""; + } + if (message.funnelTable != null && message.hasOwnProperty("funnelTable")) + object.funnelTable = $root.google.analytics.data.v1alpha.FunnelSubReport.toObject(message.funnelTable, options); + if (message.funnelVisualization != null && message.hasOwnProperty("funnelVisualization")) + object.funnelVisualization = $root.google.analytics.data.v1alpha.FunnelSubReport.toObject(message.funnelVisualization, options); + if (message.propertyQuota != null && message.hasOwnProperty("propertyQuota")) + object.propertyQuota = $root.google.analytics.data.v1alpha.PropertyQuota.toObject(message.propertyQuota, options); + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + return object; + }; + + /** + * Converts this RunFunnelReportResponse to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.RunFunnelReportResponse + * @instance + * @returns {Object.} JSON object + */ + RunFunnelReportResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunFunnelReportResponse + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.RunFunnelReportResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunFunnelReportResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.RunFunnelReportResponse"; + }; + + return RunFunnelReportResponse; + })(); + + v1alpha.DateRange = (function() { + + /** + * Properties of a DateRange. + * @memberof google.analytics.data.v1alpha + * @interface IDateRange + * @property {string|null} [startDate] DateRange startDate + * @property {string|null} [endDate] DateRange endDate + * @property {string|null} [name] DateRange name + */ + + /** + * Constructs a new DateRange. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a DateRange. + * @implements IDateRange + * @constructor + * @param {google.analytics.data.v1alpha.IDateRange=} [properties] Properties to set + */ + function DateRange(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]]; + } + + /** + * DateRange startDate. + * @member {string} startDate + * @memberof google.analytics.data.v1alpha.DateRange + * @instance + */ + DateRange.prototype.startDate = ""; + + /** + * DateRange endDate. + * @member {string} endDate + * @memberof google.analytics.data.v1alpha.DateRange + * @instance + */ + DateRange.prototype.endDate = ""; + + /** + * DateRange name. + * @member {string} name + * @memberof google.analytics.data.v1alpha.DateRange + * @instance + */ + DateRange.prototype.name = ""; + + /** + * Creates a new DateRange instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.DateRange + * @static + * @param {google.analytics.data.v1alpha.IDateRange=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.DateRange} DateRange instance + */ + DateRange.create = function create(properties) { + return new DateRange(properties); + }; + + /** + * Encodes the specified DateRange message. Does not implicitly {@link google.analytics.data.v1alpha.DateRange.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.DateRange + * @static + * @param {google.analytics.data.v1alpha.IDateRange} message DateRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateRange.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); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified DateRange message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.DateRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.DateRange + * @static + * @param {google.analytics.data.v1alpha.IDateRange} message DateRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateRange message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.DateRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.DateRange} DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.DateRange(); + 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; + } + case 3: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DateRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.DateRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.DateRange} DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateRange message. + * @function verify + * @memberof google.analytics.data.v1alpha.DateRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateRange.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"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DateRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.DateRange + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.DateRange} DateRange + */ + DateRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.DateRange) + return object; + var message = new $root.google.analytics.data.v1alpha.DateRange(); + if (object.startDate != null) + message.startDate = String(object.startDate); + if (object.endDate != null) + message.endDate = String(object.endDate); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DateRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.DateRange + * @static + * @param {google.analytics.data.v1alpha.DateRange} message DateRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startDate = ""; + object.endDate = ""; + object.name = ""; + } + if (message.startDate != null && message.hasOwnProperty("startDate")) + object.startDate = message.startDate; + if (message.endDate != null && message.hasOwnProperty("endDate")) + object.endDate = message.endDate; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DateRange to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.DateRange + * @instance + * @returns {Object.} JSON object + */ + DateRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DateRange + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.DateRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DateRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.DateRange"; + }; + + return DateRange; + })(); + + v1alpha.Dimension = (function() { + + /** + * Properties of a Dimension. + * @memberof google.analytics.data.v1alpha + * @interface IDimension + * @property {string|null} [name] Dimension name + * @property {google.analytics.data.v1alpha.IDimensionExpression|null} [dimensionExpression] Dimension dimensionExpression + */ + + /** + * Constructs a new Dimension. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a Dimension. + * @implements IDimension + * @constructor + * @param {google.analytics.data.v1alpha.IDimension=} [properties] Properties to set + */ + function Dimension(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]]; + } + + /** + * Dimension name. + * @member {string} name + * @memberof google.analytics.data.v1alpha.Dimension + * @instance + */ + Dimension.prototype.name = ""; + + /** + * Dimension dimensionExpression. + * @member {google.analytics.data.v1alpha.IDimensionExpression|null|undefined} dimensionExpression + * @memberof google.analytics.data.v1alpha.Dimension + * @instance + */ + Dimension.prototype.dimensionExpression = null; + + /** + * Creates a new Dimension instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.Dimension + * @static + * @param {google.analytics.data.v1alpha.IDimension=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.Dimension} Dimension instance + */ + Dimension.create = function create(properties) { + return new Dimension(properties); + }; + + /** + * Encodes the specified Dimension message. Does not implicitly {@link google.analytics.data.v1alpha.Dimension.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.Dimension + * @static + * @param {google.analytics.data.v1alpha.IDimension} message Dimension message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dimension.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.dimensionExpression != null && Object.hasOwnProperty.call(message, "dimensionExpression")) + $root.google.analytics.data.v1alpha.DimensionExpression.encode(message.dimensionExpression, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Dimension message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.Dimension.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.Dimension + * @static + * @param {google.analytics.data.v1alpha.IDimension} message Dimension message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dimension.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dimension message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.Dimension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.Dimension} Dimension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dimension.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.Dimension(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.dimensionExpression = $root.google.analytics.data.v1alpha.DimensionExpression.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dimension message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.Dimension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.Dimension} Dimension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dimension.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dimension message. + * @function verify + * @memberof google.analytics.data.v1alpha.Dimension + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dimension.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.dimensionExpression != null && message.hasOwnProperty("dimensionExpression")) { + var error = $root.google.analytics.data.v1alpha.DimensionExpression.verify(message.dimensionExpression); + if (error) + return "dimensionExpression." + error; + } + return null; + }; + + /** + * Creates a Dimension message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.Dimension + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.Dimension} Dimension + */ + Dimension.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.Dimension) + return object; + var message = new $root.google.analytics.data.v1alpha.Dimension(); + if (object.name != null) + message.name = String(object.name); + if (object.dimensionExpression != null) { + if (typeof object.dimensionExpression !== "object") + throw TypeError(".google.analytics.data.v1alpha.Dimension.dimensionExpression: object expected"); + message.dimensionExpression = $root.google.analytics.data.v1alpha.DimensionExpression.fromObject(object.dimensionExpression); + } + return message; + }; + + /** + * Creates a plain object from a Dimension message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.Dimension + * @static + * @param {google.analytics.data.v1alpha.Dimension} message Dimension + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dimension.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.dimensionExpression = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dimensionExpression != null && message.hasOwnProperty("dimensionExpression")) + object.dimensionExpression = $root.google.analytics.data.v1alpha.DimensionExpression.toObject(message.dimensionExpression, options); + return object; + }; + + /** + * Converts this Dimension to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.Dimension + * @instance + * @returns {Object.} JSON object + */ + Dimension.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dimension + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.Dimension + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dimension.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.Dimension"; + }; + + return Dimension; + })(); + + v1alpha.DimensionExpression = (function() { + + /** + * Properties of a DimensionExpression. + * @memberof google.analytics.data.v1alpha + * @interface IDimensionExpression + * @property {google.analytics.data.v1alpha.DimensionExpression.ICaseExpression|null} [lowerCase] DimensionExpression lowerCase + * @property {google.analytics.data.v1alpha.DimensionExpression.ICaseExpression|null} [upperCase] DimensionExpression upperCase + * @property {google.analytics.data.v1alpha.DimensionExpression.IConcatenateExpression|null} [concatenate] DimensionExpression concatenate + */ + + /** + * Constructs a new DimensionExpression. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a DimensionExpression. + * @implements IDimensionExpression + * @constructor + * @param {google.analytics.data.v1alpha.IDimensionExpression=} [properties] Properties to set + */ + function DimensionExpression(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]]; + } + + /** + * DimensionExpression lowerCase. + * @member {google.analytics.data.v1alpha.DimensionExpression.ICaseExpression|null|undefined} lowerCase + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @instance + */ + DimensionExpression.prototype.lowerCase = null; + + /** + * DimensionExpression upperCase. + * @member {google.analytics.data.v1alpha.DimensionExpression.ICaseExpression|null|undefined} upperCase + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @instance + */ + DimensionExpression.prototype.upperCase = null; + + /** + * DimensionExpression concatenate. + * @member {google.analytics.data.v1alpha.DimensionExpression.IConcatenateExpression|null|undefined} concatenate + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @instance + */ + DimensionExpression.prototype.concatenate = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DimensionExpression oneExpression. + * @member {"lowerCase"|"upperCase"|"concatenate"|undefined} oneExpression + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @instance + */ + Object.defineProperty(DimensionExpression.prototype, "oneExpression", { + get: $util.oneOfGetter($oneOfFields = ["lowerCase", "upperCase", "concatenate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DimensionExpression instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @static + * @param {google.analytics.data.v1alpha.IDimensionExpression=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.DimensionExpression} DimensionExpression instance + */ + DimensionExpression.create = function create(properties) { + return new DimensionExpression(properties); + }; + + /** + * Encodes the specified DimensionExpression message. Does not implicitly {@link google.analytics.data.v1alpha.DimensionExpression.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @static + * @param {google.analytics.data.v1alpha.IDimensionExpression} message DimensionExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionExpression.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lowerCase != null && Object.hasOwnProperty.call(message, "lowerCase")) + $root.google.analytics.data.v1alpha.DimensionExpression.CaseExpression.encode(message.lowerCase, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.upperCase != null && Object.hasOwnProperty.call(message, "upperCase")) + $root.google.analytics.data.v1alpha.DimensionExpression.CaseExpression.encode(message.upperCase, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.concatenate != null && Object.hasOwnProperty.call(message, "concatenate")) + $root.google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression.encode(message.concatenate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DimensionExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.DimensionExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @static + * @param {google.analytics.data.v1alpha.IDimensionExpression} message DimensionExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DimensionExpression message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.DimensionExpression} DimensionExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionExpression.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.DimensionExpression(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.lowerCase = $root.google.analytics.data.v1alpha.DimensionExpression.CaseExpression.decode(reader, reader.uint32()); + break; + } + case 5: { + message.upperCase = $root.google.analytics.data.v1alpha.DimensionExpression.CaseExpression.decode(reader, reader.uint32()); + break; + } + case 6: { + message.concatenate = $root.google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DimensionExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.DimensionExpression} DimensionExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DimensionExpression message. + * @function verify + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DimensionExpression.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.lowerCase != null && message.hasOwnProperty("lowerCase")) { + properties.oneExpression = 1; + { + var error = $root.google.analytics.data.v1alpha.DimensionExpression.CaseExpression.verify(message.lowerCase); + if (error) + return "lowerCase." + error; + } + } + if (message.upperCase != null && message.hasOwnProperty("upperCase")) { + if (properties.oneExpression === 1) + return "oneExpression: multiple values"; + properties.oneExpression = 1; + { + var error = $root.google.analytics.data.v1alpha.DimensionExpression.CaseExpression.verify(message.upperCase); + if (error) + return "upperCase." + error; + } + } + if (message.concatenate != null && message.hasOwnProperty("concatenate")) { + if (properties.oneExpression === 1) + return "oneExpression: multiple values"; + properties.oneExpression = 1; + { + var error = $root.google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression.verify(message.concatenate); + if (error) + return "concatenate." + error; + } + } + return null; + }; + + /** + * Creates a DimensionExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.DimensionExpression} DimensionExpression + */ + DimensionExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.DimensionExpression) + return object; + var message = new $root.google.analytics.data.v1alpha.DimensionExpression(); + if (object.lowerCase != null) { + if (typeof object.lowerCase !== "object") + throw TypeError(".google.analytics.data.v1alpha.DimensionExpression.lowerCase: object expected"); + message.lowerCase = $root.google.analytics.data.v1alpha.DimensionExpression.CaseExpression.fromObject(object.lowerCase); + } + if (object.upperCase != null) { + if (typeof object.upperCase !== "object") + throw TypeError(".google.analytics.data.v1alpha.DimensionExpression.upperCase: object expected"); + message.upperCase = $root.google.analytics.data.v1alpha.DimensionExpression.CaseExpression.fromObject(object.upperCase); + } + if (object.concatenate != null) { + if (typeof object.concatenate !== "object") + throw TypeError(".google.analytics.data.v1alpha.DimensionExpression.concatenate: object expected"); + message.concatenate = $root.google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression.fromObject(object.concatenate); + } + return message; + }; + + /** + * Creates a plain object from a DimensionExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @static + * @param {google.analytics.data.v1alpha.DimensionExpression} message DimensionExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DimensionExpression.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.lowerCase != null && message.hasOwnProperty("lowerCase")) { + object.lowerCase = $root.google.analytics.data.v1alpha.DimensionExpression.CaseExpression.toObject(message.lowerCase, options); + if (options.oneofs) + object.oneExpression = "lowerCase"; + } + if (message.upperCase != null && message.hasOwnProperty("upperCase")) { + object.upperCase = $root.google.analytics.data.v1alpha.DimensionExpression.CaseExpression.toObject(message.upperCase, options); + if (options.oneofs) + object.oneExpression = "upperCase"; + } + if (message.concatenate != null && message.hasOwnProperty("concatenate")) { + object.concatenate = $root.google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression.toObject(message.concatenate, options); + if (options.oneofs) + object.oneExpression = "concatenate"; + } + return object; + }; + + /** + * Converts this DimensionExpression to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @instance + * @returns {Object.} JSON object + */ + DimensionExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DimensionExpression + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DimensionExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.DimensionExpression"; + }; + + DimensionExpression.CaseExpression = (function() { + + /** + * Properties of a CaseExpression. + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @interface ICaseExpression + * @property {string|null} [dimensionName] CaseExpression dimensionName + */ + + /** + * Constructs a new CaseExpression. + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @classdesc Represents a CaseExpression. + * @implements ICaseExpression + * @constructor + * @param {google.analytics.data.v1alpha.DimensionExpression.ICaseExpression=} [properties] Properties to set + */ + function CaseExpression(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]]; + } + + /** + * CaseExpression dimensionName. + * @member {string} dimensionName + * @memberof google.analytics.data.v1alpha.DimensionExpression.CaseExpression + * @instance + */ + CaseExpression.prototype.dimensionName = ""; + + /** + * Creates a new CaseExpression instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.DimensionExpression.CaseExpression + * @static + * @param {google.analytics.data.v1alpha.DimensionExpression.ICaseExpression=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.DimensionExpression.CaseExpression} CaseExpression instance + */ + CaseExpression.create = function create(properties) { + return new CaseExpression(properties); + }; + + /** + * Encodes the specified CaseExpression message. Does not implicitly {@link google.analytics.data.v1alpha.DimensionExpression.CaseExpression.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.DimensionExpression.CaseExpression + * @static + * @param {google.analytics.data.v1alpha.DimensionExpression.ICaseExpression} message CaseExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseExpression.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 CaseExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.DimensionExpression.CaseExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.DimensionExpression.CaseExpression + * @static + * @param {google.analytics.data.v1alpha.DimensionExpression.ICaseExpression} message CaseExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaseExpression message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.DimensionExpression.CaseExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.DimensionExpression.CaseExpression} CaseExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseExpression.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.DimensionExpression.CaseExpression(); + 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 a CaseExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.DimensionExpression.CaseExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.DimensionExpression.CaseExpression} CaseExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaseExpression message. + * @function verify + * @memberof google.analytics.data.v1alpha.DimensionExpression.CaseExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaseExpression.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 a CaseExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.DimensionExpression.CaseExpression + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.DimensionExpression.CaseExpression} CaseExpression + */ + CaseExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.DimensionExpression.CaseExpression) + return object; + var message = new $root.google.analytics.data.v1alpha.DimensionExpression.CaseExpression(); + if (object.dimensionName != null) + message.dimensionName = String(object.dimensionName); + return message; + }; + + /** + * Creates a plain object from a CaseExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.DimensionExpression.CaseExpression + * @static + * @param {google.analytics.data.v1alpha.DimensionExpression.CaseExpression} message CaseExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaseExpression.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 CaseExpression to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.DimensionExpression.CaseExpression + * @instance + * @returns {Object.} JSON object + */ + CaseExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaseExpression + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.DimensionExpression.CaseExpression + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaseExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.DimensionExpression.CaseExpression"; + }; + + return CaseExpression; + })(); + + DimensionExpression.ConcatenateExpression = (function() { + + /** + * Properties of a ConcatenateExpression. + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @interface IConcatenateExpression + * @property {Array.|null} [dimensionNames] ConcatenateExpression dimensionNames + * @property {string|null} [delimiter] ConcatenateExpression delimiter + */ + + /** + * Constructs a new ConcatenateExpression. + * @memberof google.analytics.data.v1alpha.DimensionExpression + * @classdesc Represents a ConcatenateExpression. + * @implements IConcatenateExpression + * @constructor + * @param {google.analytics.data.v1alpha.DimensionExpression.IConcatenateExpression=} [properties] Properties to set + */ + function ConcatenateExpression(properties) { + this.dimensionNames = []; + 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]]; + } + + /** + * ConcatenateExpression dimensionNames. + * @member {Array.} dimensionNames + * @memberof google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression + * @instance + */ + ConcatenateExpression.prototype.dimensionNames = $util.emptyArray; + + /** + * ConcatenateExpression delimiter. + * @member {string} delimiter + * @memberof google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression + * @instance + */ + ConcatenateExpression.prototype.delimiter = ""; + + /** + * Creates a new ConcatenateExpression instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression + * @static + * @param {google.analytics.data.v1alpha.DimensionExpression.IConcatenateExpression=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression} ConcatenateExpression instance + */ + ConcatenateExpression.create = function create(properties) { + return new ConcatenateExpression(properties); + }; + + /** + * Encodes the specified ConcatenateExpression message. Does not implicitly {@link google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression + * @static + * @param {google.analytics.data.v1alpha.DimensionExpression.IConcatenateExpression} message ConcatenateExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConcatenateExpression.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dimensionNames != null && message.dimensionNames.length) + for (var i = 0; i < message.dimensionNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dimensionNames[i]); + if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.delimiter); + return writer; + }; + + /** + * Encodes the specified ConcatenateExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression + * @static + * @param {google.analytics.data.v1alpha.DimensionExpression.IConcatenateExpression} message ConcatenateExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConcatenateExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConcatenateExpression message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression} ConcatenateExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConcatenateExpression.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dimensionNames && message.dimensionNames.length)) + message.dimensionNames = []; + message.dimensionNames.push(reader.string()); + break; + } + case 2: { + message.delimiter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConcatenateExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression} ConcatenateExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConcatenateExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConcatenateExpression message. + * @function verify + * @memberof google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConcatenateExpression.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dimensionNames != null && message.hasOwnProperty("dimensionNames")) { + if (!Array.isArray(message.dimensionNames)) + return "dimensionNames: array expected"; + for (var i = 0; i < message.dimensionNames.length; ++i) + if (!$util.isString(message.dimensionNames[i])) + return "dimensionNames: string[] expected"; + } + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + if (!$util.isString(message.delimiter)) + return "delimiter: string expected"; + return null; + }; + + /** + * Creates a ConcatenateExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression} ConcatenateExpression + */ + ConcatenateExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression) + return object; + var message = new $root.google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression(); + if (object.dimensionNames) { + if (!Array.isArray(object.dimensionNames)) + throw TypeError(".google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression.dimensionNames: array expected"); + message.dimensionNames = []; + for (var i = 0; i < object.dimensionNames.length; ++i) + message.dimensionNames[i] = String(object.dimensionNames[i]); + } + if (object.delimiter != null) + message.delimiter = String(object.delimiter); + return message; + }; + + /** + * Creates a plain object from a ConcatenateExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression + * @static + * @param {google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression} message ConcatenateExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConcatenateExpression.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dimensionNames = []; + if (options.defaults) + object.delimiter = ""; + if (message.dimensionNames && message.dimensionNames.length) { + object.dimensionNames = []; + for (var j = 0; j < message.dimensionNames.length; ++j) + object.dimensionNames[j] = message.dimensionNames[j]; + } + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + object.delimiter = message.delimiter; + return object; + }; + + /** + * Converts this ConcatenateExpression to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression + * @instance + * @returns {Object.} JSON object + */ + ConcatenateExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConcatenateExpression + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConcatenateExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.DimensionExpression.ConcatenateExpression"; + }; + + return ConcatenateExpression; + })(); + + return DimensionExpression; + })(); + + v1alpha.FilterExpression = (function() { + + /** + * Properties of a FilterExpression. + * @memberof google.analytics.data.v1alpha + * @interface IFilterExpression + * @property {google.analytics.data.v1alpha.IFilterExpressionList|null} [andGroup] FilterExpression andGroup + * @property {google.analytics.data.v1alpha.IFilterExpressionList|null} [orGroup] FilterExpression orGroup + * @property {google.analytics.data.v1alpha.IFilterExpression|null} [notExpression] FilterExpression notExpression + * @property {google.analytics.data.v1alpha.IFilter|null} [filter] FilterExpression filter + */ + + /** + * Constructs a new FilterExpression. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a FilterExpression. + * @implements IFilterExpression + * @constructor + * @param {google.analytics.data.v1alpha.IFilterExpression=} [properties] Properties to set + */ + function FilterExpression(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]]; + } + + /** + * FilterExpression andGroup. + * @member {google.analytics.data.v1alpha.IFilterExpressionList|null|undefined} andGroup + * @memberof google.analytics.data.v1alpha.FilterExpression + * @instance + */ + FilterExpression.prototype.andGroup = null; + + /** + * FilterExpression orGroup. + * @member {google.analytics.data.v1alpha.IFilterExpressionList|null|undefined} orGroup + * @memberof google.analytics.data.v1alpha.FilterExpression + * @instance + */ + FilterExpression.prototype.orGroup = null; + + /** + * FilterExpression notExpression. + * @member {google.analytics.data.v1alpha.IFilterExpression|null|undefined} notExpression + * @memberof google.analytics.data.v1alpha.FilterExpression + * @instance + */ + FilterExpression.prototype.notExpression = null; + + /** + * FilterExpression filter. + * @member {google.analytics.data.v1alpha.IFilter|null|undefined} filter + * @memberof google.analytics.data.v1alpha.FilterExpression + * @instance + */ + FilterExpression.prototype.filter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FilterExpression expr. + * @member {"andGroup"|"orGroup"|"notExpression"|"filter"|undefined} expr + * @memberof google.analytics.data.v1alpha.FilterExpression + * @instance + */ + Object.defineProperty(FilterExpression.prototype, "expr", { + get: $util.oneOfGetter($oneOfFields = ["andGroup", "orGroup", "notExpression", "filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FilterExpression instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.FilterExpression + * @static + * @param {google.analytics.data.v1alpha.IFilterExpression=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FilterExpression} FilterExpression instance + */ + FilterExpression.create = function create(properties) { + return new FilterExpression(properties); + }; + + /** + * Encodes the specified FilterExpression message. Does not implicitly {@link google.analytics.data.v1alpha.FilterExpression.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.FilterExpression + * @static + * @param {google.analytics.data.v1alpha.IFilterExpression} message FilterExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterExpression.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.andGroup != null && Object.hasOwnProperty.call(message, "andGroup")) + $root.google.analytics.data.v1alpha.FilterExpressionList.encode(message.andGroup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.orGroup != null && Object.hasOwnProperty.call(message, "orGroup")) + $root.google.analytics.data.v1alpha.FilterExpressionList.encode(message.orGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.notExpression != null && Object.hasOwnProperty.call(message, "notExpression")) + $root.google.analytics.data.v1alpha.FilterExpression.encode(message.notExpression, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + $root.google.analytics.data.v1alpha.Filter.encode(message.filter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FilterExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FilterExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.FilterExpression + * @static + * @param {google.analytics.data.v1alpha.IFilterExpression} message FilterExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FilterExpression message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.FilterExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.FilterExpression} FilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterExpression.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FilterExpression(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.andGroup = $root.google.analytics.data.v1alpha.FilterExpressionList.decode(reader, reader.uint32()); + break; + } + case 2: { + message.orGroup = $root.google.analytics.data.v1alpha.FilterExpressionList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.notExpression = $root.google.analytics.data.v1alpha.FilterExpression.decode(reader, reader.uint32()); + break; + } + case 4: { + message.filter = $root.google.analytics.data.v1alpha.Filter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FilterExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.FilterExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.FilterExpression} FilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FilterExpression message. + * @function verify + * @memberof google.analytics.data.v1alpha.FilterExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FilterExpression.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.andGroup != null && message.hasOwnProperty("andGroup")) { + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.FilterExpressionList.verify(message.andGroup); + if (error) + return "andGroup." + error; + } + } + if (message.orGroup != null && message.hasOwnProperty("orGroup")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.FilterExpressionList.verify(message.orGroup); + if (error) + return "orGroup." + error; + } + } + if (message.notExpression != null && message.hasOwnProperty("notExpression")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.FilterExpression.verify(message.notExpression); + if (error) + return "notExpression." + error; + } + } + if (message.filter != null && message.hasOwnProperty("filter")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.Filter.verify(message.filter); + if (error) + return "filter." + error; + } + } + return null; + }; + + /** + * Creates a FilterExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.FilterExpression + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.FilterExpression} FilterExpression + */ + FilterExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FilterExpression) + return object; + var message = new $root.google.analytics.data.v1alpha.FilterExpression(); + if (object.andGroup != null) { + if (typeof object.andGroup !== "object") + throw TypeError(".google.analytics.data.v1alpha.FilterExpression.andGroup: object expected"); + message.andGroup = $root.google.analytics.data.v1alpha.FilterExpressionList.fromObject(object.andGroup); + } + if (object.orGroup != null) { + if (typeof object.orGroup !== "object") + throw TypeError(".google.analytics.data.v1alpha.FilterExpression.orGroup: object expected"); + message.orGroup = $root.google.analytics.data.v1alpha.FilterExpressionList.fromObject(object.orGroup); + } + if (object.notExpression != null) { + if (typeof object.notExpression !== "object") + throw TypeError(".google.analytics.data.v1alpha.FilterExpression.notExpression: object expected"); + message.notExpression = $root.google.analytics.data.v1alpha.FilterExpression.fromObject(object.notExpression); + } + if (object.filter != null) { + if (typeof object.filter !== "object") + throw TypeError(".google.analytics.data.v1alpha.FilterExpression.filter: object expected"); + message.filter = $root.google.analytics.data.v1alpha.Filter.fromObject(object.filter); + } + return message; + }; + + /** + * Creates a plain object from a FilterExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.FilterExpression + * @static + * @param {google.analytics.data.v1alpha.FilterExpression} message FilterExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FilterExpression.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.andGroup != null && message.hasOwnProperty("andGroup")) { + object.andGroup = $root.google.analytics.data.v1alpha.FilterExpressionList.toObject(message.andGroup, options); + if (options.oneofs) + object.expr = "andGroup"; + } + if (message.orGroup != null && message.hasOwnProperty("orGroup")) { + object.orGroup = $root.google.analytics.data.v1alpha.FilterExpressionList.toObject(message.orGroup, options); + if (options.oneofs) + object.expr = "orGroup"; + } + if (message.notExpression != null && message.hasOwnProperty("notExpression")) { + object.notExpression = $root.google.analytics.data.v1alpha.FilterExpression.toObject(message.notExpression, options); + if (options.oneofs) + object.expr = "notExpression"; + } + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = $root.google.analytics.data.v1alpha.Filter.toObject(message.filter, options); + if (options.oneofs) + object.expr = "filter"; + } + return object; + }; + + /** + * Converts this FilterExpression to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.FilterExpression + * @instance + * @returns {Object.} JSON object + */ + FilterExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FilterExpression + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.FilterExpression + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FilterExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.FilterExpression"; + }; + + return FilterExpression; + })(); + + v1alpha.FilterExpressionList = (function() { + + /** + * Properties of a FilterExpressionList. + * @memberof google.analytics.data.v1alpha + * @interface IFilterExpressionList + * @property {Array.|null} [expressions] FilterExpressionList expressions + */ + + /** + * Constructs a new FilterExpressionList. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a FilterExpressionList. + * @implements IFilterExpressionList + * @constructor + * @param {google.analytics.data.v1alpha.IFilterExpressionList=} [properties] Properties to set + */ + function FilterExpressionList(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]]; + } + + /** + * FilterExpressionList expressions. + * @member {Array.} expressions + * @memberof google.analytics.data.v1alpha.FilterExpressionList + * @instance + */ + FilterExpressionList.prototype.expressions = $util.emptyArray; + + /** + * Creates a new FilterExpressionList instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.FilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.IFilterExpressionList=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FilterExpressionList} FilterExpressionList instance + */ + FilterExpressionList.create = function create(properties) { + return new FilterExpressionList(properties); + }; + + /** + * Encodes the specified FilterExpressionList message. Does not implicitly {@link google.analytics.data.v1alpha.FilterExpressionList.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.FilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.IFilterExpressionList} message FilterExpressionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterExpressionList.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.data.v1alpha.FilterExpression.encode(message.expressions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FilterExpressionList message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FilterExpressionList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.FilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.IFilterExpressionList} message FilterExpressionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterExpressionList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FilterExpressionList message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.FilterExpressionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.FilterExpressionList} FilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterExpressionList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FilterExpressionList(); + 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.data.v1alpha.FilterExpression.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FilterExpressionList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.FilterExpressionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.FilterExpressionList} FilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterExpressionList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FilterExpressionList message. + * @function verify + * @memberof google.analytics.data.v1alpha.FilterExpressionList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FilterExpressionList.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.data.v1alpha.FilterExpression.verify(message.expressions[i]); + if (error) + return "expressions." + error; + } + } + return null; + }; + + /** + * Creates a FilterExpressionList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.FilterExpressionList + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.FilterExpressionList} FilterExpressionList + */ + FilterExpressionList.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FilterExpressionList) + return object; + var message = new $root.google.analytics.data.v1alpha.FilterExpressionList(); + if (object.expressions) { + if (!Array.isArray(object.expressions)) + throw TypeError(".google.analytics.data.v1alpha.FilterExpressionList.expressions: array expected"); + message.expressions = []; + for (var i = 0; i < object.expressions.length; ++i) { + if (typeof object.expressions[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.FilterExpressionList.expressions: object expected"); + message.expressions[i] = $root.google.analytics.data.v1alpha.FilterExpression.fromObject(object.expressions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FilterExpressionList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.FilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.FilterExpressionList} message FilterExpressionList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FilterExpressionList.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.data.v1alpha.FilterExpression.toObject(message.expressions[j], options); + } + return object; + }; + + /** + * Converts this FilterExpressionList to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.FilterExpressionList + * @instance + * @returns {Object.} JSON object + */ + FilterExpressionList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FilterExpressionList + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.FilterExpressionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FilterExpressionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.FilterExpressionList"; + }; + + return FilterExpressionList; + })(); + + v1alpha.Filter = (function() { + + /** + * Properties of a Filter. + * @memberof google.analytics.data.v1alpha + * @interface IFilter + * @property {string|null} [fieldName] Filter fieldName + * @property {google.analytics.data.v1alpha.IStringFilter|null} [stringFilter] Filter stringFilter + * @property {google.analytics.data.v1alpha.IInListFilter|null} [inListFilter] Filter inListFilter + * @property {google.analytics.data.v1alpha.INumericFilter|null} [numericFilter] Filter numericFilter + * @property {google.analytics.data.v1alpha.IBetweenFilter|null} [betweenFilter] Filter betweenFilter + */ + + /** + * Constructs a new Filter. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a Filter. + * @implements IFilter + * @constructor + * @param {google.analytics.data.v1alpha.IFilter=} [properties] Properties to set + */ + function Filter(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]]; + } + + /** + * Filter fieldName. + * @member {string} fieldName + * @memberof google.analytics.data.v1alpha.Filter + * @instance + */ + Filter.prototype.fieldName = ""; + + /** + * Filter stringFilter. + * @member {google.analytics.data.v1alpha.IStringFilter|null|undefined} stringFilter + * @memberof google.analytics.data.v1alpha.Filter + * @instance + */ + Filter.prototype.stringFilter = null; + + /** + * Filter inListFilter. + * @member {google.analytics.data.v1alpha.IInListFilter|null|undefined} inListFilter + * @memberof google.analytics.data.v1alpha.Filter + * @instance + */ + Filter.prototype.inListFilter = null; + + /** + * Filter numericFilter. + * @member {google.analytics.data.v1alpha.INumericFilter|null|undefined} numericFilter + * @memberof google.analytics.data.v1alpha.Filter + * @instance + */ + Filter.prototype.numericFilter = null; + + /** + * Filter betweenFilter. + * @member {google.analytics.data.v1alpha.IBetweenFilter|null|undefined} betweenFilter + * @memberof google.analytics.data.v1alpha.Filter + * @instance + */ + Filter.prototype.betweenFilter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Filter oneFilter. + * @member {"stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"|undefined} oneFilter + * @memberof google.analytics.data.v1alpha.Filter + * @instance + */ + Object.defineProperty(Filter.prototype, "oneFilter", { + get: $util.oneOfGetter($oneOfFields = ["stringFilter", "inListFilter", "numericFilter", "betweenFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Filter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.Filter + * @static + * @param {google.analytics.data.v1alpha.IFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.Filter} Filter instance + */ + Filter.create = function create(properties) { + return new Filter(properties); + }; + + /** + * Encodes the specified Filter message. Does not implicitly {@link google.analytics.data.v1alpha.Filter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.Filter + * @static + * @param {google.analytics.data.v1alpha.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Filter.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.data.v1alpha.StringFilter.encode(message.stringFilter, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inListFilter != null && Object.hasOwnProperty.call(message, "inListFilter")) + $root.google.analytics.data.v1alpha.InListFilter.encode(message.inListFilter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.numericFilter != null && Object.hasOwnProperty.call(message, "numericFilter")) + $root.google.analytics.data.v1alpha.NumericFilter.encode(message.numericFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.betweenFilter != null && Object.hasOwnProperty.call(message, "betweenFilter")) + $root.google.analytics.data.v1alpha.BetweenFilter.encode(message.betweenFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.Filter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.Filter + * @static + * @param {google.analytics.data.v1alpha.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Filter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Filter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Filter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.Filter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldName = reader.string(); + break; + } + case 2: { + message.stringFilter = $root.google.analytics.data.v1alpha.StringFilter.decode(reader, reader.uint32()); + break; + } + case 3: { + message.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.decode(reader, reader.uint32()); + break; + } + case 4: { + message.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Filter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Filter message. + * @function verify + * @memberof google.analytics.data.v1alpha.Filter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Filter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.stringFilter != null && message.hasOwnProperty("stringFilter")) { + properties.oneFilter = 1; + { + var error = $root.google.analytics.data.v1alpha.StringFilter.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.data.v1alpha.InListFilter.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.data.v1alpha.NumericFilter.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.data.v1alpha.BetweenFilter.verify(message.betweenFilter); + if (error) + return "betweenFilter." + error; + } + } + return null; + }; + + /** + * Creates a Filter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.Filter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.Filter} Filter + */ + Filter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.Filter) + return object; + var message = new $root.google.analytics.data.v1alpha.Filter(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + if (object.stringFilter != null) { + if (typeof object.stringFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.Filter.stringFilter: object expected"); + message.stringFilter = $root.google.analytics.data.v1alpha.StringFilter.fromObject(object.stringFilter); + } + if (object.inListFilter != null) { + if (typeof object.inListFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.Filter.inListFilter: object expected"); + message.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.fromObject(object.inListFilter); + } + if (object.numericFilter != null) { + if (typeof object.numericFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.Filter.numericFilter: object expected"); + message.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.fromObject(object.numericFilter); + } + if (object.betweenFilter != null) { + if (typeof object.betweenFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.Filter.betweenFilter: object expected"); + message.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.fromObject(object.betweenFilter); + } + return message; + }; + + /** + * Creates a plain object from a Filter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.Filter + * @static + * @param {google.analytics.data.v1alpha.Filter} message Filter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Filter.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.data.v1alpha.StringFilter.toObject(message.stringFilter, options); + if (options.oneofs) + object.oneFilter = "stringFilter"; + } + if (message.inListFilter != null && message.hasOwnProperty("inListFilter")) { + object.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.toObject(message.inListFilter, options); + if (options.oneofs) + object.oneFilter = "inListFilter"; + } + if (message.numericFilter != null && message.hasOwnProperty("numericFilter")) { + object.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.toObject(message.numericFilter, options); + if (options.oneofs) + object.oneFilter = "numericFilter"; + } + if (message.betweenFilter != null && message.hasOwnProperty("betweenFilter")) { + object.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.toObject(message.betweenFilter, options); + if (options.oneofs) + object.oneFilter = "betweenFilter"; + } + return object; + }; + + /** + * Converts this Filter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.Filter + * @instance + * @returns {Object.} JSON object + */ + Filter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Filter + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.Filter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Filter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.Filter"; + }; + + return Filter; + })(); + + v1alpha.StringFilter = (function() { + + /** + * Properties of a StringFilter. + * @memberof google.analytics.data.v1alpha + * @interface IStringFilter + * @property {google.analytics.data.v1alpha.StringFilter.MatchType|null} [matchType] StringFilter matchType + * @property {string|null} [value] StringFilter value + * @property {boolean|null} [caseSensitive] StringFilter caseSensitive + */ + + /** + * Constructs a new StringFilter. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a StringFilter. + * @implements IStringFilter + * @constructor + * @param {google.analytics.data.v1alpha.IStringFilter=} [properties] Properties to set + */ + function StringFilter(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]]; + } + + /** + * StringFilter matchType. + * @member {google.analytics.data.v1alpha.StringFilter.MatchType} matchType + * @memberof google.analytics.data.v1alpha.StringFilter + * @instance + */ + StringFilter.prototype.matchType = 0; + + /** + * StringFilter value. + * @member {string} value + * @memberof google.analytics.data.v1alpha.StringFilter + * @instance + */ + StringFilter.prototype.value = ""; + + /** + * StringFilter caseSensitive. + * @member {boolean} caseSensitive + * @memberof google.analytics.data.v1alpha.StringFilter + * @instance + */ + StringFilter.prototype.caseSensitive = false; + + /** + * Creates a new StringFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.StringFilter + * @static + * @param {google.analytics.data.v1alpha.IStringFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.StringFilter} StringFilter instance + */ + StringFilter.create = function create(properties) { + return new StringFilter(properties); + }; + + /** + * Encodes the specified StringFilter message. Does not implicitly {@link google.analytics.data.v1alpha.StringFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.StringFilter + * @static + * @param {google.analytics.data.v1alpha.IStringFilter} message StringFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringFilter.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; + }; + + /** + * Encodes the specified StringFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.StringFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.StringFilter + * @static + * @param {google.analytics.data.v1alpha.IStringFilter} message StringFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.StringFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.StringFilter} StringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.StringFilter(); + 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; + }; + + /** + * Decodes a StringFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.StringFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.StringFilter} StringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringFilter message. + * @function verify + * @memberof google.analytics.data.v1alpha.StringFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringFilter.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; + }; + + /** + * Creates a StringFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.StringFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.StringFilter} StringFilter + */ + StringFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.StringFilter) + return object; + var message = new $root.google.analytics.data.v1alpha.StringFilter(); + 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; + }; + + /** + * Creates a plain object from a StringFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.StringFilter + * @static + * @param {google.analytics.data.v1alpha.StringFilter} message StringFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringFilter.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.data.v1alpha.StringFilter.MatchType[message.matchType] === undefined ? message.matchType : $root.google.analytics.data.v1alpha.StringFilter.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; + }; + + /** + * Converts this StringFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.StringFilter + * @instance + * @returns {Object.} JSON object + */ + StringFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.StringFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.StringFilter"; + }; + + /** + * MatchType enum. + * @name google.analytics.data.v1alpha.StringFilter.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 + */ + StringFilter.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; + })(); + + return StringFilter; + })(); + + v1alpha.InListFilter = (function() { + + /** + * Properties of an InListFilter. + * @memberof google.analytics.data.v1alpha + * @interface IInListFilter + * @property {Array.|null} [values] InListFilter values + * @property {boolean|null} [caseSensitive] InListFilter caseSensitive + */ + + /** + * Constructs a new InListFilter. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents an InListFilter. + * @implements IInListFilter + * @constructor + * @param {google.analytics.data.v1alpha.IInListFilter=} [properties] Properties to set + */ + function InListFilter(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]]; + } + + /** + * InListFilter values. + * @member {Array.} values + * @memberof google.analytics.data.v1alpha.InListFilter + * @instance + */ + InListFilter.prototype.values = $util.emptyArray; + + /** + * InListFilter caseSensitive. + * @member {boolean} caseSensitive + * @memberof google.analytics.data.v1alpha.InListFilter + * @instance + */ + InListFilter.prototype.caseSensitive = false; + + /** + * Creates a new InListFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.InListFilter + * @static + * @param {google.analytics.data.v1alpha.IInListFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.InListFilter} InListFilter instance + */ + InListFilter.create = function create(properties) { + return new InListFilter(properties); + }; + + /** + * Encodes the specified InListFilter message. Does not implicitly {@link google.analytics.data.v1alpha.InListFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.InListFilter + * @static + * @param {google.analytics.data.v1alpha.IInListFilter} message InListFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InListFilter.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; + }; + + /** + * Encodes the specified InListFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.InListFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.InListFilter + * @static + * @param {google.analytics.data.v1alpha.IInListFilter} message InListFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InListFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InListFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.InListFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.InListFilter} InListFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InListFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.InListFilter(); + 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; + }; + + /** + * Decodes an InListFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.InListFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.InListFilter} InListFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InListFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InListFilter message. + * @function verify + * @memberof google.analytics.data.v1alpha.InListFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InListFilter.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; + }; + + /** + * Creates an InListFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.InListFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.InListFilter} InListFilter + */ + InListFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.InListFilter) + return object; + var message = new $root.google.analytics.data.v1alpha.InListFilter(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.analytics.data.v1alpha.InListFilter.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; + }; + + /** + * Creates a plain object from an InListFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.InListFilter + * @static + * @param {google.analytics.data.v1alpha.InListFilter} message InListFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InListFilter.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; + }; + + /** + * Converts this InListFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.InListFilter + * @instance + * @returns {Object.} JSON object + */ + InListFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InListFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.InListFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InListFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.InListFilter"; + }; + + return InListFilter; + })(); + + v1alpha.NumericFilter = (function() { + + /** + * Properties of a NumericFilter. + * @memberof google.analytics.data.v1alpha + * @interface INumericFilter + * @property {google.analytics.data.v1alpha.NumericFilter.Operation|null} [operation] NumericFilter operation + * @property {google.analytics.data.v1alpha.INumericValue|null} [value] NumericFilter value + */ + + /** + * Constructs a new NumericFilter. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a NumericFilter. + * @implements INumericFilter + * @constructor + * @param {google.analytics.data.v1alpha.INumericFilter=} [properties] Properties to set + */ + function NumericFilter(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]]; + } + + /** + * NumericFilter operation. + * @member {google.analytics.data.v1alpha.NumericFilter.Operation} operation + * @memberof google.analytics.data.v1alpha.NumericFilter + * @instance + */ + NumericFilter.prototype.operation = 0; + + /** + * NumericFilter value. + * @member {google.analytics.data.v1alpha.INumericValue|null|undefined} value + * @memberof google.analytics.data.v1alpha.NumericFilter + * @instance + */ + NumericFilter.prototype.value = null; + + /** + * Creates a new NumericFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.NumericFilter + * @static + * @param {google.analytics.data.v1alpha.INumericFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.NumericFilter} NumericFilter instance + */ + NumericFilter.create = function create(properties) { + return new NumericFilter(properties); + }; + + /** + * Encodes the specified NumericFilter message. Does not implicitly {@link google.analytics.data.v1alpha.NumericFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.NumericFilter + * @static + * @param {google.analytics.data.v1alpha.INumericFilter} message NumericFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumericFilter.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.data.v1alpha.NumericValue.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NumericFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.NumericFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.NumericFilter + * @static + * @param {google.analytics.data.v1alpha.INumericFilter} message NumericFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumericFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NumericFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.NumericFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.NumericFilter} NumericFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumericFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.NumericFilter(); + 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.data.v1alpha.NumericValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NumericFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.NumericFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.NumericFilter} NumericFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumericFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NumericFilter message. + * @function verify + * @memberof google.analytics.data.v1alpha.NumericFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NumericFilter.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.data.v1alpha.NumericValue.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a NumericFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.NumericFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.NumericFilter} NumericFilter + */ + NumericFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.NumericFilter) + return object; + var message = new $root.google.analytics.data.v1alpha.NumericFilter(); + 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.data.v1alpha.NumericFilter.value: object expected"); + message.value = $root.google.analytics.data.v1alpha.NumericValue.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a NumericFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.NumericFilter + * @static + * @param {google.analytics.data.v1alpha.NumericFilter} message NumericFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NumericFilter.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.data.v1alpha.NumericFilter.Operation[message.operation] === undefined ? message.operation : $root.google.analytics.data.v1alpha.NumericFilter.Operation[message.operation] : message.operation; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.analytics.data.v1alpha.NumericValue.toObject(message.value, options); + return object; + }; + + /** + * Converts this NumericFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.NumericFilter + * @instance + * @returns {Object.} JSON object + */ + NumericFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NumericFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.NumericFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NumericFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.NumericFilter"; + }; + + /** + * Operation enum. + * @name google.analytics.data.v1alpha.NumericFilter.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 + */ + NumericFilter.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 NumericFilter; + })(); + + v1alpha.BetweenFilter = (function() { + + /** + * Properties of a BetweenFilter. + * @memberof google.analytics.data.v1alpha + * @interface IBetweenFilter + * @property {google.analytics.data.v1alpha.INumericValue|null} [fromValue] BetweenFilter fromValue + * @property {google.analytics.data.v1alpha.INumericValue|null} [toValue] BetweenFilter toValue + */ + + /** + * Constructs a new BetweenFilter. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a BetweenFilter. + * @implements IBetweenFilter + * @constructor + * @param {google.analytics.data.v1alpha.IBetweenFilter=} [properties] Properties to set + */ + function BetweenFilter(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]]; + } + + /** + * BetweenFilter fromValue. + * @member {google.analytics.data.v1alpha.INumericValue|null|undefined} fromValue + * @memberof google.analytics.data.v1alpha.BetweenFilter + * @instance + */ + BetweenFilter.prototype.fromValue = null; + + /** + * BetweenFilter toValue. + * @member {google.analytics.data.v1alpha.INumericValue|null|undefined} toValue + * @memberof google.analytics.data.v1alpha.BetweenFilter + * @instance + */ + BetweenFilter.prototype.toValue = null; + + /** + * Creates a new BetweenFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.BetweenFilter + * @static + * @param {google.analytics.data.v1alpha.IBetweenFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.BetweenFilter} BetweenFilter instance + */ + BetweenFilter.create = function create(properties) { + return new BetweenFilter(properties); + }; + + /** + * Encodes the specified BetweenFilter message. Does not implicitly {@link google.analytics.data.v1alpha.BetweenFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.BetweenFilter + * @static + * @param {google.analytics.data.v1alpha.IBetweenFilter} message BetweenFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BetweenFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fromValue != null && Object.hasOwnProperty.call(message, "fromValue")) + $root.google.analytics.data.v1alpha.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.data.v1alpha.NumericValue.encode(message.toValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BetweenFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.BetweenFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.BetweenFilter + * @static + * @param {google.analytics.data.v1alpha.IBetweenFilter} message BetweenFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BetweenFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BetweenFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.BetweenFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.BetweenFilter} BetweenFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BetweenFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.BetweenFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fromValue = $root.google.analytics.data.v1alpha.NumericValue.decode(reader, reader.uint32()); + break; + } + case 2: { + message.toValue = $root.google.analytics.data.v1alpha.NumericValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BetweenFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.BetweenFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.BetweenFilter} BetweenFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BetweenFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BetweenFilter message. + * @function verify + * @memberof google.analytics.data.v1alpha.BetweenFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BetweenFilter.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.data.v1alpha.NumericValue.verify(message.fromValue); + if (error) + return "fromValue." + error; + } + if (message.toValue != null && message.hasOwnProperty("toValue")) { + var error = $root.google.analytics.data.v1alpha.NumericValue.verify(message.toValue); + if (error) + return "toValue." + error; + } + return null; + }; + + /** + * Creates a BetweenFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.BetweenFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.BetweenFilter} BetweenFilter + */ + BetweenFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.BetweenFilter) + return object; + var message = new $root.google.analytics.data.v1alpha.BetweenFilter(); + if (object.fromValue != null) { + if (typeof object.fromValue !== "object") + throw TypeError(".google.analytics.data.v1alpha.BetweenFilter.fromValue: object expected"); + message.fromValue = $root.google.analytics.data.v1alpha.NumericValue.fromObject(object.fromValue); + } + if (object.toValue != null) { + if (typeof object.toValue !== "object") + throw TypeError(".google.analytics.data.v1alpha.BetweenFilter.toValue: object expected"); + message.toValue = $root.google.analytics.data.v1alpha.NumericValue.fromObject(object.toValue); + } + return message; + }; + + /** + * Creates a plain object from a BetweenFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.BetweenFilter + * @static + * @param {google.analytics.data.v1alpha.BetweenFilter} message BetweenFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BetweenFilter.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.data.v1alpha.NumericValue.toObject(message.fromValue, options); + if (message.toValue != null && message.hasOwnProperty("toValue")) + object.toValue = $root.google.analytics.data.v1alpha.NumericValue.toObject(message.toValue, options); + return object; + }; + + /** + * Converts this BetweenFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.BetweenFilter + * @instance + * @returns {Object.} JSON object + */ + BetweenFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BetweenFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.BetweenFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BetweenFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.BetweenFilter"; + }; + + return BetweenFilter; + })(); + + v1alpha.NumericValue = (function() { + + /** + * Properties of a NumericValue. + * @memberof google.analytics.data.v1alpha + * @interface INumericValue + * @property {number|Long|null} [int64Value] NumericValue int64Value + * @property {number|null} [doubleValue] NumericValue doubleValue + */ + + /** + * Constructs a new NumericValue. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a NumericValue. + * @implements INumericValue + * @constructor + * @param {google.analytics.data.v1alpha.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.data.v1alpha.NumericValue + * @instance + */ + NumericValue.prototype.int64Value = null; + + /** + * NumericValue doubleValue. + * @member {number|null|undefined} doubleValue + * @memberof google.analytics.data.v1alpha.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.data.v1alpha.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.data.v1alpha.NumericValue + * @static + * @param {google.analytics.data.v1alpha.INumericValue=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.NumericValue} NumericValue instance + */ + NumericValue.create = function create(properties) { + return new NumericValue(properties); + }; + + /** + * Encodes the specified NumericValue message. Does not implicitly {@link google.analytics.data.v1alpha.NumericValue.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.NumericValue + * @static + * @param {google.analytics.data.v1alpha.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.data.v1alpha.NumericValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.NumericValue + * @static + * @param {google.analytics.data.v1alpha.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.data.v1alpha.NumericValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.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.data.v1alpha.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.data.v1alpha.NumericValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.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.data.v1alpha.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.data.v1alpha.NumericValue + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.NumericValue} NumericValue + */ + NumericValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.NumericValue) + return object; + var message = new $root.google.analytics.data.v1alpha.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.data.v1alpha.NumericValue + * @static + * @param {google.analytics.data.v1alpha.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.data.v1alpha.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.data.v1alpha.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.data.v1alpha.NumericValue"; + }; + + return NumericValue; + })(); + + v1alpha.DimensionHeader = (function() { + + /** + * Properties of a DimensionHeader. + * @memberof google.analytics.data.v1alpha + * @interface IDimensionHeader + * @property {string|null} [name] DimensionHeader name + */ + + /** + * Constructs a new DimensionHeader. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a DimensionHeader. + * @implements IDimensionHeader + * @constructor + * @param {google.analytics.data.v1alpha.IDimensionHeader=} [properties] Properties to set + */ + function DimensionHeader(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]]; + } + + /** + * DimensionHeader name. + * @member {string} name + * @memberof google.analytics.data.v1alpha.DimensionHeader + * @instance + */ + DimensionHeader.prototype.name = ""; + + /** + * Creates a new DimensionHeader instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.DimensionHeader + * @static + * @param {google.analytics.data.v1alpha.IDimensionHeader=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.DimensionHeader} DimensionHeader instance + */ + DimensionHeader.create = function create(properties) { + return new DimensionHeader(properties); + }; + + /** + * Encodes the specified DimensionHeader message. Does not implicitly {@link google.analytics.data.v1alpha.DimensionHeader.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.DimensionHeader + * @static + * @param {google.analytics.data.v1alpha.IDimensionHeader} message DimensionHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DimensionHeader message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.DimensionHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.DimensionHeader + * @static + * @param {google.analytics.data.v1alpha.IDimensionHeader} message DimensionHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DimensionHeader message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.DimensionHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.DimensionHeader} DimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.DimensionHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DimensionHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.DimensionHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.DimensionHeader} DimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DimensionHeader message. + * @function verify + * @memberof google.analytics.data.v1alpha.DimensionHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DimensionHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DimensionHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.DimensionHeader + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.DimensionHeader} DimensionHeader + */ + DimensionHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.DimensionHeader) + return object; + var message = new $root.google.analytics.data.v1alpha.DimensionHeader(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DimensionHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.DimensionHeader + * @static + * @param {google.analytics.data.v1alpha.DimensionHeader} message DimensionHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DimensionHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DimensionHeader to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.DimensionHeader + * @instance + * @returns {Object.} JSON object + */ + DimensionHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DimensionHeader + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.DimensionHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DimensionHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.DimensionHeader"; + }; + + return DimensionHeader; + })(); + + v1alpha.MetricHeader = (function() { + + /** + * Properties of a MetricHeader. + * @memberof google.analytics.data.v1alpha + * @interface IMetricHeader + * @property {string|null} [name] MetricHeader name + * @property {google.analytics.data.v1alpha.MetricType|null} [type] MetricHeader type + */ + + /** + * Constructs a new MetricHeader. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a MetricHeader. + * @implements IMetricHeader + * @constructor + * @param {google.analytics.data.v1alpha.IMetricHeader=} [properties] Properties to set + */ + function MetricHeader(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]]; + } + + /** + * MetricHeader name. + * @member {string} name + * @memberof google.analytics.data.v1alpha.MetricHeader + * @instance + */ + MetricHeader.prototype.name = ""; + + /** + * MetricHeader type. + * @member {google.analytics.data.v1alpha.MetricType} type + * @memberof google.analytics.data.v1alpha.MetricHeader + * @instance + */ + MetricHeader.prototype.type = 0; + + /** + * Creates a new MetricHeader instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.MetricHeader + * @static + * @param {google.analytics.data.v1alpha.IMetricHeader=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.MetricHeader} MetricHeader instance + */ + MetricHeader.create = function create(properties) { + return new MetricHeader(properties); + }; + + /** + * Encodes the specified MetricHeader message. Does not implicitly {@link google.analytics.data.v1alpha.MetricHeader.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.MetricHeader + * @static + * @param {google.analytics.data.v1alpha.IMetricHeader} message MetricHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + return writer; + }; + + /** + * Encodes the specified MetricHeader message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.MetricHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.MetricHeader + * @static + * @param {google.analytics.data.v1alpha.IMetricHeader} message MetricHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricHeader message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.MetricHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.MetricHeader} MetricHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.MetricHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.MetricHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.MetricHeader} MetricHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricHeader message. + * @function verify + * @memberof google.analytics.data.v1alpha.MetricHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + break; + } + return null; + }; + + /** + * Creates a MetricHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.MetricHeader + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.MetricHeader} MetricHeader + */ + MetricHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.MetricHeader) + return object; + var message = new $root.google.analytics.data.v1alpha.MetricHeader(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "METRIC_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_INTEGER": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_SECONDS": + case 4: + message.type = 4; + break; + case "TYPE_MILLISECONDS": + case 5: + message.type = 5; + break; + case "TYPE_MINUTES": + case 6: + message.type = 6; + break; + case "TYPE_HOURS": + case 7: + message.type = 7; + break; + case "TYPE_STANDARD": + case 8: + message.type = 8; + break; + case "TYPE_CURRENCY": + case 9: + message.type = 9; + break; + case "TYPE_FEET": + case 10: + message.type = 10; + break; + case "TYPE_MILES": + case 11: + message.type = 11; + break; + case "TYPE_METERS": + case 12: + message.type = 12; + break; + case "TYPE_KILOMETERS": + case 13: + message.type = 13; + break; + } + return message; + }; + + /** + * Creates a plain object from a MetricHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.MetricHeader + * @static + * @param {google.analytics.data.v1alpha.MetricHeader} message MetricHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "METRIC_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.analytics.data.v1alpha.MetricType[message.type] === undefined ? message.type : $root.google.analytics.data.v1alpha.MetricType[message.type] : message.type; + return object; + }; + + /** + * Converts this MetricHeader to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.MetricHeader + * @instance + * @returns {Object.} JSON object + */ + MetricHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricHeader + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.MetricHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.MetricHeader"; + }; + + return MetricHeader; + })(); + + v1alpha.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.analytics.data.v1alpha + * @interface IRow + * @property {Array.|null} [dimensionValues] Row dimensionValues + * @property {Array.|null} [metricValues] Row metricValues + */ + + /** + * Constructs a new Row. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.analytics.data.v1alpha.IRow=} [properties] Properties to set + */ + function Row(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]]; + } + + /** + * Row dimensionValues. + * @member {Array.} dimensionValues + * @memberof google.analytics.data.v1alpha.Row + * @instance + */ + Row.prototype.dimensionValues = $util.emptyArray; + + /** + * Row metricValues. + * @member {Array.} metricValues + * @memberof google.analytics.data.v1alpha.Row + * @instance + */ + Row.prototype.metricValues = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.Row + * @static + * @param {google.analytics.data.v1alpha.IRow=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.analytics.data.v1alpha.Row.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.Row + * @static + * @param {google.analytics.data.v1alpha.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.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.data.v1alpha.DimensionValue.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.data.v1alpha.MetricValue.encode(message.metricValues[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.Row + * @static + * @param {google.analytics.data.v1alpha.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.Row(); + 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.data.v1alpha.DimensionValue.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.metricValues && message.metricValues.length)) + message.metricValues = []; + message.metricValues.push($root.google.analytics.data.v1alpha.MetricValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.analytics.data.v1alpha.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.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.data.v1alpha.DimensionValue.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.data.v1alpha.MetricValue.verify(message.metricValues[i]); + if (error) + return "metricValues." + error; + } + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.Row + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.Row) + return object; + var message = new $root.google.analytics.data.v1alpha.Row(); + if (object.dimensionValues) { + if (!Array.isArray(object.dimensionValues)) + throw TypeError(".google.analytics.data.v1alpha.Row.dimensionValues: array expected"); + message.dimensionValues = []; + for (var i = 0; i < object.dimensionValues.length; ++i) { + if (typeof object.dimensionValues[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.Row.dimensionValues: object expected"); + message.dimensionValues[i] = $root.google.analytics.data.v1alpha.DimensionValue.fromObject(object.dimensionValues[i]); + } + } + if (object.metricValues) { + if (!Array.isArray(object.metricValues)) + throw TypeError(".google.analytics.data.v1alpha.Row.metricValues: array expected"); + message.metricValues = []; + for (var i = 0; i < object.metricValues.length; ++i) { + if (typeof object.metricValues[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.Row.metricValues: object expected"); + message.metricValues[i] = $root.google.analytics.data.v1alpha.MetricValue.fromObject(object.metricValues[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.Row + * @static + * @param {google.analytics.data.v1alpha.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.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.data.v1alpha.DimensionValue.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.data.v1alpha.MetricValue.toObject(message.metricValues[j], options); + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Row + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.Row + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.Row"; + }; + + return Row; + })(); + + v1alpha.DimensionValue = (function() { + + /** + * Properties of a DimensionValue. + * @memberof google.analytics.data.v1alpha + * @interface IDimensionValue + * @property {string|null} [value] DimensionValue value + */ + + /** + * Constructs a new DimensionValue. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a DimensionValue. + * @implements IDimensionValue + * @constructor + * @param {google.analytics.data.v1alpha.IDimensionValue=} [properties] Properties to set + */ + function DimensionValue(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]]; + } + + /** + * DimensionValue value. + * @member {string|null|undefined} value + * @memberof google.analytics.data.v1alpha.DimensionValue + * @instance + */ + DimensionValue.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DimensionValue oneValue. + * @member {"value"|undefined} oneValue + * @memberof google.analytics.data.v1alpha.DimensionValue + * @instance + */ + Object.defineProperty(DimensionValue.prototype, "oneValue", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DimensionValue instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.DimensionValue + * @static + * @param {google.analytics.data.v1alpha.IDimensionValue=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.DimensionValue} DimensionValue instance + */ + DimensionValue.create = function create(properties) { + return new DimensionValue(properties); + }; + + /** + * Encodes the specified DimensionValue message. Does not implicitly {@link google.analytics.data.v1alpha.DimensionValue.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.DimensionValue + * @static + * @param {google.analytics.data.v1alpha.IDimensionValue} message DimensionValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionValue.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 DimensionValue message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.DimensionValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.DimensionValue + * @static + * @param {google.analytics.data.v1alpha.IDimensionValue} message DimensionValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DimensionValue message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.DimensionValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.DimensionValue} DimensionValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.DimensionValue(); + 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 a DimensionValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.DimensionValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.DimensionValue} DimensionValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DimensionValue message. + * @function verify + * @memberof google.analytics.data.v1alpha.DimensionValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DimensionValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties.oneValue = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + return null; + }; + + /** + * Creates a DimensionValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.DimensionValue + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.DimensionValue} DimensionValue + */ + DimensionValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.DimensionValue) + return object; + var message = new $root.google.analytics.data.v1alpha.DimensionValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a DimensionValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.DimensionValue + * @static + * @param {google.analytics.data.v1alpha.DimensionValue} message DimensionValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DimensionValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object.oneValue = "value"; + } + return object; + }; + + /** + * Converts this DimensionValue to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.DimensionValue + * @instance + * @returns {Object.} JSON object + */ + DimensionValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DimensionValue + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.DimensionValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DimensionValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.DimensionValue"; + }; + + return DimensionValue; + })(); + + v1alpha.MetricValue = (function() { + + /** + * Properties of a MetricValue. + * @memberof google.analytics.data.v1alpha + * @interface IMetricValue + * @property {string|null} [value] MetricValue value + */ + + /** + * Constructs a new MetricValue. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a MetricValue. + * @implements IMetricValue + * @constructor + * @param {google.analytics.data.v1alpha.IMetricValue=} [properties] Properties to set + */ + function MetricValue(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]]; + } + + /** + * MetricValue value. + * @member {string|null|undefined} value + * @memberof google.analytics.data.v1alpha.MetricValue + * @instance + */ + MetricValue.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MetricValue oneValue. + * @member {"value"|undefined} oneValue + * @memberof google.analytics.data.v1alpha.MetricValue + * @instance + */ + Object.defineProperty(MetricValue.prototype, "oneValue", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MetricValue instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.MetricValue + * @static + * @param {google.analytics.data.v1alpha.IMetricValue=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.MetricValue} MetricValue instance + */ + MetricValue.create = function create(properties) { + return new MetricValue(properties); + }; + + /** + * Encodes the specified MetricValue message. Does not implicitly {@link google.analytics.data.v1alpha.MetricValue.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.MetricValue + * @static + * @param {google.analytics.data.v1alpha.IMetricValue} message MetricValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.value); + return writer; + }; + + /** + * Encodes the specified MetricValue message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.MetricValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.MetricValue + * @static + * @param {google.analytics.data.v1alpha.IMetricValue} message MetricValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricValue message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.MetricValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.MetricValue} MetricValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.MetricValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.MetricValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.MetricValue} MetricValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricValue message. + * @function verify + * @memberof google.analytics.data.v1alpha.MetricValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties.oneValue = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + return null; + }; + + /** + * Creates a MetricValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.MetricValue + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.MetricValue} MetricValue + */ + MetricValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.MetricValue) + return object; + var message = new $root.google.analytics.data.v1alpha.MetricValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a MetricValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.MetricValue + * @static + * @param {google.analytics.data.v1alpha.MetricValue} message MetricValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object.oneValue = "value"; + } + return object; + }; + + /** + * Converts this MetricValue to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.MetricValue + * @instance + * @returns {Object.} JSON object + */ + MetricValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricValue + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.MetricValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.MetricValue"; + }; + + return MetricValue; + })(); + + v1alpha.PropertyQuota = (function() { + + /** + * Properties of a PropertyQuota. + * @memberof google.analytics.data.v1alpha + * @interface IPropertyQuota + * @property {google.analytics.data.v1alpha.IQuotaStatus|null} [tokensPerDay] PropertyQuota tokensPerDay + * @property {google.analytics.data.v1alpha.IQuotaStatus|null} [tokensPerHour] PropertyQuota tokensPerHour + * @property {google.analytics.data.v1alpha.IQuotaStatus|null} [concurrentRequests] PropertyQuota concurrentRequests + * @property {google.analytics.data.v1alpha.IQuotaStatus|null} [serverErrorsPerProjectPerHour] PropertyQuota serverErrorsPerProjectPerHour + * @property {google.analytics.data.v1alpha.IQuotaStatus|null} [potentiallyThresholdedRequestsPerHour] PropertyQuota potentiallyThresholdedRequestsPerHour + */ + + /** + * Constructs a new PropertyQuota. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a PropertyQuota. + * @implements IPropertyQuota + * @constructor + * @param {google.analytics.data.v1alpha.IPropertyQuota=} [properties] Properties to set + */ + function PropertyQuota(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]]; + } + + /** + * PropertyQuota tokensPerDay. + * @member {google.analytics.data.v1alpha.IQuotaStatus|null|undefined} tokensPerDay + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @instance + */ + PropertyQuota.prototype.tokensPerDay = null; + + /** + * PropertyQuota tokensPerHour. + * @member {google.analytics.data.v1alpha.IQuotaStatus|null|undefined} tokensPerHour + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @instance + */ + PropertyQuota.prototype.tokensPerHour = null; + + /** + * PropertyQuota concurrentRequests. + * @member {google.analytics.data.v1alpha.IQuotaStatus|null|undefined} concurrentRequests + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @instance + */ + PropertyQuota.prototype.concurrentRequests = null; + + /** + * PropertyQuota serverErrorsPerProjectPerHour. + * @member {google.analytics.data.v1alpha.IQuotaStatus|null|undefined} serverErrorsPerProjectPerHour + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @instance + */ + PropertyQuota.prototype.serverErrorsPerProjectPerHour = null; + + /** + * PropertyQuota potentiallyThresholdedRequestsPerHour. + * @member {google.analytics.data.v1alpha.IQuotaStatus|null|undefined} potentiallyThresholdedRequestsPerHour + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @instance + */ + PropertyQuota.prototype.potentiallyThresholdedRequestsPerHour = null; + + /** + * Creates a new PropertyQuota instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @static + * @param {google.analytics.data.v1alpha.IPropertyQuota=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.PropertyQuota} PropertyQuota instance + */ + PropertyQuota.create = function create(properties) { + return new PropertyQuota(properties); + }; + + /** + * Encodes the specified PropertyQuota message. Does not implicitly {@link google.analytics.data.v1alpha.PropertyQuota.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @static + * @param {google.analytics.data.v1alpha.IPropertyQuota} message PropertyQuota message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyQuota.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokensPerDay != null && Object.hasOwnProperty.call(message, "tokensPerDay")) + $root.google.analytics.data.v1alpha.QuotaStatus.encode(message.tokensPerDay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tokensPerHour != null && Object.hasOwnProperty.call(message, "tokensPerHour")) + $root.google.analytics.data.v1alpha.QuotaStatus.encode(message.tokensPerHour, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.concurrentRequests != null && Object.hasOwnProperty.call(message, "concurrentRequests")) + $root.google.analytics.data.v1alpha.QuotaStatus.encode(message.concurrentRequests, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serverErrorsPerProjectPerHour != null && Object.hasOwnProperty.call(message, "serverErrorsPerProjectPerHour")) + $root.google.analytics.data.v1alpha.QuotaStatus.encode(message.serverErrorsPerProjectPerHour, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.potentiallyThresholdedRequestsPerHour != null && Object.hasOwnProperty.call(message, "potentiallyThresholdedRequestsPerHour")) + $root.google.analytics.data.v1alpha.QuotaStatus.encode(message.potentiallyThresholdedRequestsPerHour, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PropertyQuota message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.PropertyQuota.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @static + * @param {google.analytics.data.v1alpha.IPropertyQuota} message PropertyQuota message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyQuota.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PropertyQuota message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.PropertyQuota} PropertyQuota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyQuota.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.PropertyQuota(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tokensPerDay = $root.google.analytics.data.v1alpha.QuotaStatus.decode(reader, reader.uint32()); + break; + } + case 2: { + message.tokensPerHour = $root.google.analytics.data.v1alpha.QuotaStatus.decode(reader, reader.uint32()); + break; + } + case 3: { + message.concurrentRequests = $root.google.analytics.data.v1alpha.QuotaStatus.decode(reader, reader.uint32()); + break; + } + case 4: { + message.serverErrorsPerProjectPerHour = $root.google.analytics.data.v1alpha.QuotaStatus.decode(reader, reader.uint32()); + break; + } + case 5: { + message.potentiallyThresholdedRequestsPerHour = $root.google.analytics.data.v1alpha.QuotaStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PropertyQuota message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.PropertyQuota} PropertyQuota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyQuota.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PropertyQuota message. + * @function verify + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PropertyQuota.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.data.v1alpha.QuotaStatus.verify(message.tokensPerDay); + if (error) + return "tokensPerDay." + error; + } + if (message.tokensPerHour != null && message.hasOwnProperty("tokensPerHour")) { + var error = $root.google.analytics.data.v1alpha.QuotaStatus.verify(message.tokensPerHour); + if (error) + return "tokensPerHour." + error; + } + if (message.concurrentRequests != null && message.hasOwnProperty("concurrentRequests")) { + var error = $root.google.analytics.data.v1alpha.QuotaStatus.verify(message.concurrentRequests); + if (error) + return "concurrentRequests." + error; + } + if (message.serverErrorsPerProjectPerHour != null && message.hasOwnProperty("serverErrorsPerProjectPerHour")) { + var error = $root.google.analytics.data.v1alpha.QuotaStatus.verify(message.serverErrorsPerProjectPerHour); + if (error) + return "serverErrorsPerProjectPerHour." + error; + } + if (message.potentiallyThresholdedRequestsPerHour != null && message.hasOwnProperty("potentiallyThresholdedRequestsPerHour")) { + var error = $root.google.analytics.data.v1alpha.QuotaStatus.verify(message.potentiallyThresholdedRequestsPerHour); + if (error) + return "potentiallyThresholdedRequestsPerHour." + error; + } + return null; + }; + + /** + * Creates a PropertyQuota message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.PropertyQuota} PropertyQuota + */ + PropertyQuota.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.PropertyQuota) + return object; + var message = new $root.google.analytics.data.v1alpha.PropertyQuota(); + if (object.tokensPerDay != null) { + if (typeof object.tokensPerDay !== "object") + throw TypeError(".google.analytics.data.v1alpha.PropertyQuota.tokensPerDay: object expected"); + message.tokensPerDay = $root.google.analytics.data.v1alpha.QuotaStatus.fromObject(object.tokensPerDay); + } + if (object.tokensPerHour != null) { + if (typeof object.tokensPerHour !== "object") + throw TypeError(".google.analytics.data.v1alpha.PropertyQuota.tokensPerHour: object expected"); + message.tokensPerHour = $root.google.analytics.data.v1alpha.QuotaStatus.fromObject(object.tokensPerHour); + } + if (object.concurrentRequests != null) { + if (typeof object.concurrentRequests !== "object") + throw TypeError(".google.analytics.data.v1alpha.PropertyQuota.concurrentRequests: object expected"); + message.concurrentRequests = $root.google.analytics.data.v1alpha.QuotaStatus.fromObject(object.concurrentRequests); + } + if (object.serverErrorsPerProjectPerHour != null) { + if (typeof object.serverErrorsPerProjectPerHour !== "object") + throw TypeError(".google.analytics.data.v1alpha.PropertyQuota.serverErrorsPerProjectPerHour: object expected"); + message.serverErrorsPerProjectPerHour = $root.google.analytics.data.v1alpha.QuotaStatus.fromObject(object.serverErrorsPerProjectPerHour); + } + if (object.potentiallyThresholdedRequestsPerHour != null) { + if (typeof object.potentiallyThresholdedRequestsPerHour !== "object") + throw TypeError(".google.analytics.data.v1alpha.PropertyQuota.potentiallyThresholdedRequestsPerHour: object expected"); + message.potentiallyThresholdedRequestsPerHour = $root.google.analytics.data.v1alpha.QuotaStatus.fromObject(object.potentiallyThresholdedRequestsPerHour); + } + return message; + }; + + /** + * Creates a plain object from a PropertyQuota message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @static + * @param {google.analytics.data.v1alpha.PropertyQuota} message PropertyQuota + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PropertyQuota.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.potentiallyThresholdedRequestsPerHour = null; + } + if (message.tokensPerDay != null && message.hasOwnProperty("tokensPerDay")) + object.tokensPerDay = $root.google.analytics.data.v1alpha.QuotaStatus.toObject(message.tokensPerDay, options); + if (message.tokensPerHour != null && message.hasOwnProperty("tokensPerHour")) + object.tokensPerHour = $root.google.analytics.data.v1alpha.QuotaStatus.toObject(message.tokensPerHour, options); + if (message.concurrentRequests != null && message.hasOwnProperty("concurrentRequests")) + object.concurrentRequests = $root.google.analytics.data.v1alpha.QuotaStatus.toObject(message.concurrentRequests, options); + if (message.serverErrorsPerProjectPerHour != null && message.hasOwnProperty("serverErrorsPerProjectPerHour")) + object.serverErrorsPerProjectPerHour = $root.google.analytics.data.v1alpha.QuotaStatus.toObject(message.serverErrorsPerProjectPerHour, options); + if (message.potentiallyThresholdedRequestsPerHour != null && message.hasOwnProperty("potentiallyThresholdedRequestsPerHour")) + object.potentiallyThresholdedRequestsPerHour = $root.google.analytics.data.v1alpha.QuotaStatus.toObject(message.potentiallyThresholdedRequestsPerHour, options); + return object; + }; + + /** + * Converts this PropertyQuota to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @instance + * @returns {Object.} JSON object + */ + PropertyQuota.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PropertyQuota + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.PropertyQuota + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PropertyQuota.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.PropertyQuota"; + }; + + return PropertyQuota; + })(); + + v1alpha.QuotaStatus = (function() { + + /** + * Properties of a QuotaStatus. + * @memberof google.analytics.data.v1alpha + * @interface IQuotaStatus + * @property {number|null} [consumed] QuotaStatus consumed + * @property {number|null} [remaining] QuotaStatus remaining + */ + + /** + * Constructs a new QuotaStatus. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a QuotaStatus. + * @implements IQuotaStatus + * @constructor + * @param {google.analytics.data.v1alpha.IQuotaStatus=} [properties] Properties to set + */ + function QuotaStatus(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]]; + } + + /** + * QuotaStatus consumed. + * @member {number} consumed + * @memberof google.analytics.data.v1alpha.QuotaStatus + * @instance + */ + QuotaStatus.prototype.consumed = 0; + + /** + * QuotaStatus remaining. + * @member {number} remaining + * @memberof google.analytics.data.v1alpha.QuotaStatus + * @instance + */ + QuotaStatus.prototype.remaining = 0; + + /** + * Creates a new QuotaStatus instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.QuotaStatus + * @static + * @param {google.analytics.data.v1alpha.IQuotaStatus=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.QuotaStatus} QuotaStatus instance + */ + QuotaStatus.create = function create(properties) { + return new QuotaStatus(properties); + }; + + /** + * Encodes the specified QuotaStatus message. Does not implicitly {@link google.analytics.data.v1alpha.QuotaStatus.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.QuotaStatus + * @static + * @param {google.analytics.data.v1alpha.IQuotaStatus} message QuotaStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaStatus.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 QuotaStatus message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.QuotaStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.QuotaStatus + * @static + * @param {google.analytics.data.v1alpha.IQuotaStatus} message QuotaStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuotaStatus message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.QuotaStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.QuotaStatus} QuotaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.QuotaStatus(); + 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 a QuotaStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.QuotaStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.QuotaStatus} QuotaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuotaStatus message. + * @function verify + * @memberof google.analytics.data.v1alpha.QuotaStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuotaStatus.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 a QuotaStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.QuotaStatus + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.QuotaStatus} QuotaStatus + */ + QuotaStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.QuotaStatus) + return object; + var message = new $root.google.analytics.data.v1alpha.QuotaStatus(); + 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 a QuotaStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.QuotaStatus + * @static + * @param {google.analytics.data.v1alpha.QuotaStatus} message QuotaStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuotaStatus.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 QuotaStatus to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.QuotaStatus + * @instance + * @returns {Object.} JSON object + */ + QuotaStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuotaStatus + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.QuotaStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuotaStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.QuotaStatus"; + }; + + return QuotaStatus; + })(); + + v1alpha.FunnelBreakdown = (function() { + + /** + * Properties of a FunnelBreakdown. + * @memberof google.analytics.data.v1alpha + * @interface IFunnelBreakdown + * @property {google.analytics.data.v1alpha.IDimension|null} [breakdownDimension] FunnelBreakdown breakdownDimension + * @property {number|Long|null} [limit] FunnelBreakdown limit + */ + + /** + * Constructs a new FunnelBreakdown. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a FunnelBreakdown. + * @implements IFunnelBreakdown + * @constructor + * @param {google.analytics.data.v1alpha.IFunnelBreakdown=} [properties] Properties to set + */ + function FunnelBreakdown(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]]; + } + + /** + * FunnelBreakdown breakdownDimension. + * @member {google.analytics.data.v1alpha.IDimension|null|undefined} breakdownDimension + * @memberof google.analytics.data.v1alpha.FunnelBreakdown + * @instance + */ + FunnelBreakdown.prototype.breakdownDimension = null; + + /** + * FunnelBreakdown limit. + * @member {number|Long|null|undefined} limit + * @memberof google.analytics.data.v1alpha.FunnelBreakdown + * @instance + */ + FunnelBreakdown.prototype.limit = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FunnelBreakdown _limit. + * @member {"limit"|undefined} _limit + * @memberof google.analytics.data.v1alpha.FunnelBreakdown + * @instance + */ + Object.defineProperty(FunnelBreakdown.prototype, "_limit", { + get: $util.oneOfGetter($oneOfFields = ["limit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FunnelBreakdown instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.FunnelBreakdown + * @static + * @param {google.analytics.data.v1alpha.IFunnelBreakdown=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FunnelBreakdown} FunnelBreakdown instance + */ + FunnelBreakdown.create = function create(properties) { + return new FunnelBreakdown(properties); + }; + + /** + * Encodes the specified FunnelBreakdown message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelBreakdown.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.FunnelBreakdown + * @static + * @param {google.analytics.data.v1alpha.IFunnelBreakdown} message FunnelBreakdown message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelBreakdown.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.breakdownDimension != null && Object.hasOwnProperty.call(message, "breakdownDimension")) + $root.google.analytics.data.v1alpha.Dimension.encode(message.breakdownDimension, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.limit); + return writer; + }; + + /** + * Encodes the specified FunnelBreakdown message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelBreakdown.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelBreakdown + * @static + * @param {google.analytics.data.v1alpha.IFunnelBreakdown} message FunnelBreakdown message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelBreakdown.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunnelBreakdown message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.FunnelBreakdown + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.FunnelBreakdown} FunnelBreakdown + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelBreakdown.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FunnelBreakdown(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.breakdownDimension = $root.google.analytics.data.v1alpha.Dimension.decode(reader, reader.uint32()); + break; + } + case 2: { + message.limit = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunnelBreakdown message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelBreakdown + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.FunnelBreakdown} FunnelBreakdown + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelBreakdown.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunnelBreakdown message. + * @function verify + * @memberof google.analytics.data.v1alpha.FunnelBreakdown + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunnelBreakdown.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.breakdownDimension != null && message.hasOwnProperty("breakdownDimension")) { + var error = $root.google.analytics.data.v1alpha.Dimension.verify(message.breakdownDimension); + if (error) + return "breakdownDimension." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) { + properties._limit = 1; + if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) + return "limit: integer|Long expected"; + } + return null; + }; + + /** + * Creates a FunnelBreakdown message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.FunnelBreakdown + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.FunnelBreakdown} FunnelBreakdown + */ + FunnelBreakdown.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FunnelBreakdown) + return object; + var message = new $root.google.analytics.data.v1alpha.FunnelBreakdown(); + if (object.breakdownDimension != null) { + if (typeof object.breakdownDimension !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelBreakdown.breakdownDimension: object expected"); + message.breakdownDimension = $root.google.analytics.data.v1alpha.Dimension.fromObject(object.breakdownDimension); + } + 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(); + return message; + }; + + /** + * Creates a plain object from a FunnelBreakdown message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.FunnelBreakdown + * @static + * @param {google.analytics.data.v1alpha.FunnelBreakdown} message FunnelBreakdown + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunnelBreakdown.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.breakdownDimension = null; + if (message.breakdownDimension != null && message.hasOwnProperty("breakdownDimension")) + object.breakdownDimension = $root.google.analytics.data.v1alpha.Dimension.toObject(message.breakdownDimension, options); + 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 (options.oneofs) + object._limit = "limit"; + } + return object; + }; + + /** + * Converts this FunnelBreakdown to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.FunnelBreakdown + * @instance + * @returns {Object.} JSON object + */ + FunnelBreakdown.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunnelBreakdown + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.FunnelBreakdown + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunnelBreakdown.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.FunnelBreakdown"; + }; + + return FunnelBreakdown; + })(); + + v1alpha.FunnelNextAction = (function() { + + /** + * Properties of a FunnelNextAction. + * @memberof google.analytics.data.v1alpha + * @interface IFunnelNextAction + * @property {google.analytics.data.v1alpha.IDimension|null} [nextActionDimension] FunnelNextAction nextActionDimension + * @property {number|Long|null} [limit] FunnelNextAction limit + */ + + /** + * Constructs a new FunnelNextAction. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a FunnelNextAction. + * @implements IFunnelNextAction + * @constructor + * @param {google.analytics.data.v1alpha.IFunnelNextAction=} [properties] Properties to set + */ + function FunnelNextAction(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]]; + } + + /** + * FunnelNextAction nextActionDimension. + * @member {google.analytics.data.v1alpha.IDimension|null|undefined} nextActionDimension + * @memberof google.analytics.data.v1alpha.FunnelNextAction + * @instance + */ + FunnelNextAction.prototype.nextActionDimension = null; + + /** + * FunnelNextAction limit. + * @member {number|Long|null|undefined} limit + * @memberof google.analytics.data.v1alpha.FunnelNextAction + * @instance + */ + FunnelNextAction.prototype.limit = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FunnelNextAction _limit. + * @member {"limit"|undefined} _limit + * @memberof google.analytics.data.v1alpha.FunnelNextAction + * @instance + */ + Object.defineProperty(FunnelNextAction.prototype, "_limit", { + get: $util.oneOfGetter($oneOfFields = ["limit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FunnelNextAction instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.FunnelNextAction + * @static + * @param {google.analytics.data.v1alpha.IFunnelNextAction=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FunnelNextAction} FunnelNextAction instance + */ + FunnelNextAction.create = function create(properties) { + return new FunnelNextAction(properties); + }; + + /** + * Encodes the specified FunnelNextAction message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelNextAction.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.FunnelNextAction + * @static + * @param {google.analytics.data.v1alpha.IFunnelNextAction} message FunnelNextAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelNextAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nextActionDimension != null && Object.hasOwnProperty.call(message, "nextActionDimension")) + $root.google.analytics.data.v1alpha.Dimension.encode(message.nextActionDimension, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.limit); + return writer; + }; + + /** + * Encodes the specified FunnelNextAction message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelNextAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelNextAction + * @static + * @param {google.analytics.data.v1alpha.IFunnelNextAction} message FunnelNextAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelNextAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunnelNextAction message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.FunnelNextAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.FunnelNextAction} FunnelNextAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelNextAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FunnelNextAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nextActionDimension = $root.google.analytics.data.v1alpha.Dimension.decode(reader, reader.uint32()); + break; + } + case 2: { + message.limit = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunnelNextAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelNextAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.FunnelNextAction} FunnelNextAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelNextAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunnelNextAction message. + * @function verify + * @memberof google.analytics.data.v1alpha.FunnelNextAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunnelNextAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nextActionDimension != null && message.hasOwnProperty("nextActionDimension")) { + var error = $root.google.analytics.data.v1alpha.Dimension.verify(message.nextActionDimension); + if (error) + return "nextActionDimension." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) { + properties._limit = 1; + if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) + return "limit: integer|Long expected"; + } + return null; + }; + + /** + * Creates a FunnelNextAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.FunnelNextAction + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.FunnelNextAction} FunnelNextAction + */ + FunnelNextAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FunnelNextAction) + return object; + var message = new $root.google.analytics.data.v1alpha.FunnelNextAction(); + if (object.nextActionDimension != null) { + if (typeof object.nextActionDimension !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelNextAction.nextActionDimension: object expected"); + message.nextActionDimension = $root.google.analytics.data.v1alpha.Dimension.fromObject(object.nextActionDimension); + } + 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(); + return message; + }; + + /** + * Creates a plain object from a FunnelNextAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.FunnelNextAction + * @static + * @param {google.analytics.data.v1alpha.FunnelNextAction} message FunnelNextAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunnelNextAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.nextActionDimension = null; + if (message.nextActionDimension != null && message.hasOwnProperty("nextActionDimension")) + object.nextActionDimension = $root.google.analytics.data.v1alpha.Dimension.toObject(message.nextActionDimension, options); + 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 (options.oneofs) + object._limit = "limit"; + } + return object; + }; + + /** + * Converts this FunnelNextAction to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.FunnelNextAction + * @instance + * @returns {Object.} JSON object + */ + FunnelNextAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunnelNextAction + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.FunnelNextAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunnelNextAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.FunnelNextAction"; + }; + + return FunnelNextAction; + })(); + + v1alpha.Funnel = (function() { + + /** + * Properties of a Funnel. + * @memberof google.analytics.data.v1alpha + * @interface IFunnel + * @property {boolean|null} [isOpenFunnel] Funnel isOpenFunnel + * @property {Array.|null} [steps] Funnel steps + */ + + /** + * Constructs a new Funnel. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a Funnel. + * @implements IFunnel + * @constructor + * @param {google.analytics.data.v1alpha.IFunnel=} [properties] Properties to set + */ + function Funnel(properties) { + this.steps = []; + 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]]; + } + + /** + * Funnel isOpenFunnel. + * @member {boolean} isOpenFunnel + * @memberof google.analytics.data.v1alpha.Funnel + * @instance + */ + Funnel.prototype.isOpenFunnel = false; + + /** + * Funnel steps. + * @member {Array.} steps + * @memberof google.analytics.data.v1alpha.Funnel + * @instance + */ + Funnel.prototype.steps = $util.emptyArray; + + /** + * Creates a new Funnel instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.Funnel + * @static + * @param {google.analytics.data.v1alpha.IFunnel=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.Funnel} Funnel instance + */ + Funnel.create = function create(properties) { + return new Funnel(properties); + }; + + /** + * Encodes the specified Funnel message. Does not implicitly {@link google.analytics.data.v1alpha.Funnel.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.Funnel + * @static + * @param {google.analytics.data.v1alpha.IFunnel} message Funnel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Funnel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.isOpenFunnel != null && Object.hasOwnProperty.call(message, "isOpenFunnel")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isOpenFunnel); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + $root.google.analytics.data.v1alpha.FunnelStep.encode(message.steps[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Funnel message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.Funnel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.Funnel + * @static + * @param {google.analytics.data.v1alpha.IFunnel} message Funnel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Funnel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Funnel message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.Funnel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.Funnel} Funnel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Funnel.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.Funnel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.isOpenFunnel = reader.bool(); + break; + } + case 2: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push($root.google.analytics.data.v1alpha.FunnelStep.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Funnel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.Funnel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.Funnel} Funnel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Funnel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Funnel message. + * @function verify + * @memberof google.analytics.data.v1alpha.Funnel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Funnel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.isOpenFunnel != null && message.hasOwnProperty("isOpenFunnel")) + if (typeof message.isOpenFunnel !== "boolean") + return "isOpenFunnel: boolean expected"; + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) { + var error = $root.google.analytics.data.v1alpha.FunnelStep.verify(message.steps[i]); + if (error) + return "steps." + error; + } + } + return null; + }; + + /** + * Creates a Funnel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.Funnel + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.Funnel} Funnel + */ + Funnel.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.Funnel) + return object; + var message = new $root.google.analytics.data.v1alpha.Funnel(); + if (object.isOpenFunnel != null) + message.isOpenFunnel = Boolean(object.isOpenFunnel); + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.analytics.data.v1alpha.Funnel.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) { + if (typeof object.steps[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.Funnel.steps: object expected"); + message.steps[i] = $root.google.analytics.data.v1alpha.FunnelStep.fromObject(object.steps[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Funnel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.Funnel + * @static + * @param {google.analytics.data.v1alpha.Funnel} message Funnel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Funnel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.steps = []; + if (options.defaults) + object.isOpenFunnel = false; + if (message.isOpenFunnel != null && message.hasOwnProperty("isOpenFunnel")) + object.isOpenFunnel = message.isOpenFunnel; + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = $root.google.analytics.data.v1alpha.FunnelStep.toObject(message.steps[j], options); + } + return object; + }; + + /** + * Converts this Funnel to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.Funnel + * @instance + * @returns {Object.} JSON object + */ + Funnel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Funnel + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.Funnel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Funnel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.Funnel"; + }; + + return Funnel; + })(); + + v1alpha.FunnelStep = (function() { + + /** + * Properties of a FunnelStep. + * @memberof google.analytics.data.v1alpha + * @interface IFunnelStep + * @property {string|null} [name] FunnelStep name + * @property {boolean|null} [isDirectlyFollowedBy] FunnelStep isDirectlyFollowedBy + * @property {google.protobuf.IDuration|null} [withinDurationFromPriorStep] FunnelStep withinDurationFromPriorStep + * @property {google.analytics.data.v1alpha.IFunnelFilterExpression|null} [filterExpression] FunnelStep filterExpression + */ + + /** + * Constructs a new FunnelStep. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a FunnelStep. + * @implements IFunnelStep + * @constructor + * @param {google.analytics.data.v1alpha.IFunnelStep=} [properties] Properties to set + */ + function FunnelStep(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]]; + } + + /** + * FunnelStep name. + * @member {string} name + * @memberof google.analytics.data.v1alpha.FunnelStep + * @instance + */ + FunnelStep.prototype.name = ""; + + /** + * FunnelStep isDirectlyFollowedBy. + * @member {boolean} isDirectlyFollowedBy + * @memberof google.analytics.data.v1alpha.FunnelStep + * @instance + */ + FunnelStep.prototype.isDirectlyFollowedBy = false; + + /** + * FunnelStep withinDurationFromPriorStep. + * @member {google.protobuf.IDuration|null|undefined} withinDurationFromPriorStep + * @memberof google.analytics.data.v1alpha.FunnelStep + * @instance + */ + FunnelStep.prototype.withinDurationFromPriorStep = null; + + /** + * FunnelStep filterExpression. + * @member {google.analytics.data.v1alpha.IFunnelFilterExpression|null|undefined} filterExpression + * @memberof google.analytics.data.v1alpha.FunnelStep + * @instance + */ + FunnelStep.prototype.filterExpression = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FunnelStep _withinDurationFromPriorStep. + * @member {"withinDurationFromPriorStep"|undefined} _withinDurationFromPriorStep + * @memberof google.analytics.data.v1alpha.FunnelStep + * @instance + */ + Object.defineProperty(FunnelStep.prototype, "_withinDurationFromPriorStep", { + get: $util.oneOfGetter($oneOfFields = ["withinDurationFromPriorStep"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FunnelStep instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.FunnelStep + * @static + * @param {google.analytics.data.v1alpha.IFunnelStep=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FunnelStep} FunnelStep instance + */ + FunnelStep.create = function create(properties) { + return new FunnelStep(properties); + }; + + /** + * Encodes the specified FunnelStep message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelStep.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.FunnelStep + * @static + * @param {google.analytics.data.v1alpha.IFunnelStep} message FunnelStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelStep.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.isDirectlyFollowedBy != null && Object.hasOwnProperty.call(message, "isDirectlyFollowedBy")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isDirectlyFollowedBy); + if (message.withinDurationFromPriorStep != null && Object.hasOwnProperty.call(message, "withinDurationFromPriorStep")) + $root.google.protobuf.Duration.encode(message.withinDurationFromPriorStep, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.filterExpression != null && Object.hasOwnProperty.call(message, "filterExpression")) + $root.google.analytics.data.v1alpha.FunnelFilterExpression.encode(message.filterExpression, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunnelStep message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelStep.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelStep + * @static + * @param {google.analytics.data.v1alpha.IFunnelStep} message FunnelStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelStep.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunnelStep message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.FunnelStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.FunnelStep} FunnelStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelStep.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FunnelStep(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.isDirectlyFollowedBy = reader.bool(); + break; + } + case 3: { + message.withinDurationFromPriorStep = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.filterExpression = $root.google.analytics.data.v1alpha.FunnelFilterExpression.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunnelStep message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.FunnelStep} FunnelStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelStep.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunnelStep message. + * @function verify + * @memberof google.analytics.data.v1alpha.FunnelStep + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunnelStep.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.isDirectlyFollowedBy != null && message.hasOwnProperty("isDirectlyFollowedBy")) + if (typeof message.isDirectlyFollowedBy !== "boolean") + return "isDirectlyFollowedBy: boolean expected"; + if (message.withinDurationFromPriorStep != null && message.hasOwnProperty("withinDurationFromPriorStep")) { + properties._withinDurationFromPriorStep = 1; + { + var error = $root.google.protobuf.Duration.verify(message.withinDurationFromPriorStep); + if (error) + return "withinDurationFromPriorStep." + error; + } + } + if (message.filterExpression != null && message.hasOwnProperty("filterExpression")) { + var error = $root.google.analytics.data.v1alpha.FunnelFilterExpression.verify(message.filterExpression); + if (error) + return "filterExpression." + error; + } + return null; + }; + + /** + * Creates a FunnelStep message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.FunnelStep + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.FunnelStep} FunnelStep + */ + FunnelStep.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FunnelStep) + return object; + var message = new $root.google.analytics.data.v1alpha.FunnelStep(); + if (object.name != null) + message.name = String(object.name); + if (object.isDirectlyFollowedBy != null) + message.isDirectlyFollowedBy = Boolean(object.isDirectlyFollowedBy); + if (object.withinDurationFromPriorStep != null) { + if (typeof object.withinDurationFromPriorStep !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelStep.withinDurationFromPriorStep: object expected"); + message.withinDurationFromPriorStep = $root.google.protobuf.Duration.fromObject(object.withinDurationFromPriorStep); + } + if (object.filterExpression != null) { + if (typeof object.filterExpression !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelStep.filterExpression: object expected"); + message.filterExpression = $root.google.analytics.data.v1alpha.FunnelFilterExpression.fromObject(object.filterExpression); + } + return message; + }; + + /** + * Creates a plain object from a FunnelStep message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.FunnelStep + * @static + * @param {google.analytics.data.v1alpha.FunnelStep} message FunnelStep + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunnelStep.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.isDirectlyFollowedBy = false; + object.filterExpression = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.isDirectlyFollowedBy != null && message.hasOwnProperty("isDirectlyFollowedBy")) + object.isDirectlyFollowedBy = message.isDirectlyFollowedBy; + if (message.withinDurationFromPriorStep != null && message.hasOwnProperty("withinDurationFromPriorStep")) { + object.withinDurationFromPriorStep = $root.google.protobuf.Duration.toObject(message.withinDurationFromPriorStep, options); + if (options.oneofs) + object._withinDurationFromPriorStep = "withinDurationFromPriorStep"; + } + if (message.filterExpression != null && message.hasOwnProperty("filterExpression")) + object.filterExpression = $root.google.analytics.data.v1alpha.FunnelFilterExpression.toObject(message.filterExpression, options); + return object; + }; + + /** + * Converts this FunnelStep to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.FunnelStep + * @instance + * @returns {Object.} JSON object + */ + FunnelStep.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunnelStep + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.FunnelStep + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunnelStep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.FunnelStep"; + }; + + return FunnelStep; + })(); + + v1alpha.FunnelSubReport = (function() { + + /** + * Properties of a FunnelSubReport. + * @memberof google.analytics.data.v1alpha + * @interface IFunnelSubReport + * @property {Array.|null} [dimensionHeaders] FunnelSubReport dimensionHeaders + * @property {Array.|null} [metricHeaders] FunnelSubReport metricHeaders + * @property {Array.|null} [rows] FunnelSubReport rows + * @property {google.analytics.data.v1alpha.IFunnelResponseMetadata|null} [metadata] FunnelSubReport metadata + */ + + /** + * Constructs a new FunnelSubReport. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a FunnelSubReport. + * @implements IFunnelSubReport + * @constructor + * @param {google.analytics.data.v1alpha.IFunnelSubReport=} [properties] Properties to set + */ + function FunnelSubReport(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]]; + } + + /** + * FunnelSubReport dimensionHeaders. + * @member {Array.} dimensionHeaders + * @memberof google.analytics.data.v1alpha.FunnelSubReport + * @instance + */ + FunnelSubReport.prototype.dimensionHeaders = $util.emptyArray; + + /** + * FunnelSubReport metricHeaders. + * @member {Array.} metricHeaders + * @memberof google.analytics.data.v1alpha.FunnelSubReport + * @instance + */ + FunnelSubReport.prototype.metricHeaders = $util.emptyArray; + + /** + * FunnelSubReport rows. + * @member {Array.} rows + * @memberof google.analytics.data.v1alpha.FunnelSubReport + * @instance + */ + FunnelSubReport.prototype.rows = $util.emptyArray; + + /** + * FunnelSubReport metadata. + * @member {google.analytics.data.v1alpha.IFunnelResponseMetadata|null|undefined} metadata + * @memberof google.analytics.data.v1alpha.FunnelSubReport + * @instance + */ + FunnelSubReport.prototype.metadata = null; + + /** + * Creates a new FunnelSubReport instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.FunnelSubReport + * @static + * @param {google.analytics.data.v1alpha.IFunnelSubReport=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FunnelSubReport} FunnelSubReport instance + */ + FunnelSubReport.create = function create(properties) { + return new FunnelSubReport(properties); + }; + + /** + * Encodes the specified FunnelSubReport message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelSubReport.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.FunnelSubReport + * @static + * @param {google.analytics.data.v1alpha.IFunnelSubReport} message FunnelSubReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelSubReport.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.data.v1alpha.DimensionHeader.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.data.v1alpha.MetricHeader.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.data.v1alpha.Row.encode(message.rows[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.analytics.data.v1alpha.FunnelResponseMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunnelSubReport message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelSubReport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelSubReport + * @static + * @param {google.analytics.data.v1alpha.IFunnelSubReport} message FunnelSubReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelSubReport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunnelSubReport message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.FunnelSubReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.FunnelSubReport} FunnelSubReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelSubReport.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FunnelSubReport(); + 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.data.v1alpha.DimensionHeader.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.metricHeaders && message.metricHeaders.length)) + message.metricHeaders = []; + message.metricHeaders.push($root.google.analytics.data.v1alpha.MetricHeader.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.analytics.data.v1alpha.Row.decode(reader, reader.uint32())); + break; + } + case 4: { + message.metadata = $root.google.analytics.data.v1alpha.FunnelResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunnelSubReport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelSubReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.FunnelSubReport} FunnelSubReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelSubReport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunnelSubReport message. + * @function verify + * @memberof google.analytics.data.v1alpha.FunnelSubReport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunnelSubReport.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.data.v1alpha.DimensionHeader.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.data.v1alpha.MetricHeader.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.data.v1alpha.Row.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.analytics.data.v1alpha.FunnelResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a FunnelSubReport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.FunnelSubReport + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.FunnelSubReport} FunnelSubReport + */ + FunnelSubReport.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FunnelSubReport) + return object; + var message = new $root.google.analytics.data.v1alpha.FunnelSubReport(); + if (object.dimensionHeaders) { + if (!Array.isArray(object.dimensionHeaders)) + throw TypeError(".google.analytics.data.v1alpha.FunnelSubReport.dimensionHeaders: array expected"); + message.dimensionHeaders = []; + for (var i = 0; i < object.dimensionHeaders.length; ++i) { + if (typeof object.dimensionHeaders[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelSubReport.dimensionHeaders: object expected"); + message.dimensionHeaders[i] = $root.google.analytics.data.v1alpha.DimensionHeader.fromObject(object.dimensionHeaders[i]); + } + } + if (object.metricHeaders) { + if (!Array.isArray(object.metricHeaders)) + throw TypeError(".google.analytics.data.v1alpha.FunnelSubReport.metricHeaders: array expected"); + message.metricHeaders = []; + for (var i = 0; i < object.metricHeaders.length; ++i) { + if (typeof object.metricHeaders[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelSubReport.metricHeaders: object expected"); + message.metricHeaders[i] = $root.google.analytics.data.v1alpha.MetricHeader.fromObject(object.metricHeaders[i]); + } + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.analytics.data.v1alpha.FunnelSubReport.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelSubReport.rows: object expected"); + message.rows[i] = $root.google.analytics.data.v1alpha.Row.fromObject(object.rows[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelSubReport.metadata: object expected"); + message.metadata = $root.google.analytics.data.v1alpha.FunnelResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a FunnelSubReport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.FunnelSubReport + * @static + * @param {google.analytics.data.v1alpha.FunnelSubReport} message FunnelSubReport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunnelSubReport.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.metadata = null; + if (message.dimensionHeaders && message.dimensionHeaders.length) { + object.dimensionHeaders = []; + for (var j = 0; j < message.dimensionHeaders.length; ++j) + object.dimensionHeaders[j] = $root.google.analytics.data.v1alpha.DimensionHeader.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.data.v1alpha.MetricHeader.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.data.v1alpha.Row.toObject(message.rows[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.analytics.data.v1alpha.FunnelResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this FunnelSubReport to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.FunnelSubReport + * @instance + * @returns {Object.} JSON object + */ + FunnelSubReport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunnelSubReport + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.FunnelSubReport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunnelSubReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.FunnelSubReport"; + }; + + return FunnelSubReport; + })(); + + v1alpha.UserSegment = (function() { + + /** + * Properties of a UserSegment. + * @memberof google.analytics.data.v1alpha + * @interface IUserSegment + * @property {google.analytics.data.v1alpha.IUserSegmentCriteria|null} [userInclusionCriteria] UserSegment userInclusionCriteria + * @property {google.analytics.data.v1alpha.IUserSegmentExclusion|null} [exclusion] UserSegment exclusion + */ + + /** + * Constructs a new UserSegment. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a UserSegment. + * @implements IUserSegment + * @constructor + * @param {google.analytics.data.v1alpha.IUserSegment=} [properties] Properties to set + */ + function UserSegment(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]]; + } + + /** + * UserSegment userInclusionCriteria. + * @member {google.analytics.data.v1alpha.IUserSegmentCriteria|null|undefined} userInclusionCriteria + * @memberof google.analytics.data.v1alpha.UserSegment + * @instance + */ + UserSegment.prototype.userInclusionCriteria = null; + + /** + * UserSegment exclusion. + * @member {google.analytics.data.v1alpha.IUserSegmentExclusion|null|undefined} exclusion + * @memberof google.analytics.data.v1alpha.UserSegment + * @instance + */ + UserSegment.prototype.exclusion = null; + + /** + * Creates a new UserSegment instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.UserSegment + * @static + * @param {google.analytics.data.v1alpha.IUserSegment=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.UserSegment} UserSegment instance + */ + UserSegment.create = function create(properties) { + return new UserSegment(properties); + }; + + /** + * Encodes the specified UserSegment message. Does not implicitly {@link google.analytics.data.v1alpha.UserSegment.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.UserSegment + * @static + * @param {google.analytics.data.v1alpha.IUserSegment} message UserSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userInclusionCriteria != null && Object.hasOwnProperty.call(message, "userInclusionCriteria")) + $root.google.analytics.data.v1alpha.UserSegmentCriteria.encode(message.userInclusionCriteria, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.exclusion != null && Object.hasOwnProperty.call(message, "exclusion")) + $root.google.analytics.data.v1alpha.UserSegmentExclusion.encode(message.exclusion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserSegment message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.UserSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.UserSegment + * @static + * @param {google.analytics.data.v1alpha.IUserSegment} message UserSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserSegment message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.UserSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.UserSegment} UserSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserSegment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.UserSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.userInclusionCriteria = $root.google.analytics.data.v1alpha.UserSegmentCriteria.decode(reader, reader.uint32()); + break; + } + case 2: { + message.exclusion = $root.google.analytics.data.v1alpha.UserSegmentExclusion.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.UserSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.UserSegment} UserSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserSegment message. + * @function verify + * @memberof google.analytics.data.v1alpha.UserSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userInclusionCriteria != null && message.hasOwnProperty("userInclusionCriteria")) { + var error = $root.google.analytics.data.v1alpha.UserSegmentCriteria.verify(message.userInclusionCriteria); + if (error) + return "userInclusionCriteria." + error; + } + if (message.exclusion != null && message.hasOwnProperty("exclusion")) { + var error = $root.google.analytics.data.v1alpha.UserSegmentExclusion.verify(message.exclusion); + if (error) + return "exclusion." + error; + } + return null; + }; + + /** + * Creates a UserSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.UserSegment + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.UserSegment} UserSegment + */ + UserSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.UserSegment) + return object; + var message = new $root.google.analytics.data.v1alpha.UserSegment(); + if (object.userInclusionCriteria != null) { + if (typeof object.userInclusionCriteria !== "object") + throw TypeError(".google.analytics.data.v1alpha.UserSegment.userInclusionCriteria: object expected"); + message.userInclusionCriteria = $root.google.analytics.data.v1alpha.UserSegmentCriteria.fromObject(object.userInclusionCriteria); + } + if (object.exclusion != null) { + if (typeof object.exclusion !== "object") + throw TypeError(".google.analytics.data.v1alpha.UserSegment.exclusion: object expected"); + message.exclusion = $root.google.analytics.data.v1alpha.UserSegmentExclusion.fromObject(object.exclusion); + } + return message; + }; + + /** + * Creates a plain object from a UserSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.UserSegment + * @static + * @param {google.analytics.data.v1alpha.UserSegment} message UserSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.userInclusionCriteria = null; + object.exclusion = null; + } + if (message.userInclusionCriteria != null && message.hasOwnProperty("userInclusionCriteria")) + object.userInclusionCriteria = $root.google.analytics.data.v1alpha.UserSegmentCriteria.toObject(message.userInclusionCriteria, options); + if (message.exclusion != null && message.hasOwnProperty("exclusion")) + object.exclusion = $root.google.analytics.data.v1alpha.UserSegmentExclusion.toObject(message.exclusion, options); + return object; + }; + + /** + * Converts this UserSegment to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.UserSegment + * @instance + * @returns {Object.} JSON object + */ + UserSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserSegment + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.UserSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.UserSegment"; + }; + + return UserSegment; + })(); + + v1alpha.UserSegmentCriteria = (function() { + + /** + * Properties of a UserSegmentCriteria. + * @memberof google.analytics.data.v1alpha + * @interface IUserSegmentCriteria + * @property {Array.|null} [andConditionGroups] UserSegmentCriteria andConditionGroups + * @property {Array.|null} [andSequenceGroups] UserSegmentCriteria andSequenceGroups + */ + + /** + * Constructs a new UserSegmentCriteria. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a UserSegmentCriteria. + * @implements IUserSegmentCriteria + * @constructor + * @param {google.analytics.data.v1alpha.IUserSegmentCriteria=} [properties] Properties to set + */ + function UserSegmentCriteria(properties) { + this.andConditionGroups = []; + this.andSequenceGroups = []; + 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]]; + } + + /** + * UserSegmentCriteria andConditionGroups. + * @member {Array.} andConditionGroups + * @memberof google.analytics.data.v1alpha.UserSegmentCriteria + * @instance + */ + UserSegmentCriteria.prototype.andConditionGroups = $util.emptyArray; + + /** + * UserSegmentCriteria andSequenceGroups. + * @member {Array.} andSequenceGroups + * @memberof google.analytics.data.v1alpha.UserSegmentCriteria + * @instance + */ + UserSegmentCriteria.prototype.andSequenceGroups = $util.emptyArray; + + /** + * Creates a new UserSegmentCriteria instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.UserSegmentCriteria + * @static + * @param {google.analytics.data.v1alpha.IUserSegmentCriteria=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.UserSegmentCriteria} UserSegmentCriteria instance + */ + UserSegmentCriteria.create = function create(properties) { + return new UserSegmentCriteria(properties); + }; + + /** + * Encodes the specified UserSegmentCriteria message. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentCriteria.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.UserSegmentCriteria + * @static + * @param {google.analytics.data.v1alpha.IUserSegmentCriteria} message UserSegmentCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserSegmentCriteria.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.andConditionGroups != null && message.andConditionGroups.length) + for (var i = 0; i < message.andConditionGroups.length; ++i) + $root.google.analytics.data.v1alpha.UserSegmentConditionGroup.encode(message.andConditionGroups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.andSequenceGroups != null && message.andSequenceGroups.length) + for (var i = 0; i < message.andSequenceGroups.length; ++i) + $root.google.analytics.data.v1alpha.UserSegmentSequenceGroup.encode(message.andSequenceGroups[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserSegmentCriteria message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentCriteria.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.UserSegmentCriteria + * @static + * @param {google.analytics.data.v1alpha.IUserSegmentCriteria} message UserSegmentCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserSegmentCriteria.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserSegmentCriteria message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.UserSegmentCriteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.UserSegmentCriteria} UserSegmentCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserSegmentCriteria.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.UserSegmentCriteria(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.andConditionGroups && message.andConditionGroups.length)) + message.andConditionGroups = []; + message.andConditionGroups.push($root.google.analytics.data.v1alpha.UserSegmentConditionGroup.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.andSequenceGroups && message.andSequenceGroups.length)) + message.andSequenceGroups = []; + message.andSequenceGroups.push($root.google.analytics.data.v1alpha.UserSegmentSequenceGroup.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserSegmentCriteria message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.UserSegmentCriteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.UserSegmentCriteria} UserSegmentCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserSegmentCriteria.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserSegmentCriteria message. + * @function verify + * @memberof google.analytics.data.v1alpha.UserSegmentCriteria + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserSegmentCriteria.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.andConditionGroups != null && message.hasOwnProperty("andConditionGroups")) { + if (!Array.isArray(message.andConditionGroups)) + return "andConditionGroups: array expected"; + for (var i = 0; i < message.andConditionGroups.length; ++i) { + var error = $root.google.analytics.data.v1alpha.UserSegmentConditionGroup.verify(message.andConditionGroups[i]); + if (error) + return "andConditionGroups." + error; + } + } + if (message.andSequenceGroups != null && message.hasOwnProperty("andSequenceGroups")) { + if (!Array.isArray(message.andSequenceGroups)) + return "andSequenceGroups: array expected"; + for (var i = 0; i < message.andSequenceGroups.length; ++i) { + var error = $root.google.analytics.data.v1alpha.UserSegmentSequenceGroup.verify(message.andSequenceGroups[i]); + if (error) + return "andSequenceGroups." + error; + } + } + return null; + }; + + /** + * Creates a UserSegmentCriteria message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.UserSegmentCriteria + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.UserSegmentCriteria} UserSegmentCriteria + */ + UserSegmentCriteria.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.UserSegmentCriteria) + return object; + var message = new $root.google.analytics.data.v1alpha.UserSegmentCriteria(); + if (object.andConditionGroups) { + if (!Array.isArray(object.andConditionGroups)) + throw TypeError(".google.analytics.data.v1alpha.UserSegmentCriteria.andConditionGroups: array expected"); + message.andConditionGroups = []; + for (var i = 0; i < object.andConditionGroups.length; ++i) { + if (typeof object.andConditionGroups[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.UserSegmentCriteria.andConditionGroups: object expected"); + message.andConditionGroups[i] = $root.google.analytics.data.v1alpha.UserSegmentConditionGroup.fromObject(object.andConditionGroups[i]); + } + } + if (object.andSequenceGroups) { + if (!Array.isArray(object.andSequenceGroups)) + throw TypeError(".google.analytics.data.v1alpha.UserSegmentCriteria.andSequenceGroups: array expected"); + message.andSequenceGroups = []; + for (var i = 0; i < object.andSequenceGroups.length; ++i) { + if (typeof object.andSequenceGroups[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.UserSegmentCriteria.andSequenceGroups: object expected"); + message.andSequenceGroups[i] = $root.google.analytics.data.v1alpha.UserSegmentSequenceGroup.fromObject(object.andSequenceGroups[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a UserSegmentCriteria message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.UserSegmentCriteria + * @static + * @param {google.analytics.data.v1alpha.UserSegmentCriteria} message UserSegmentCriteria + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserSegmentCriteria.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.andConditionGroups = []; + object.andSequenceGroups = []; + } + if (message.andConditionGroups && message.andConditionGroups.length) { + object.andConditionGroups = []; + for (var j = 0; j < message.andConditionGroups.length; ++j) + object.andConditionGroups[j] = $root.google.analytics.data.v1alpha.UserSegmentConditionGroup.toObject(message.andConditionGroups[j], options); + } + if (message.andSequenceGroups && message.andSequenceGroups.length) { + object.andSequenceGroups = []; + for (var j = 0; j < message.andSequenceGroups.length; ++j) + object.andSequenceGroups[j] = $root.google.analytics.data.v1alpha.UserSegmentSequenceGroup.toObject(message.andSequenceGroups[j], options); + } + return object; + }; + + /** + * Converts this UserSegmentCriteria to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.UserSegmentCriteria + * @instance + * @returns {Object.} JSON object + */ + UserSegmentCriteria.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserSegmentCriteria + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.UserSegmentCriteria + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserSegmentCriteria.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.UserSegmentCriteria"; + }; + + return UserSegmentCriteria; + })(); + + /** + * UserCriteriaScoping enum. + * @name google.analytics.data.v1alpha.UserCriteriaScoping + * @enum {number} + * @property {number} USER_CRITERIA_SCOPING_UNSPECIFIED=0 USER_CRITERIA_SCOPING_UNSPECIFIED value + * @property {number} USER_CRITERIA_WITHIN_SAME_EVENT=1 USER_CRITERIA_WITHIN_SAME_EVENT value + * @property {number} USER_CRITERIA_WITHIN_SAME_SESSION=2 USER_CRITERIA_WITHIN_SAME_SESSION value + * @property {number} USER_CRITERIA_ACROSS_ALL_SESSIONS=3 USER_CRITERIA_ACROSS_ALL_SESSIONS value + */ + v1alpha.UserCriteriaScoping = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_CRITERIA_SCOPING_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_CRITERIA_WITHIN_SAME_EVENT"] = 1; + values[valuesById[2] = "USER_CRITERIA_WITHIN_SAME_SESSION"] = 2; + values[valuesById[3] = "USER_CRITERIA_ACROSS_ALL_SESSIONS"] = 3; + return values; + })(); + + v1alpha.UserSegmentConditionGroup = (function() { + + /** + * Properties of a UserSegmentConditionGroup. + * @memberof google.analytics.data.v1alpha + * @interface IUserSegmentConditionGroup + * @property {google.analytics.data.v1alpha.UserCriteriaScoping|null} [conditionScoping] UserSegmentConditionGroup conditionScoping + * @property {google.analytics.data.v1alpha.ISegmentFilterExpression|null} [segmentFilterExpression] UserSegmentConditionGroup segmentFilterExpression + */ + + /** + * Constructs a new UserSegmentConditionGroup. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a UserSegmentConditionGroup. + * @implements IUserSegmentConditionGroup + * @constructor + * @param {google.analytics.data.v1alpha.IUserSegmentConditionGroup=} [properties] Properties to set + */ + function UserSegmentConditionGroup(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]]; + } + + /** + * UserSegmentConditionGroup conditionScoping. + * @member {google.analytics.data.v1alpha.UserCriteriaScoping} conditionScoping + * @memberof google.analytics.data.v1alpha.UserSegmentConditionGroup + * @instance + */ + UserSegmentConditionGroup.prototype.conditionScoping = 0; + + /** + * UserSegmentConditionGroup segmentFilterExpression. + * @member {google.analytics.data.v1alpha.ISegmentFilterExpression|null|undefined} segmentFilterExpression + * @memberof google.analytics.data.v1alpha.UserSegmentConditionGroup + * @instance + */ + UserSegmentConditionGroup.prototype.segmentFilterExpression = null; + + /** + * Creates a new UserSegmentConditionGroup instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.UserSegmentConditionGroup + * @static + * @param {google.analytics.data.v1alpha.IUserSegmentConditionGroup=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.UserSegmentConditionGroup} UserSegmentConditionGroup instance + */ + UserSegmentConditionGroup.create = function create(properties) { + return new UserSegmentConditionGroup(properties); + }; + + /** + * Encodes the specified UserSegmentConditionGroup message. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentConditionGroup.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.UserSegmentConditionGroup + * @static + * @param {google.analytics.data.v1alpha.IUserSegmentConditionGroup} message UserSegmentConditionGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserSegmentConditionGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionScoping != null && Object.hasOwnProperty.call(message, "conditionScoping")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.conditionScoping); + if (message.segmentFilterExpression != null && Object.hasOwnProperty.call(message, "segmentFilterExpression")) + $root.google.analytics.data.v1alpha.SegmentFilterExpression.encode(message.segmentFilterExpression, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserSegmentConditionGroup message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentConditionGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.UserSegmentConditionGroup + * @static + * @param {google.analytics.data.v1alpha.IUserSegmentConditionGroup} message UserSegmentConditionGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserSegmentConditionGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserSegmentConditionGroup message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.UserSegmentConditionGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.UserSegmentConditionGroup} UserSegmentConditionGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserSegmentConditionGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.UserSegmentConditionGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.conditionScoping = reader.int32(); + break; + } + case 2: { + message.segmentFilterExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserSegmentConditionGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.UserSegmentConditionGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.UserSegmentConditionGroup} UserSegmentConditionGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserSegmentConditionGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserSegmentConditionGroup message. + * @function verify + * @memberof google.analytics.data.v1alpha.UserSegmentConditionGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserSegmentConditionGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditionScoping != null && message.hasOwnProperty("conditionScoping")) + switch (message.conditionScoping) { + default: + return "conditionScoping: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.segmentFilterExpression != null && message.hasOwnProperty("segmentFilterExpression")) { + var error = $root.google.analytics.data.v1alpha.SegmentFilterExpression.verify(message.segmentFilterExpression); + if (error) + return "segmentFilterExpression." + error; + } + return null; + }; + + /** + * Creates a UserSegmentConditionGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.UserSegmentConditionGroup + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.UserSegmentConditionGroup} UserSegmentConditionGroup + */ + UserSegmentConditionGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.UserSegmentConditionGroup) + return object; + var message = new $root.google.analytics.data.v1alpha.UserSegmentConditionGroup(); + switch (object.conditionScoping) { + default: + if (typeof object.conditionScoping === "number") { + message.conditionScoping = object.conditionScoping; + break; + } + break; + case "USER_CRITERIA_SCOPING_UNSPECIFIED": + case 0: + message.conditionScoping = 0; + break; + case "USER_CRITERIA_WITHIN_SAME_EVENT": + case 1: + message.conditionScoping = 1; + break; + case "USER_CRITERIA_WITHIN_SAME_SESSION": + case 2: + message.conditionScoping = 2; + break; + case "USER_CRITERIA_ACROSS_ALL_SESSIONS": + case 3: + message.conditionScoping = 3; + break; + } + if (object.segmentFilterExpression != null) { + if (typeof object.segmentFilterExpression !== "object") + throw TypeError(".google.analytics.data.v1alpha.UserSegmentConditionGroup.segmentFilterExpression: object expected"); + message.segmentFilterExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.fromObject(object.segmentFilterExpression); + } + return message; + }; + + /** + * Creates a plain object from a UserSegmentConditionGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.UserSegmentConditionGroup + * @static + * @param {google.analytics.data.v1alpha.UserSegmentConditionGroup} message UserSegmentConditionGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserSegmentConditionGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.conditionScoping = options.enums === String ? "USER_CRITERIA_SCOPING_UNSPECIFIED" : 0; + object.segmentFilterExpression = null; + } + if (message.conditionScoping != null && message.hasOwnProperty("conditionScoping")) + object.conditionScoping = options.enums === String ? $root.google.analytics.data.v1alpha.UserCriteriaScoping[message.conditionScoping] === undefined ? message.conditionScoping : $root.google.analytics.data.v1alpha.UserCriteriaScoping[message.conditionScoping] : message.conditionScoping; + if (message.segmentFilterExpression != null && message.hasOwnProperty("segmentFilterExpression")) + object.segmentFilterExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.toObject(message.segmentFilterExpression, options); + return object; + }; + + /** + * Converts this UserSegmentConditionGroup to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.UserSegmentConditionGroup + * @instance + * @returns {Object.} JSON object + */ + UserSegmentConditionGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserSegmentConditionGroup + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.UserSegmentConditionGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserSegmentConditionGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.UserSegmentConditionGroup"; + }; + + return UserSegmentConditionGroup; + })(); + + v1alpha.UserSegmentSequenceGroup = (function() { + + /** + * Properties of a UserSegmentSequenceGroup. + * @memberof google.analytics.data.v1alpha + * @interface IUserSegmentSequenceGroup + * @property {google.analytics.data.v1alpha.UserCriteriaScoping|null} [sequenceScoping] UserSegmentSequenceGroup sequenceScoping + * @property {google.protobuf.IDuration|null} [sequenceMaximumDuration] UserSegmentSequenceGroup sequenceMaximumDuration + * @property {Array.|null} [userSequenceSteps] UserSegmentSequenceGroup userSequenceSteps + */ + + /** + * Constructs a new UserSegmentSequenceGroup. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a UserSegmentSequenceGroup. + * @implements IUserSegmentSequenceGroup + * @constructor + * @param {google.analytics.data.v1alpha.IUserSegmentSequenceGroup=} [properties] Properties to set + */ + function UserSegmentSequenceGroup(properties) { + this.userSequenceSteps = []; + 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]]; + } + + /** + * UserSegmentSequenceGroup sequenceScoping. + * @member {google.analytics.data.v1alpha.UserCriteriaScoping} sequenceScoping + * @memberof google.analytics.data.v1alpha.UserSegmentSequenceGroup + * @instance + */ + UserSegmentSequenceGroup.prototype.sequenceScoping = 0; + + /** + * UserSegmentSequenceGroup sequenceMaximumDuration. + * @member {google.protobuf.IDuration|null|undefined} sequenceMaximumDuration + * @memberof google.analytics.data.v1alpha.UserSegmentSequenceGroup + * @instance + */ + UserSegmentSequenceGroup.prototype.sequenceMaximumDuration = null; + + /** + * UserSegmentSequenceGroup userSequenceSteps. + * @member {Array.} userSequenceSteps + * @memberof google.analytics.data.v1alpha.UserSegmentSequenceGroup + * @instance + */ + UserSegmentSequenceGroup.prototype.userSequenceSteps = $util.emptyArray; + + /** + * Creates a new UserSegmentSequenceGroup instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.UserSegmentSequenceGroup + * @static + * @param {google.analytics.data.v1alpha.IUserSegmentSequenceGroup=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.UserSegmentSequenceGroup} UserSegmentSequenceGroup instance + */ + UserSegmentSequenceGroup.create = function create(properties) { + return new UserSegmentSequenceGroup(properties); + }; + + /** + * Encodes the specified UserSegmentSequenceGroup message. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentSequenceGroup.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.UserSegmentSequenceGroup + * @static + * @param {google.analytics.data.v1alpha.IUserSegmentSequenceGroup} message UserSegmentSequenceGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserSegmentSequenceGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sequenceScoping != null && Object.hasOwnProperty.call(message, "sequenceScoping")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sequenceScoping); + if (message.sequenceMaximumDuration != null && Object.hasOwnProperty.call(message, "sequenceMaximumDuration")) + $root.google.protobuf.Duration.encode(message.sequenceMaximumDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.userSequenceSteps != null && message.userSequenceSteps.length) + for (var i = 0; i < message.userSequenceSteps.length; ++i) + $root.google.analytics.data.v1alpha.UserSequenceStep.encode(message.userSequenceSteps[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserSegmentSequenceGroup message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentSequenceGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.UserSegmentSequenceGroup + * @static + * @param {google.analytics.data.v1alpha.IUserSegmentSequenceGroup} message UserSegmentSequenceGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserSegmentSequenceGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserSegmentSequenceGroup message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.UserSegmentSequenceGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.UserSegmentSequenceGroup} UserSegmentSequenceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserSegmentSequenceGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.UserSegmentSequenceGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sequenceScoping = reader.int32(); + break; + } + case 2: { + message.sequenceMaximumDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.userSequenceSteps && message.userSequenceSteps.length)) + message.userSequenceSteps = []; + message.userSequenceSteps.push($root.google.analytics.data.v1alpha.UserSequenceStep.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserSegmentSequenceGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.UserSegmentSequenceGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.UserSegmentSequenceGroup} UserSegmentSequenceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserSegmentSequenceGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserSegmentSequenceGroup message. + * @function verify + * @memberof google.analytics.data.v1alpha.UserSegmentSequenceGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserSegmentSequenceGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sequenceScoping != null && message.hasOwnProperty("sequenceScoping")) + switch (message.sequenceScoping) { + default: + return "sequenceScoping: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sequenceMaximumDuration != null && message.hasOwnProperty("sequenceMaximumDuration")) { + var error = $root.google.protobuf.Duration.verify(message.sequenceMaximumDuration); + if (error) + return "sequenceMaximumDuration." + error; + } + if (message.userSequenceSteps != null && message.hasOwnProperty("userSequenceSteps")) { + if (!Array.isArray(message.userSequenceSteps)) + return "userSequenceSteps: array expected"; + for (var i = 0; i < message.userSequenceSteps.length; ++i) { + var error = $root.google.analytics.data.v1alpha.UserSequenceStep.verify(message.userSequenceSteps[i]); + if (error) + return "userSequenceSteps." + error; + } + } + return null; + }; + + /** + * Creates a UserSegmentSequenceGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.UserSegmentSequenceGroup + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.UserSegmentSequenceGroup} UserSegmentSequenceGroup + */ + UserSegmentSequenceGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.UserSegmentSequenceGroup) + return object; + var message = new $root.google.analytics.data.v1alpha.UserSegmentSequenceGroup(); + switch (object.sequenceScoping) { + default: + if (typeof object.sequenceScoping === "number") { + message.sequenceScoping = object.sequenceScoping; + break; + } + break; + case "USER_CRITERIA_SCOPING_UNSPECIFIED": + case 0: + message.sequenceScoping = 0; + break; + case "USER_CRITERIA_WITHIN_SAME_EVENT": + case 1: + message.sequenceScoping = 1; + break; + case "USER_CRITERIA_WITHIN_SAME_SESSION": + case 2: + message.sequenceScoping = 2; + break; + case "USER_CRITERIA_ACROSS_ALL_SESSIONS": + case 3: + message.sequenceScoping = 3; + break; + } + if (object.sequenceMaximumDuration != null) { + if (typeof object.sequenceMaximumDuration !== "object") + throw TypeError(".google.analytics.data.v1alpha.UserSegmentSequenceGroup.sequenceMaximumDuration: object expected"); + message.sequenceMaximumDuration = $root.google.protobuf.Duration.fromObject(object.sequenceMaximumDuration); + } + if (object.userSequenceSteps) { + if (!Array.isArray(object.userSequenceSteps)) + throw TypeError(".google.analytics.data.v1alpha.UserSegmentSequenceGroup.userSequenceSteps: array expected"); + message.userSequenceSteps = []; + for (var i = 0; i < object.userSequenceSteps.length; ++i) { + if (typeof object.userSequenceSteps[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.UserSegmentSequenceGroup.userSequenceSteps: object expected"); + message.userSequenceSteps[i] = $root.google.analytics.data.v1alpha.UserSequenceStep.fromObject(object.userSequenceSteps[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a UserSegmentSequenceGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.UserSegmentSequenceGroup + * @static + * @param {google.analytics.data.v1alpha.UserSegmentSequenceGroup} message UserSegmentSequenceGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserSegmentSequenceGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.userSequenceSteps = []; + if (options.defaults) { + object.sequenceScoping = options.enums === String ? "USER_CRITERIA_SCOPING_UNSPECIFIED" : 0; + object.sequenceMaximumDuration = null; + } + if (message.sequenceScoping != null && message.hasOwnProperty("sequenceScoping")) + object.sequenceScoping = options.enums === String ? $root.google.analytics.data.v1alpha.UserCriteriaScoping[message.sequenceScoping] === undefined ? message.sequenceScoping : $root.google.analytics.data.v1alpha.UserCriteriaScoping[message.sequenceScoping] : message.sequenceScoping; + if (message.sequenceMaximumDuration != null && message.hasOwnProperty("sequenceMaximumDuration")) + object.sequenceMaximumDuration = $root.google.protobuf.Duration.toObject(message.sequenceMaximumDuration, options); + if (message.userSequenceSteps && message.userSequenceSteps.length) { + object.userSequenceSteps = []; + for (var j = 0; j < message.userSequenceSteps.length; ++j) + object.userSequenceSteps[j] = $root.google.analytics.data.v1alpha.UserSequenceStep.toObject(message.userSequenceSteps[j], options); + } + return object; + }; + + /** + * Converts this UserSegmentSequenceGroup to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.UserSegmentSequenceGroup + * @instance + * @returns {Object.} JSON object + */ + UserSegmentSequenceGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserSegmentSequenceGroup + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.UserSegmentSequenceGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserSegmentSequenceGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.UserSegmentSequenceGroup"; + }; + + return UserSegmentSequenceGroup; + })(); + + v1alpha.UserSequenceStep = (function() { + + /** + * Properties of a UserSequenceStep. + * @memberof google.analytics.data.v1alpha + * @interface IUserSequenceStep + * @property {boolean|null} [isDirectlyFollowedBy] UserSequenceStep isDirectlyFollowedBy + * @property {google.analytics.data.v1alpha.UserCriteriaScoping|null} [stepScoping] UserSequenceStep stepScoping + * @property {google.analytics.data.v1alpha.ISegmentFilterExpression|null} [segmentFilterExpression] UserSequenceStep segmentFilterExpression + */ + + /** + * Constructs a new UserSequenceStep. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a UserSequenceStep. + * @implements IUserSequenceStep + * @constructor + * @param {google.analytics.data.v1alpha.IUserSequenceStep=} [properties] Properties to set + */ + function UserSequenceStep(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]]; + } + + /** + * UserSequenceStep isDirectlyFollowedBy. + * @member {boolean} isDirectlyFollowedBy + * @memberof google.analytics.data.v1alpha.UserSequenceStep + * @instance + */ + UserSequenceStep.prototype.isDirectlyFollowedBy = false; + + /** + * UserSequenceStep stepScoping. + * @member {google.analytics.data.v1alpha.UserCriteriaScoping} stepScoping + * @memberof google.analytics.data.v1alpha.UserSequenceStep + * @instance + */ + UserSequenceStep.prototype.stepScoping = 0; + + /** + * UserSequenceStep segmentFilterExpression. + * @member {google.analytics.data.v1alpha.ISegmentFilterExpression|null|undefined} segmentFilterExpression + * @memberof google.analytics.data.v1alpha.UserSequenceStep + * @instance + */ + UserSequenceStep.prototype.segmentFilterExpression = null; + + /** + * Creates a new UserSequenceStep instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.UserSequenceStep + * @static + * @param {google.analytics.data.v1alpha.IUserSequenceStep=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.UserSequenceStep} UserSequenceStep instance + */ + UserSequenceStep.create = function create(properties) { + return new UserSequenceStep(properties); + }; + + /** + * Encodes the specified UserSequenceStep message. Does not implicitly {@link google.analytics.data.v1alpha.UserSequenceStep.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.UserSequenceStep + * @static + * @param {google.analytics.data.v1alpha.IUserSequenceStep} message UserSequenceStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserSequenceStep.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.isDirectlyFollowedBy != null && Object.hasOwnProperty.call(message, "isDirectlyFollowedBy")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isDirectlyFollowedBy); + if (message.stepScoping != null && Object.hasOwnProperty.call(message, "stepScoping")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stepScoping); + if (message.segmentFilterExpression != null && Object.hasOwnProperty.call(message, "segmentFilterExpression")) + $root.google.analytics.data.v1alpha.SegmentFilterExpression.encode(message.segmentFilterExpression, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserSequenceStep message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.UserSequenceStep.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.UserSequenceStep + * @static + * @param {google.analytics.data.v1alpha.IUserSequenceStep} message UserSequenceStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserSequenceStep.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserSequenceStep message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.UserSequenceStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.UserSequenceStep} UserSequenceStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserSequenceStep.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.UserSequenceStep(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.isDirectlyFollowedBy = reader.bool(); + break; + } + case 2: { + message.stepScoping = reader.int32(); + break; + } + case 3: { + message.segmentFilterExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserSequenceStep message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.UserSequenceStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.UserSequenceStep} UserSequenceStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserSequenceStep.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserSequenceStep message. + * @function verify + * @memberof google.analytics.data.v1alpha.UserSequenceStep + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserSequenceStep.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.isDirectlyFollowedBy != null && message.hasOwnProperty("isDirectlyFollowedBy")) + if (typeof message.isDirectlyFollowedBy !== "boolean") + return "isDirectlyFollowedBy: boolean expected"; + if (message.stepScoping != null && message.hasOwnProperty("stepScoping")) + switch (message.stepScoping) { + default: + return "stepScoping: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.segmentFilterExpression != null && message.hasOwnProperty("segmentFilterExpression")) { + var error = $root.google.analytics.data.v1alpha.SegmentFilterExpression.verify(message.segmentFilterExpression); + if (error) + return "segmentFilterExpression." + error; + } + return null; + }; + + /** + * Creates a UserSequenceStep message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.UserSequenceStep + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.UserSequenceStep} UserSequenceStep + */ + UserSequenceStep.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.UserSequenceStep) + return object; + var message = new $root.google.analytics.data.v1alpha.UserSequenceStep(); + if (object.isDirectlyFollowedBy != null) + message.isDirectlyFollowedBy = Boolean(object.isDirectlyFollowedBy); + switch (object.stepScoping) { + default: + if (typeof object.stepScoping === "number") { + message.stepScoping = object.stepScoping; + break; + } + break; + case "USER_CRITERIA_SCOPING_UNSPECIFIED": + case 0: + message.stepScoping = 0; + break; + case "USER_CRITERIA_WITHIN_SAME_EVENT": + case 1: + message.stepScoping = 1; + break; + case "USER_CRITERIA_WITHIN_SAME_SESSION": + case 2: + message.stepScoping = 2; + break; + case "USER_CRITERIA_ACROSS_ALL_SESSIONS": + case 3: + message.stepScoping = 3; + break; + } + if (object.segmentFilterExpression != null) { + if (typeof object.segmentFilterExpression !== "object") + throw TypeError(".google.analytics.data.v1alpha.UserSequenceStep.segmentFilterExpression: object expected"); + message.segmentFilterExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.fromObject(object.segmentFilterExpression); + } + return message; + }; + + /** + * Creates a plain object from a UserSequenceStep message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.UserSequenceStep + * @static + * @param {google.analytics.data.v1alpha.UserSequenceStep} message UserSequenceStep + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserSequenceStep.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.isDirectlyFollowedBy = false; + object.stepScoping = options.enums === String ? "USER_CRITERIA_SCOPING_UNSPECIFIED" : 0; + object.segmentFilterExpression = null; + } + if (message.isDirectlyFollowedBy != null && message.hasOwnProperty("isDirectlyFollowedBy")) + object.isDirectlyFollowedBy = message.isDirectlyFollowedBy; + if (message.stepScoping != null && message.hasOwnProperty("stepScoping")) + object.stepScoping = options.enums === String ? $root.google.analytics.data.v1alpha.UserCriteriaScoping[message.stepScoping] === undefined ? message.stepScoping : $root.google.analytics.data.v1alpha.UserCriteriaScoping[message.stepScoping] : message.stepScoping; + if (message.segmentFilterExpression != null && message.hasOwnProperty("segmentFilterExpression")) + object.segmentFilterExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.toObject(message.segmentFilterExpression, options); + return object; + }; + + /** + * Converts this UserSequenceStep to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.UserSequenceStep + * @instance + * @returns {Object.} JSON object + */ + UserSequenceStep.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserSequenceStep + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.UserSequenceStep + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserSequenceStep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.UserSequenceStep"; + }; + + return UserSequenceStep; + })(); + + v1alpha.UserSegmentExclusion = (function() { + + /** + * Properties of a UserSegmentExclusion. + * @memberof google.analytics.data.v1alpha + * @interface IUserSegmentExclusion + * @property {google.analytics.data.v1alpha.UserExclusionDuration|null} [userExclusionDuration] UserSegmentExclusion userExclusionDuration + * @property {google.analytics.data.v1alpha.IUserSegmentCriteria|null} [userExclusionCriteria] UserSegmentExclusion userExclusionCriteria + */ + + /** + * Constructs a new UserSegmentExclusion. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a UserSegmentExclusion. + * @implements IUserSegmentExclusion + * @constructor + * @param {google.analytics.data.v1alpha.IUserSegmentExclusion=} [properties] Properties to set + */ + function UserSegmentExclusion(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]]; + } + + /** + * UserSegmentExclusion userExclusionDuration. + * @member {google.analytics.data.v1alpha.UserExclusionDuration} userExclusionDuration + * @memberof google.analytics.data.v1alpha.UserSegmentExclusion + * @instance + */ + UserSegmentExclusion.prototype.userExclusionDuration = 0; + + /** + * UserSegmentExclusion userExclusionCriteria. + * @member {google.analytics.data.v1alpha.IUserSegmentCriteria|null|undefined} userExclusionCriteria + * @memberof google.analytics.data.v1alpha.UserSegmentExclusion + * @instance + */ + UserSegmentExclusion.prototype.userExclusionCriteria = null; + + /** + * Creates a new UserSegmentExclusion instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.UserSegmentExclusion + * @static + * @param {google.analytics.data.v1alpha.IUserSegmentExclusion=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.UserSegmentExclusion} UserSegmentExclusion instance + */ + UserSegmentExclusion.create = function create(properties) { + return new UserSegmentExclusion(properties); + }; + + /** + * Encodes the specified UserSegmentExclusion message. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentExclusion.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.UserSegmentExclusion + * @static + * @param {google.analytics.data.v1alpha.IUserSegmentExclusion} message UserSegmentExclusion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserSegmentExclusion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userExclusionDuration != null && Object.hasOwnProperty.call(message, "userExclusionDuration")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.userExclusionDuration); + if (message.userExclusionCriteria != null && Object.hasOwnProperty.call(message, "userExclusionCriteria")) + $root.google.analytics.data.v1alpha.UserSegmentCriteria.encode(message.userExclusionCriteria, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserSegmentExclusion message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.UserSegmentExclusion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.UserSegmentExclusion + * @static + * @param {google.analytics.data.v1alpha.IUserSegmentExclusion} message UserSegmentExclusion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserSegmentExclusion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserSegmentExclusion message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.UserSegmentExclusion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.UserSegmentExclusion} UserSegmentExclusion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserSegmentExclusion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.UserSegmentExclusion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.userExclusionDuration = reader.int32(); + break; + } + case 2: { + message.userExclusionCriteria = $root.google.analytics.data.v1alpha.UserSegmentCriteria.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserSegmentExclusion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.UserSegmentExclusion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.UserSegmentExclusion} UserSegmentExclusion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserSegmentExclusion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserSegmentExclusion message. + * @function verify + * @memberof google.analytics.data.v1alpha.UserSegmentExclusion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserSegmentExclusion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userExclusionDuration != null && message.hasOwnProperty("userExclusionDuration")) + switch (message.userExclusionDuration) { + default: + return "userExclusionDuration: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.userExclusionCriteria != null && message.hasOwnProperty("userExclusionCriteria")) { + var error = $root.google.analytics.data.v1alpha.UserSegmentCriteria.verify(message.userExclusionCriteria); + if (error) + return "userExclusionCriteria." + error; + } + return null; + }; + + /** + * Creates a UserSegmentExclusion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.UserSegmentExclusion + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.UserSegmentExclusion} UserSegmentExclusion + */ + UserSegmentExclusion.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.UserSegmentExclusion) + return object; + var message = new $root.google.analytics.data.v1alpha.UserSegmentExclusion(); + switch (object.userExclusionDuration) { + default: + if (typeof object.userExclusionDuration === "number") { + message.userExclusionDuration = object.userExclusionDuration; + break; + } + break; + case "USER_EXCLUSION_DURATION_UNSPECIFIED": + case 0: + message.userExclusionDuration = 0; + break; + case "USER_EXCLUSION_TEMPORARY": + case 1: + message.userExclusionDuration = 1; + break; + case "USER_EXCLUSION_PERMANENT": + case 2: + message.userExclusionDuration = 2; + break; + } + if (object.userExclusionCriteria != null) { + if (typeof object.userExclusionCriteria !== "object") + throw TypeError(".google.analytics.data.v1alpha.UserSegmentExclusion.userExclusionCriteria: object expected"); + message.userExclusionCriteria = $root.google.analytics.data.v1alpha.UserSegmentCriteria.fromObject(object.userExclusionCriteria); + } + return message; + }; + + /** + * Creates a plain object from a UserSegmentExclusion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.UserSegmentExclusion + * @static + * @param {google.analytics.data.v1alpha.UserSegmentExclusion} message UserSegmentExclusion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserSegmentExclusion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.userExclusionDuration = options.enums === String ? "USER_EXCLUSION_DURATION_UNSPECIFIED" : 0; + object.userExclusionCriteria = null; + } + if (message.userExclusionDuration != null && message.hasOwnProperty("userExclusionDuration")) + object.userExclusionDuration = options.enums === String ? $root.google.analytics.data.v1alpha.UserExclusionDuration[message.userExclusionDuration] === undefined ? message.userExclusionDuration : $root.google.analytics.data.v1alpha.UserExclusionDuration[message.userExclusionDuration] : message.userExclusionDuration; + if (message.userExclusionCriteria != null && message.hasOwnProperty("userExclusionCriteria")) + object.userExclusionCriteria = $root.google.analytics.data.v1alpha.UserSegmentCriteria.toObject(message.userExclusionCriteria, options); + return object; + }; + + /** + * Converts this UserSegmentExclusion to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.UserSegmentExclusion + * @instance + * @returns {Object.} JSON object + */ + UserSegmentExclusion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserSegmentExclusion + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.UserSegmentExclusion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserSegmentExclusion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.UserSegmentExclusion"; + }; + + return UserSegmentExclusion; + })(); + + /** + * UserExclusionDuration enum. + * @name google.analytics.data.v1alpha.UserExclusionDuration + * @enum {number} + * @property {number} USER_EXCLUSION_DURATION_UNSPECIFIED=0 USER_EXCLUSION_DURATION_UNSPECIFIED value + * @property {number} USER_EXCLUSION_TEMPORARY=1 USER_EXCLUSION_TEMPORARY value + * @property {number} USER_EXCLUSION_PERMANENT=2 USER_EXCLUSION_PERMANENT value + */ + v1alpha.UserExclusionDuration = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_EXCLUSION_DURATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_EXCLUSION_TEMPORARY"] = 1; + values[valuesById[2] = "USER_EXCLUSION_PERMANENT"] = 2; + return values; + })(); + + v1alpha.SessionSegment = (function() { + + /** + * Properties of a SessionSegment. + * @memberof google.analytics.data.v1alpha + * @interface ISessionSegment + * @property {google.analytics.data.v1alpha.ISessionSegmentCriteria|null} [sessionInclusionCriteria] SessionSegment sessionInclusionCriteria + * @property {google.analytics.data.v1alpha.ISessionSegmentExclusion|null} [exclusion] SessionSegment exclusion + */ + + /** + * Constructs a new SessionSegment. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a SessionSegment. + * @implements ISessionSegment + * @constructor + * @param {google.analytics.data.v1alpha.ISessionSegment=} [properties] Properties to set + */ + function SessionSegment(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]]; + } + + /** + * SessionSegment sessionInclusionCriteria. + * @member {google.analytics.data.v1alpha.ISessionSegmentCriteria|null|undefined} sessionInclusionCriteria + * @memberof google.analytics.data.v1alpha.SessionSegment + * @instance + */ + SessionSegment.prototype.sessionInclusionCriteria = null; + + /** + * SessionSegment exclusion. + * @member {google.analytics.data.v1alpha.ISessionSegmentExclusion|null|undefined} exclusion + * @memberof google.analytics.data.v1alpha.SessionSegment + * @instance + */ + SessionSegment.prototype.exclusion = null; + + /** + * Creates a new SessionSegment instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.SessionSegment + * @static + * @param {google.analytics.data.v1alpha.ISessionSegment=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.SessionSegment} SessionSegment instance + */ + SessionSegment.create = function create(properties) { + return new SessionSegment(properties); + }; + + /** + * Encodes the specified SessionSegment message. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegment.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.SessionSegment + * @static + * @param {google.analytics.data.v1alpha.ISessionSegment} message SessionSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionInclusionCriteria != null && Object.hasOwnProperty.call(message, "sessionInclusionCriteria")) + $root.google.analytics.data.v1alpha.SessionSegmentCriteria.encode(message.sessionInclusionCriteria, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.exclusion != null && Object.hasOwnProperty.call(message, "exclusion")) + $root.google.analytics.data.v1alpha.SessionSegmentExclusion.encode(message.exclusion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionSegment message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.SessionSegment + * @static + * @param {google.analytics.data.v1alpha.ISessionSegment} message SessionSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionSegment message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.SessionSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.SessionSegment} SessionSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionSegment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.SessionSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sessionInclusionCriteria = $root.google.analytics.data.v1alpha.SessionSegmentCriteria.decode(reader, reader.uint32()); + break; + } + case 2: { + message.exclusion = $root.google.analytics.data.v1alpha.SessionSegmentExclusion.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.SessionSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.SessionSegment} SessionSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionSegment message. + * @function verify + * @memberof google.analytics.data.v1alpha.SessionSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sessionInclusionCriteria != null && message.hasOwnProperty("sessionInclusionCriteria")) { + var error = $root.google.analytics.data.v1alpha.SessionSegmentCriteria.verify(message.sessionInclusionCriteria); + if (error) + return "sessionInclusionCriteria." + error; + } + if (message.exclusion != null && message.hasOwnProperty("exclusion")) { + var error = $root.google.analytics.data.v1alpha.SessionSegmentExclusion.verify(message.exclusion); + if (error) + return "exclusion." + error; + } + return null; + }; + + /** + * Creates a SessionSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.SessionSegment + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.SessionSegment} SessionSegment + */ + SessionSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.SessionSegment) + return object; + var message = new $root.google.analytics.data.v1alpha.SessionSegment(); + if (object.sessionInclusionCriteria != null) { + if (typeof object.sessionInclusionCriteria !== "object") + throw TypeError(".google.analytics.data.v1alpha.SessionSegment.sessionInclusionCriteria: object expected"); + message.sessionInclusionCriteria = $root.google.analytics.data.v1alpha.SessionSegmentCriteria.fromObject(object.sessionInclusionCriteria); + } + if (object.exclusion != null) { + if (typeof object.exclusion !== "object") + throw TypeError(".google.analytics.data.v1alpha.SessionSegment.exclusion: object expected"); + message.exclusion = $root.google.analytics.data.v1alpha.SessionSegmentExclusion.fromObject(object.exclusion); + } + return message; + }; + + /** + * Creates a plain object from a SessionSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.SessionSegment + * @static + * @param {google.analytics.data.v1alpha.SessionSegment} message SessionSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sessionInclusionCriteria = null; + object.exclusion = null; + } + if (message.sessionInclusionCriteria != null && message.hasOwnProperty("sessionInclusionCriteria")) + object.sessionInclusionCriteria = $root.google.analytics.data.v1alpha.SessionSegmentCriteria.toObject(message.sessionInclusionCriteria, options); + if (message.exclusion != null && message.hasOwnProperty("exclusion")) + object.exclusion = $root.google.analytics.data.v1alpha.SessionSegmentExclusion.toObject(message.exclusion, options); + return object; + }; + + /** + * Converts this SessionSegment to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.SessionSegment + * @instance + * @returns {Object.} JSON object + */ + SessionSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionSegment + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.SessionSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.SessionSegment"; + }; + + return SessionSegment; + })(); + + v1alpha.SessionSegmentCriteria = (function() { + + /** + * Properties of a SessionSegmentCriteria. + * @memberof google.analytics.data.v1alpha + * @interface ISessionSegmentCriteria + * @property {Array.|null} [andConditionGroups] SessionSegmentCriteria andConditionGroups + */ + + /** + * Constructs a new SessionSegmentCriteria. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a SessionSegmentCriteria. + * @implements ISessionSegmentCriteria + * @constructor + * @param {google.analytics.data.v1alpha.ISessionSegmentCriteria=} [properties] Properties to set + */ + function SessionSegmentCriteria(properties) { + this.andConditionGroups = []; + 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]]; + } + + /** + * SessionSegmentCriteria andConditionGroups. + * @member {Array.} andConditionGroups + * @memberof google.analytics.data.v1alpha.SessionSegmentCriteria + * @instance + */ + SessionSegmentCriteria.prototype.andConditionGroups = $util.emptyArray; + + /** + * Creates a new SessionSegmentCriteria instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.SessionSegmentCriteria + * @static + * @param {google.analytics.data.v1alpha.ISessionSegmentCriteria=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.SessionSegmentCriteria} SessionSegmentCriteria instance + */ + SessionSegmentCriteria.create = function create(properties) { + return new SessionSegmentCriteria(properties); + }; + + /** + * Encodes the specified SessionSegmentCriteria message. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegmentCriteria.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.SessionSegmentCriteria + * @static + * @param {google.analytics.data.v1alpha.ISessionSegmentCriteria} message SessionSegmentCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionSegmentCriteria.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.andConditionGroups != null && message.andConditionGroups.length) + for (var i = 0; i < message.andConditionGroups.length; ++i) + $root.google.analytics.data.v1alpha.SessionSegmentConditionGroup.encode(message.andConditionGroups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionSegmentCriteria message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegmentCriteria.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.SessionSegmentCriteria + * @static + * @param {google.analytics.data.v1alpha.ISessionSegmentCriteria} message SessionSegmentCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionSegmentCriteria.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionSegmentCriteria message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.SessionSegmentCriteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.SessionSegmentCriteria} SessionSegmentCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionSegmentCriteria.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.SessionSegmentCriteria(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.andConditionGroups && message.andConditionGroups.length)) + message.andConditionGroups = []; + message.andConditionGroups.push($root.google.analytics.data.v1alpha.SessionSegmentConditionGroup.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionSegmentCriteria message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.SessionSegmentCriteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.SessionSegmentCriteria} SessionSegmentCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionSegmentCriteria.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionSegmentCriteria message. + * @function verify + * @memberof google.analytics.data.v1alpha.SessionSegmentCriteria + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionSegmentCriteria.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.andConditionGroups != null && message.hasOwnProperty("andConditionGroups")) { + if (!Array.isArray(message.andConditionGroups)) + return "andConditionGroups: array expected"; + for (var i = 0; i < message.andConditionGroups.length; ++i) { + var error = $root.google.analytics.data.v1alpha.SessionSegmentConditionGroup.verify(message.andConditionGroups[i]); + if (error) + return "andConditionGroups." + error; + } + } + return null; + }; + + /** + * Creates a SessionSegmentCriteria message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.SessionSegmentCriteria + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.SessionSegmentCriteria} SessionSegmentCriteria + */ + SessionSegmentCriteria.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.SessionSegmentCriteria) + return object; + var message = new $root.google.analytics.data.v1alpha.SessionSegmentCriteria(); + if (object.andConditionGroups) { + if (!Array.isArray(object.andConditionGroups)) + throw TypeError(".google.analytics.data.v1alpha.SessionSegmentCriteria.andConditionGroups: array expected"); + message.andConditionGroups = []; + for (var i = 0; i < object.andConditionGroups.length; ++i) { + if (typeof object.andConditionGroups[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.SessionSegmentCriteria.andConditionGroups: object expected"); + message.andConditionGroups[i] = $root.google.analytics.data.v1alpha.SessionSegmentConditionGroup.fromObject(object.andConditionGroups[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SessionSegmentCriteria message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.SessionSegmentCriteria + * @static + * @param {google.analytics.data.v1alpha.SessionSegmentCriteria} message SessionSegmentCriteria + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionSegmentCriteria.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.andConditionGroups = []; + if (message.andConditionGroups && message.andConditionGroups.length) { + object.andConditionGroups = []; + for (var j = 0; j < message.andConditionGroups.length; ++j) + object.andConditionGroups[j] = $root.google.analytics.data.v1alpha.SessionSegmentConditionGroup.toObject(message.andConditionGroups[j], options); + } + return object; + }; + + /** + * Converts this SessionSegmentCriteria to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.SessionSegmentCriteria + * @instance + * @returns {Object.} JSON object + */ + SessionSegmentCriteria.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionSegmentCriteria + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.SessionSegmentCriteria + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionSegmentCriteria.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.SessionSegmentCriteria"; + }; + + return SessionSegmentCriteria; + })(); + + /** + * SessionCriteriaScoping enum. + * @name google.analytics.data.v1alpha.SessionCriteriaScoping + * @enum {number} + * @property {number} SESSION_CRITERIA_SCOPING_UNSPECIFIED=0 SESSION_CRITERIA_SCOPING_UNSPECIFIED value + * @property {number} SESSION_CRITERIA_WITHIN_SAME_EVENT=1 SESSION_CRITERIA_WITHIN_SAME_EVENT value + * @property {number} SESSION_CRITERIA_WITHIN_SAME_SESSION=2 SESSION_CRITERIA_WITHIN_SAME_SESSION value + */ + v1alpha.SessionCriteriaScoping = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SESSION_CRITERIA_SCOPING_UNSPECIFIED"] = 0; + values[valuesById[1] = "SESSION_CRITERIA_WITHIN_SAME_EVENT"] = 1; + values[valuesById[2] = "SESSION_CRITERIA_WITHIN_SAME_SESSION"] = 2; + return values; + })(); + + v1alpha.SessionSegmentConditionGroup = (function() { + + /** + * Properties of a SessionSegmentConditionGroup. + * @memberof google.analytics.data.v1alpha + * @interface ISessionSegmentConditionGroup + * @property {google.analytics.data.v1alpha.SessionCriteriaScoping|null} [conditionScoping] SessionSegmentConditionGroup conditionScoping + * @property {google.analytics.data.v1alpha.ISegmentFilterExpression|null} [segmentFilterExpression] SessionSegmentConditionGroup segmentFilterExpression + */ + + /** + * Constructs a new SessionSegmentConditionGroup. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a SessionSegmentConditionGroup. + * @implements ISessionSegmentConditionGroup + * @constructor + * @param {google.analytics.data.v1alpha.ISessionSegmentConditionGroup=} [properties] Properties to set + */ + function SessionSegmentConditionGroup(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]]; + } + + /** + * SessionSegmentConditionGroup conditionScoping. + * @member {google.analytics.data.v1alpha.SessionCriteriaScoping} conditionScoping + * @memberof google.analytics.data.v1alpha.SessionSegmentConditionGroup + * @instance + */ + SessionSegmentConditionGroup.prototype.conditionScoping = 0; + + /** + * SessionSegmentConditionGroup segmentFilterExpression. + * @member {google.analytics.data.v1alpha.ISegmentFilterExpression|null|undefined} segmentFilterExpression + * @memberof google.analytics.data.v1alpha.SessionSegmentConditionGroup + * @instance + */ + SessionSegmentConditionGroup.prototype.segmentFilterExpression = null; + + /** + * Creates a new SessionSegmentConditionGroup instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.SessionSegmentConditionGroup + * @static + * @param {google.analytics.data.v1alpha.ISessionSegmentConditionGroup=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.SessionSegmentConditionGroup} SessionSegmentConditionGroup instance + */ + SessionSegmentConditionGroup.create = function create(properties) { + return new SessionSegmentConditionGroup(properties); + }; + + /** + * Encodes the specified SessionSegmentConditionGroup message. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegmentConditionGroup.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.SessionSegmentConditionGroup + * @static + * @param {google.analytics.data.v1alpha.ISessionSegmentConditionGroup} message SessionSegmentConditionGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionSegmentConditionGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionScoping != null && Object.hasOwnProperty.call(message, "conditionScoping")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.conditionScoping); + if (message.segmentFilterExpression != null && Object.hasOwnProperty.call(message, "segmentFilterExpression")) + $root.google.analytics.data.v1alpha.SegmentFilterExpression.encode(message.segmentFilterExpression, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionSegmentConditionGroup message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegmentConditionGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.SessionSegmentConditionGroup + * @static + * @param {google.analytics.data.v1alpha.ISessionSegmentConditionGroup} message SessionSegmentConditionGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionSegmentConditionGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionSegmentConditionGroup message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.SessionSegmentConditionGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.SessionSegmentConditionGroup} SessionSegmentConditionGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionSegmentConditionGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.SessionSegmentConditionGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.conditionScoping = reader.int32(); + break; + } + case 2: { + message.segmentFilterExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionSegmentConditionGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.SessionSegmentConditionGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.SessionSegmentConditionGroup} SessionSegmentConditionGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionSegmentConditionGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionSegmentConditionGroup message. + * @function verify + * @memberof google.analytics.data.v1alpha.SessionSegmentConditionGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionSegmentConditionGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditionScoping != null && message.hasOwnProperty("conditionScoping")) + switch (message.conditionScoping) { + default: + return "conditionScoping: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.segmentFilterExpression != null && message.hasOwnProperty("segmentFilterExpression")) { + var error = $root.google.analytics.data.v1alpha.SegmentFilterExpression.verify(message.segmentFilterExpression); + if (error) + return "segmentFilterExpression." + error; + } + return null; + }; + + /** + * Creates a SessionSegmentConditionGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.SessionSegmentConditionGroup + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.SessionSegmentConditionGroup} SessionSegmentConditionGroup + */ + SessionSegmentConditionGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.SessionSegmentConditionGroup) + return object; + var message = new $root.google.analytics.data.v1alpha.SessionSegmentConditionGroup(); + switch (object.conditionScoping) { + default: + if (typeof object.conditionScoping === "number") { + message.conditionScoping = object.conditionScoping; + break; + } + break; + case "SESSION_CRITERIA_SCOPING_UNSPECIFIED": + case 0: + message.conditionScoping = 0; + break; + case "SESSION_CRITERIA_WITHIN_SAME_EVENT": + case 1: + message.conditionScoping = 1; + break; + case "SESSION_CRITERIA_WITHIN_SAME_SESSION": + case 2: + message.conditionScoping = 2; + break; + } + if (object.segmentFilterExpression != null) { + if (typeof object.segmentFilterExpression !== "object") + throw TypeError(".google.analytics.data.v1alpha.SessionSegmentConditionGroup.segmentFilterExpression: object expected"); + message.segmentFilterExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.fromObject(object.segmentFilterExpression); + } + return message; + }; + + /** + * Creates a plain object from a SessionSegmentConditionGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.SessionSegmentConditionGroup + * @static + * @param {google.analytics.data.v1alpha.SessionSegmentConditionGroup} message SessionSegmentConditionGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionSegmentConditionGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.conditionScoping = options.enums === String ? "SESSION_CRITERIA_SCOPING_UNSPECIFIED" : 0; + object.segmentFilterExpression = null; + } + if (message.conditionScoping != null && message.hasOwnProperty("conditionScoping")) + object.conditionScoping = options.enums === String ? $root.google.analytics.data.v1alpha.SessionCriteriaScoping[message.conditionScoping] === undefined ? message.conditionScoping : $root.google.analytics.data.v1alpha.SessionCriteriaScoping[message.conditionScoping] : message.conditionScoping; + if (message.segmentFilterExpression != null && message.hasOwnProperty("segmentFilterExpression")) + object.segmentFilterExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.toObject(message.segmentFilterExpression, options); + return object; + }; + + /** + * Converts this SessionSegmentConditionGroup to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.SessionSegmentConditionGroup + * @instance + * @returns {Object.} JSON object + */ + SessionSegmentConditionGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionSegmentConditionGroup + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.SessionSegmentConditionGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionSegmentConditionGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.SessionSegmentConditionGroup"; + }; + + return SessionSegmentConditionGroup; + })(); + + v1alpha.SessionSegmentExclusion = (function() { + + /** + * Properties of a SessionSegmentExclusion. + * @memberof google.analytics.data.v1alpha + * @interface ISessionSegmentExclusion + * @property {google.analytics.data.v1alpha.SessionExclusionDuration|null} [sessionExclusionDuration] SessionSegmentExclusion sessionExclusionDuration + * @property {google.analytics.data.v1alpha.ISessionSegmentCriteria|null} [sessionExclusionCriteria] SessionSegmentExclusion sessionExclusionCriteria + */ + + /** + * Constructs a new SessionSegmentExclusion. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a SessionSegmentExclusion. + * @implements ISessionSegmentExclusion + * @constructor + * @param {google.analytics.data.v1alpha.ISessionSegmentExclusion=} [properties] Properties to set + */ + function SessionSegmentExclusion(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]]; + } + + /** + * SessionSegmentExclusion sessionExclusionDuration. + * @member {google.analytics.data.v1alpha.SessionExclusionDuration} sessionExclusionDuration + * @memberof google.analytics.data.v1alpha.SessionSegmentExclusion + * @instance + */ + SessionSegmentExclusion.prototype.sessionExclusionDuration = 0; + + /** + * SessionSegmentExclusion sessionExclusionCriteria. + * @member {google.analytics.data.v1alpha.ISessionSegmentCriteria|null|undefined} sessionExclusionCriteria + * @memberof google.analytics.data.v1alpha.SessionSegmentExclusion + * @instance + */ + SessionSegmentExclusion.prototype.sessionExclusionCriteria = null; + + /** + * Creates a new SessionSegmentExclusion instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.SessionSegmentExclusion + * @static + * @param {google.analytics.data.v1alpha.ISessionSegmentExclusion=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.SessionSegmentExclusion} SessionSegmentExclusion instance + */ + SessionSegmentExclusion.create = function create(properties) { + return new SessionSegmentExclusion(properties); + }; + + /** + * Encodes the specified SessionSegmentExclusion message. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegmentExclusion.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.SessionSegmentExclusion + * @static + * @param {google.analytics.data.v1alpha.ISessionSegmentExclusion} message SessionSegmentExclusion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionSegmentExclusion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionExclusionDuration != null && Object.hasOwnProperty.call(message, "sessionExclusionDuration")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sessionExclusionDuration); + if (message.sessionExclusionCriteria != null && Object.hasOwnProperty.call(message, "sessionExclusionCriteria")) + $root.google.analytics.data.v1alpha.SessionSegmentCriteria.encode(message.sessionExclusionCriteria, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionSegmentExclusion message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SessionSegmentExclusion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.SessionSegmentExclusion + * @static + * @param {google.analytics.data.v1alpha.ISessionSegmentExclusion} message SessionSegmentExclusion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionSegmentExclusion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionSegmentExclusion message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.SessionSegmentExclusion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.SessionSegmentExclusion} SessionSegmentExclusion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionSegmentExclusion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.SessionSegmentExclusion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sessionExclusionDuration = reader.int32(); + break; + } + case 2: { + message.sessionExclusionCriteria = $root.google.analytics.data.v1alpha.SessionSegmentCriteria.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionSegmentExclusion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.SessionSegmentExclusion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.SessionSegmentExclusion} SessionSegmentExclusion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionSegmentExclusion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionSegmentExclusion message. + * @function verify + * @memberof google.analytics.data.v1alpha.SessionSegmentExclusion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionSegmentExclusion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sessionExclusionDuration != null && message.hasOwnProperty("sessionExclusionDuration")) + switch (message.sessionExclusionDuration) { + default: + return "sessionExclusionDuration: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.sessionExclusionCriteria != null && message.hasOwnProperty("sessionExclusionCriteria")) { + var error = $root.google.analytics.data.v1alpha.SessionSegmentCriteria.verify(message.sessionExclusionCriteria); + if (error) + return "sessionExclusionCriteria." + error; + } + return null; + }; + + /** + * Creates a SessionSegmentExclusion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.SessionSegmentExclusion + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.SessionSegmentExclusion} SessionSegmentExclusion + */ + SessionSegmentExclusion.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.SessionSegmentExclusion) + return object; + var message = new $root.google.analytics.data.v1alpha.SessionSegmentExclusion(); + switch (object.sessionExclusionDuration) { + default: + if (typeof object.sessionExclusionDuration === "number") { + message.sessionExclusionDuration = object.sessionExclusionDuration; + break; + } + break; + case "SESSION_EXCLUSION_DURATION_UNSPECIFIED": + case 0: + message.sessionExclusionDuration = 0; + break; + case "SESSION_EXCLUSION_TEMPORARY": + case 1: + message.sessionExclusionDuration = 1; + break; + case "SESSION_EXCLUSION_PERMANENT": + case 2: + message.sessionExclusionDuration = 2; + break; + } + if (object.sessionExclusionCriteria != null) { + if (typeof object.sessionExclusionCriteria !== "object") + throw TypeError(".google.analytics.data.v1alpha.SessionSegmentExclusion.sessionExclusionCriteria: object expected"); + message.sessionExclusionCriteria = $root.google.analytics.data.v1alpha.SessionSegmentCriteria.fromObject(object.sessionExclusionCriteria); + } + return message; + }; + + /** + * Creates a plain object from a SessionSegmentExclusion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.SessionSegmentExclusion + * @static + * @param {google.analytics.data.v1alpha.SessionSegmentExclusion} message SessionSegmentExclusion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionSegmentExclusion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sessionExclusionDuration = options.enums === String ? "SESSION_EXCLUSION_DURATION_UNSPECIFIED" : 0; + object.sessionExclusionCriteria = null; + } + if (message.sessionExclusionDuration != null && message.hasOwnProperty("sessionExclusionDuration")) + object.sessionExclusionDuration = options.enums === String ? $root.google.analytics.data.v1alpha.SessionExclusionDuration[message.sessionExclusionDuration] === undefined ? message.sessionExclusionDuration : $root.google.analytics.data.v1alpha.SessionExclusionDuration[message.sessionExclusionDuration] : message.sessionExclusionDuration; + if (message.sessionExclusionCriteria != null && message.hasOwnProperty("sessionExclusionCriteria")) + object.sessionExclusionCriteria = $root.google.analytics.data.v1alpha.SessionSegmentCriteria.toObject(message.sessionExclusionCriteria, options); + return object; + }; + + /** + * Converts this SessionSegmentExclusion to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.SessionSegmentExclusion + * @instance + * @returns {Object.} JSON object + */ + SessionSegmentExclusion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionSegmentExclusion + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.SessionSegmentExclusion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionSegmentExclusion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.SessionSegmentExclusion"; + }; + + return SessionSegmentExclusion; + })(); + + /** + * SessionExclusionDuration enum. + * @name google.analytics.data.v1alpha.SessionExclusionDuration + * @enum {number} + * @property {number} SESSION_EXCLUSION_DURATION_UNSPECIFIED=0 SESSION_EXCLUSION_DURATION_UNSPECIFIED value + * @property {number} SESSION_EXCLUSION_TEMPORARY=1 SESSION_EXCLUSION_TEMPORARY value + * @property {number} SESSION_EXCLUSION_PERMANENT=2 SESSION_EXCLUSION_PERMANENT value + */ + v1alpha.SessionExclusionDuration = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SESSION_EXCLUSION_DURATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "SESSION_EXCLUSION_TEMPORARY"] = 1; + values[valuesById[2] = "SESSION_EXCLUSION_PERMANENT"] = 2; + return values; + })(); + + v1alpha.EventSegment = (function() { + + /** + * Properties of an EventSegment. + * @memberof google.analytics.data.v1alpha + * @interface IEventSegment + * @property {google.analytics.data.v1alpha.IEventSegmentCriteria|null} [eventInclusionCriteria] EventSegment eventInclusionCriteria + * @property {google.analytics.data.v1alpha.IEventSegmentExclusion|null} [exclusion] EventSegment exclusion + */ + + /** + * Constructs a new EventSegment. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents an EventSegment. + * @implements IEventSegment + * @constructor + * @param {google.analytics.data.v1alpha.IEventSegment=} [properties] Properties to set + */ + function EventSegment(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]]; + } + + /** + * EventSegment eventInclusionCriteria. + * @member {google.analytics.data.v1alpha.IEventSegmentCriteria|null|undefined} eventInclusionCriteria + * @memberof google.analytics.data.v1alpha.EventSegment + * @instance + */ + EventSegment.prototype.eventInclusionCriteria = null; + + /** + * EventSegment exclusion. + * @member {google.analytics.data.v1alpha.IEventSegmentExclusion|null|undefined} exclusion + * @memberof google.analytics.data.v1alpha.EventSegment + * @instance + */ + EventSegment.prototype.exclusion = null; + + /** + * Creates a new EventSegment instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.EventSegment + * @static + * @param {google.analytics.data.v1alpha.IEventSegment=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.EventSegment} EventSegment instance + */ + EventSegment.create = function create(properties) { + return new EventSegment(properties); + }; + + /** + * Encodes the specified EventSegment message. Does not implicitly {@link google.analytics.data.v1alpha.EventSegment.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.EventSegment + * @static + * @param {google.analytics.data.v1alpha.IEventSegment} message EventSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventInclusionCriteria != null && Object.hasOwnProperty.call(message, "eventInclusionCriteria")) + $root.google.analytics.data.v1alpha.EventSegmentCriteria.encode(message.eventInclusionCriteria, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.exclusion != null && Object.hasOwnProperty.call(message, "exclusion")) + $root.google.analytics.data.v1alpha.EventSegmentExclusion.encode(message.exclusion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EventSegment message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.EventSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.EventSegment + * @static + * @param {google.analytics.data.v1alpha.IEventSegment} message EventSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventSegment message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.EventSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.EventSegment} EventSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventSegment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.EventSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.eventInclusionCriteria = $root.google.analytics.data.v1alpha.EventSegmentCriteria.decode(reader, reader.uint32()); + break; + } + case 2: { + message.exclusion = $root.google.analytics.data.v1alpha.EventSegmentExclusion.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EventSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.EventSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.EventSegment} EventSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventSegment message. + * @function verify + * @memberof google.analytics.data.v1alpha.EventSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.eventInclusionCriteria != null && message.hasOwnProperty("eventInclusionCriteria")) { + var error = $root.google.analytics.data.v1alpha.EventSegmentCriteria.verify(message.eventInclusionCriteria); + if (error) + return "eventInclusionCriteria." + error; + } + if (message.exclusion != null && message.hasOwnProperty("exclusion")) { + var error = $root.google.analytics.data.v1alpha.EventSegmentExclusion.verify(message.exclusion); + if (error) + return "exclusion." + error; + } + return null; + }; + + /** + * Creates an EventSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.EventSegment + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.EventSegment} EventSegment + */ + EventSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.EventSegment) + return object; + var message = new $root.google.analytics.data.v1alpha.EventSegment(); + if (object.eventInclusionCriteria != null) { + if (typeof object.eventInclusionCriteria !== "object") + throw TypeError(".google.analytics.data.v1alpha.EventSegment.eventInclusionCriteria: object expected"); + message.eventInclusionCriteria = $root.google.analytics.data.v1alpha.EventSegmentCriteria.fromObject(object.eventInclusionCriteria); + } + if (object.exclusion != null) { + if (typeof object.exclusion !== "object") + throw TypeError(".google.analytics.data.v1alpha.EventSegment.exclusion: object expected"); + message.exclusion = $root.google.analytics.data.v1alpha.EventSegmentExclusion.fromObject(object.exclusion); + } + return message; + }; + + /** + * Creates a plain object from an EventSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.EventSegment + * @static + * @param {google.analytics.data.v1alpha.EventSegment} message EventSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.eventInclusionCriteria = null; + object.exclusion = null; + } + if (message.eventInclusionCriteria != null && message.hasOwnProperty("eventInclusionCriteria")) + object.eventInclusionCriteria = $root.google.analytics.data.v1alpha.EventSegmentCriteria.toObject(message.eventInclusionCriteria, options); + if (message.exclusion != null && message.hasOwnProperty("exclusion")) + object.exclusion = $root.google.analytics.data.v1alpha.EventSegmentExclusion.toObject(message.exclusion, options); + return object; + }; + + /** + * Converts this EventSegment to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.EventSegment + * @instance + * @returns {Object.} JSON object + */ + EventSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventSegment + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.EventSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.EventSegment"; + }; + + return EventSegment; + })(); + + v1alpha.EventSegmentCriteria = (function() { + + /** + * Properties of an EventSegmentCriteria. + * @memberof google.analytics.data.v1alpha + * @interface IEventSegmentCriteria + * @property {Array.|null} [andConditionGroups] EventSegmentCriteria andConditionGroups + */ + + /** + * Constructs a new EventSegmentCriteria. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents an EventSegmentCriteria. + * @implements IEventSegmentCriteria + * @constructor + * @param {google.analytics.data.v1alpha.IEventSegmentCriteria=} [properties] Properties to set + */ + function EventSegmentCriteria(properties) { + this.andConditionGroups = []; + 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]]; + } + + /** + * EventSegmentCriteria andConditionGroups. + * @member {Array.} andConditionGroups + * @memberof google.analytics.data.v1alpha.EventSegmentCriteria + * @instance + */ + EventSegmentCriteria.prototype.andConditionGroups = $util.emptyArray; + + /** + * Creates a new EventSegmentCriteria instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.EventSegmentCriteria + * @static + * @param {google.analytics.data.v1alpha.IEventSegmentCriteria=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.EventSegmentCriteria} EventSegmentCriteria instance + */ + EventSegmentCriteria.create = function create(properties) { + return new EventSegmentCriteria(properties); + }; + + /** + * Encodes the specified EventSegmentCriteria message. Does not implicitly {@link google.analytics.data.v1alpha.EventSegmentCriteria.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.EventSegmentCriteria + * @static + * @param {google.analytics.data.v1alpha.IEventSegmentCriteria} message EventSegmentCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventSegmentCriteria.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.andConditionGroups != null && message.andConditionGroups.length) + for (var i = 0; i < message.andConditionGroups.length; ++i) + $root.google.analytics.data.v1alpha.EventSegmentConditionGroup.encode(message.andConditionGroups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EventSegmentCriteria message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.EventSegmentCriteria.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.EventSegmentCriteria + * @static + * @param {google.analytics.data.v1alpha.IEventSegmentCriteria} message EventSegmentCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventSegmentCriteria.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventSegmentCriteria message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.EventSegmentCriteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.EventSegmentCriteria} EventSegmentCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventSegmentCriteria.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.EventSegmentCriteria(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.andConditionGroups && message.andConditionGroups.length)) + message.andConditionGroups = []; + message.andConditionGroups.push($root.google.analytics.data.v1alpha.EventSegmentConditionGroup.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EventSegmentCriteria message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.EventSegmentCriteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.EventSegmentCriteria} EventSegmentCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventSegmentCriteria.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventSegmentCriteria message. + * @function verify + * @memberof google.analytics.data.v1alpha.EventSegmentCriteria + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventSegmentCriteria.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.andConditionGroups != null && message.hasOwnProperty("andConditionGroups")) { + if (!Array.isArray(message.andConditionGroups)) + return "andConditionGroups: array expected"; + for (var i = 0; i < message.andConditionGroups.length; ++i) { + var error = $root.google.analytics.data.v1alpha.EventSegmentConditionGroup.verify(message.andConditionGroups[i]); + if (error) + return "andConditionGroups." + error; + } + } + return null; + }; + + /** + * Creates an EventSegmentCriteria message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.EventSegmentCriteria + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.EventSegmentCriteria} EventSegmentCriteria + */ + EventSegmentCriteria.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.EventSegmentCriteria) + return object; + var message = new $root.google.analytics.data.v1alpha.EventSegmentCriteria(); + if (object.andConditionGroups) { + if (!Array.isArray(object.andConditionGroups)) + throw TypeError(".google.analytics.data.v1alpha.EventSegmentCriteria.andConditionGroups: array expected"); + message.andConditionGroups = []; + for (var i = 0; i < object.andConditionGroups.length; ++i) { + if (typeof object.andConditionGroups[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.EventSegmentCriteria.andConditionGroups: object expected"); + message.andConditionGroups[i] = $root.google.analytics.data.v1alpha.EventSegmentConditionGroup.fromObject(object.andConditionGroups[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EventSegmentCriteria message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.EventSegmentCriteria + * @static + * @param {google.analytics.data.v1alpha.EventSegmentCriteria} message EventSegmentCriteria + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventSegmentCriteria.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.andConditionGroups = []; + if (message.andConditionGroups && message.andConditionGroups.length) { + object.andConditionGroups = []; + for (var j = 0; j < message.andConditionGroups.length; ++j) + object.andConditionGroups[j] = $root.google.analytics.data.v1alpha.EventSegmentConditionGroup.toObject(message.andConditionGroups[j], options); + } + return object; + }; + + /** + * Converts this EventSegmentCriteria to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.EventSegmentCriteria + * @instance + * @returns {Object.} JSON object + */ + EventSegmentCriteria.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventSegmentCriteria + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.EventSegmentCriteria + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventSegmentCriteria.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.EventSegmentCriteria"; + }; + + return EventSegmentCriteria; + })(); + + /** + * EventCriteriaScoping enum. + * @name google.analytics.data.v1alpha.EventCriteriaScoping + * @enum {number} + * @property {number} EVENT_CRITERIA_SCOPING_UNSPECIFIED=0 EVENT_CRITERIA_SCOPING_UNSPECIFIED value + * @property {number} EVENT_CRITERIA_WITHIN_SAME_EVENT=1 EVENT_CRITERIA_WITHIN_SAME_EVENT value + */ + v1alpha.EventCriteriaScoping = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVENT_CRITERIA_SCOPING_UNSPECIFIED"] = 0; + values[valuesById[1] = "EVENT_CRITERIA_WITHIN_SAME_EVENT"] = 1; + return values; + })(); + + v1alpha.EventSegmentConditionGroup = (function() { + + /** + * Properties of an EventSegmentConditionGroup. + * @memberof google.analytics.data.v1alpha + * @interface IEventSegmentConditionGroup + * @property {google.analytics.data.v1alpha.EventCriteriaScoping|null} [conditionScoping] EventSegmentConditionGroup conditionScoping + * @property {google.analytics.data.v1alpha.ISegmentFilterExpression|null} [segmentFilterExpression] EventSegmentConditionGroup segmentFilterExpression + */ + + /** + * Constructs a new EventSegmentConditionGroup. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents an EventSegmentConditionGroup. + * @implements IEventSegmentConditionGroup + * @constructor + * @param {google.analytics.data.v1alpha.IEventSegmentConditionGroup=} [properties] Properties to set + */ + function EventSegmentConditionGroup(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]]; + } + + /** + * EventSegmentConditionGroup conditionScoping. + * @member {google.analytics.data.v1alpha.EventCriteriaScoping} conditionScoping + * @memberof google.analytics.data.v1alpha.EventSegmentConditionGroup + * @instance + */ + EventSegmentConditionGroup.prototype.conditionScoping = 0; + + /** + * EventSegmentConditionGroup segmentFilterExpression. + * @member {google.analytics.data.v1alpha.ISegmentFilterExpression|null|undefined} segmentFilterExpression + * @memberof google.analytics.data.v1alpha.EventSegmentConditionGroup + * @instance + */ + EventSegmentConditionGroup.prototype.segmentFilterExpression = null; + + /** + * Creates a new EventSegmentConditionGroup instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.EventSegmentConditionGroup + * @static + * @param {google.analytics.data.v1alpha.IEventSegmentConditionGroup=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.EventSegmentConditionGroup} EventSegmentConditionGroup instance + */ + EventSegmentConditionGroup.create = function create(properties) { + return new EventSegmentConditionGroup(properties); + }; + + /** + * Encodes the specified EventSegmentConditionGroup message. Does not implicitly {@link google.analytics.data.v1alpha.EventSegmentConditionGroup.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.EventSegmentConditionGroup + * @static + * @param {google.analytics.data.v1alpha.IEventSegmentConditionGroup} message EventSegmentConditionGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventSegmentConditionGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionScoping != null && Object.hasOwnProperty.call(message, "conditionScoping")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.conditionScoping); + if (message.segmentFilterExpression != null && Object.hasOwnProperty.call(message, "segmentFilterExpression")) + $root.google.analytics.data.v1alpha.SegmentFilterExpression.encode(message.segmentFilterExpression, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EventSegmentConditionGroup message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.EventSegmentConditionGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.EventSegmentConditionGroup + * @static + * @param {google.analytics.data.v1alpha.IEventSegmentConditionGroup} message EventSegmentConditionGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventSegmentConditionGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventSegmentConditionGroup message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.EventSegmentConditionGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.EventSegmentConditionGroup} EventSegmentConditionGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventSegmentConditionGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.EventSegmentConditionGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.conditionScoping = reader.int32(); + break; + } + case 2: { + message.segmentFilterExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EventSegmentConditionGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.EventSegmentConditionGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.EventSegmentConditionGroup} EventSegmentConditionGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventSegmentConditionGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventSegmentConditionGroup message. + * @function verify + * @memberof google.analytics.data.v1alpha.EventSegmentConditionGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventSegmentConditionGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditionScoping != null && message.hasOwnProperty("conditionScoping")) + switch (message.conditionScoping) { + default: + return "conditionScoping: enum value expected"; + case 0: + case 1: + break; + } + if (message.segmentFilterExpression != null && message.hasOwnProperty("segmentFilterExpression")) { + var error = $root.google.analytics.data.v1alpha.SegmentFilterExpression.verify(message.segmentFilterExpression); + if (error) + return "segmentFilterExpression." + error; + } + return null; + }; + + /** + * Creates an EventSegmentConditionGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.EventSegmentConditionGroup + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.EventSegmentConditionGroup} EventSegmentConditionGroup + */ + EventSegmentConditionGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.EventSegmentConditionGroup) + return object; + var message = new $root.google.analytics.data.v1alpha.EventSegmentConditionGroup(); + switch (object.conditionScoping) { + default: + if (typeof object.conditionScoping === "number") { + message.conditionScoping = object.conditionScoping; + break; + } + break; + case "EVENT_CRITERIA_SCOPING_UNSPECIFIED": + case 0: + message.conditionScoping = 0; + break; + case "EVENT_CRITERIA_WITHIN_SAME_EVENT": + case 1: + message.conditionScoping = 1; + break; + } + if (object.segmentFilterExpression != null) { + if (typeof object.segmentFilterExpression !== "object") + throw TypeError(".google.analytics.data.v1alpha.EventSegmentConditionGroup.segmentFilterExpression: object expected"); + message.segmentFilterExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.fromObject(object.segmentFilterExpression); + } + return message; + }; + + /** + * Creates a plain object from an EventSegmentConditionGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.EventSegmentConditionGroup + * @static + * @param {google.analytics.data.v1alpha.EventSegmentConditionGroup} message EventSegmentConditionGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventSegmentConditionGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.conditionScoping = options.enums === String ? "EVENT_CRITERIA_SCOPING_UNSPECIFIED" : 0; + object.segmentFilterExpression = null; + } + if (message.conditionScoping != null && message.hasOwnProperty("conditionScoping")) + object.conditionScoping = options.enums === String ? $root.google.analytics.data.v1alpha.EventCriteriaScoping[message.conditionScoping] === undefined ? message.conditionScoping : $root.google.analytics.data.v1alpha.EventCriteriaScoping[message.conditionScoping] : message.conditionScoping; + if (message.segmentFilterExpression != null && message.hasOwnProperty("segmentFilterExpression")) + object.segmentFilterExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.toObject(message.segmentFilterExpression, options); + return object; + }; + + /** + * Converts this EventSegmentConditionGroup to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.EventSegmentConditionGroup + * @instance + * @returns {Object.} JSON object + */ + EventSegmentConditionGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventSegmentConditionGroup + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.EventSegmentConditionGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventSegmentConditionGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.EventSegmentConditionGroup"; + }; + + return EventSegmentConditionGroup; + })(); + + v1alpha.EventSegmentExclusion = (function() { + + /** + * Properties of an EventSegmentExclusion. + * @memberof google.analytics.data.v1alpha + * @interface IEventSegmentExclusion + * @property {google.analytics.data.v1alpha.EventExclusionDuration|null} [eventExclusionDuration] EventSegmentExclusion eventExclusionDuration + * @property {google.analytics.data.v1alpha.IEventSegmentCriteria|null} [eventExclusionCriteria] EventSegmentExclusion eventExclusionCriteria + */ + + /** + * Constructs a new EventSegmentExclusion. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents an EventSegmentExclusion. + * @implements IEventSegmentExclusion + * @constructor + * @param {google.analytics.data.v1alpha.IEventSegmentExclusion=} [properties] Properties to set + */ + function EventSegmentExclusion(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]]; + } + + /** + * EventSegmentExclusion eventExclusionDuration. + * @member {google.analytics.data.v1alpha.EventExclusionDuration} eventExclusionDuration + * @memberof google.analytics.data.v1alpha.EventSegmentExclusion + * @instance + */ + EventSegmentExclusion.prototype.eventExclusionDuration = 0; + + /** + * EventSegmentExclusion eventExclusionCriteria. + * @member {google.analytics.data.v1alpha.IEventSegmentCriteria|null|undefined} eventExclusionCriteria + * @memberof google.analytics.data.v1alpha.EventSegmentExclusion + * @instance + */ + EventSegmentExclusion.prototype.eventExclusionCriteria = null; + + /** + * Creates a new EventSegmentExclusion instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.EventSegmentExclusion + * @static + * @param {google.analytics.data.v1alpha.IEventSegmentExclusion=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.EventSegmentExclusion} EventSegmentExclusion instance + */ + EventSegmentExclusion.create = function create(properties) { + return new EventSegmentExclusion(properties); + }; + + /** + * Encodes the specified EventSegmentExclusion message. Does not implicitly {@link google.analytics.data.v1alpha.EventSegmentExclusion.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.EventSegmentExclusion + * @static + * @param {google.analytics.data.v1alpha.IEventSegmentExclusion} message EventSegmentExclusion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventSegmentExclusion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventExclusionDuration != null && Object.hasOwnProperty.call(message, "eventExclusionDuration")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.eventExclusionDuration); + if (message.eventExclusionCriteria != null && Object.hasOwnProperty.call(message, "eventExclusionCriteria")) + $root.google.analytics.data.v1alpha.EventSegmentCriteria.encode(message.eventExclusionCriteria, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EventSegmentExclusion message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.EventSegmentExclusion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.EventSegmentExclusion + * @static + * @param {google.analytics.data.v1alpha.IEventSegmentExclusion} message EventSegmentExclusion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventSegmentExclusion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventSegmentExclusion message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.EventSegmentExclusion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.EventSegmentExclusion} EventSegmentExclusion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventSegmentExclusion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.EventSegmentExclusion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.eventExclusionDuration = reader.int32(); + break; + } + case 2: { + message.eventExclusionCriteria = $root.google.analytics.data.v1alpha.EventSegmentCriteria.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EventSegmentExclusion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.EventSegmentExclusion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.EventSegmentExclusion} EventSegmentExclusion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventSegmentExclusion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventSegmentExclusion message. + * @function verify + * @memberof google.analytics.data.v1alpha.EventSegmentExclusion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventSegmentExclusion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.eventExclusionDuration != null && message.hasOwnProperty("eventExclusionDuration")) + switch (message.eventExclusionDuration) { + default: + return "eventExclusionDuration: enum value expected"; + case 0: + case 1: + break; + } + if (message.eventExclusionCriteria != null && message.hasOwnProperty("eventExclusionCriteria")) { + var error = $root.google.analytics.data.v1alpha.EventSegmentCriteria.verify(message.eventExclusionCriteria); + if (error) + return "eventExclusionCriteria." + error; + } + return null; + }; + + /** + * Creates an EventSegmentExclusion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.EventSegmentExclusion + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.EventSegmentExclusion} EventSegmentExclusion + */ + EventSegmentExclusion.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.EventSegmentExclusion) + return object; + var message = new $root.google.analytics.data.v1alpha.EventSegmentExclusion(); + switch (object.eventExclusionDuration) { + default: + if (typeof object.eventExclusionDuration === "number") { + message.eventExclusionDuration = object.eventExclusionDuration; + break; + } + break; + case "EVENT_EXCLUSION_DURATION_UNSPECIFIED": + case 0: + message.eventExclusionDuration = 0; + break; + case "EVENT_EXCLUSION_PERMANENT": + case 1: + message.eventExclusionDuration = 1; + break; + } + if (object.eventExclusionCriteria != null) { + if (typeof object.eventExclusionCriteria !== "object") + throw TypeError(".google.analytics.data.v1alpha.EventSegmentExclusion.eventExclusionCriteria: object expected"); + message.eventExclusionCriteria = $root.google.analytics.data.v1alpha.EventSegmentCriteria.fromObject(object.eventExclusionCriteria); + } + return message; + }; + + /** + * Creates a plain object from an EventSegmentExclusion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.EventSegmentExclusion + * @static + * @param {google.analytics.data.v1alpha.EventSegmentExclusion} message EventSegmentExclusion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventSegmentExclusion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.eventExclusionDuration = options.enums === String ? "EVENT_EXCLUSION_DURATION_UNSPECIFIED" : 0; + object.eventExclusionCriteria = null; + } + if (message.eventExclusionDuration != null && message.hasOwnProperty("eventExclusionDuration")) + object.eventExclusionDuration = options.enums === String ? $root.google.analytics.data.v1alpha.EventExclusionDuration[message.eventExclusionDuration] === undefined ? message.eventExclusionDuration : $root.google.analytics.data.v1alpha.EventExclusionDuration[message.eventExclusionDuration] : message.eventExclusionDuration; + if (message.eventExclusionCriteria != null && message.hasOwnProperty("eventExclusionCriteria")) + object.eventExclusionCriteria = $root.google.analytics.data.v1alpha.EventSegmentCriteria.toObject(message.eventExclusionCriteria, options); + return object; + }; + + /** + * Converts this EventSegmentExclusion to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.EventSegmentExclusion + * @instance + * @returns {Object.} JSON object + */ + EventSegmentExclusion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventSegmentExclusion + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.EventSegmentExclusion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventSegmentExclusion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.EventSegmentExclusion"; + }; + + return EventSegmentExclusion; + })(); + + /** + * EventExclusionDuration enum. + * @name google.analytics.data.v1alpha.EventExclusionDuration + * @enum {number} + * @property {number} EVENT_EXCLUSION_DURATION_UNSPECIFIED=0 EVENT_EXCLUSION_DURATION_UNSPECIFIED value + * @property {number} EVENT_EXCLUSION_PERMANENT=1 EVENT_EXCLUSION_PERMANENT value + */ + v1alpha.EventExclusionDuration = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVENT_EXCLUSION_DURATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "EVENT_EXCLUSION_PERMANENT"] = 1; + return values; + })(); + + v1alpha.Segment = (function() { + + /** + * Properties of a Segment. + * @memberof google.analytics.data.v1alpha + * @interface ISegment + * @property {string|null} [name] Segment name + * @property {google.analytics.data.v1alpha.IUserSegment|null} [userSegment] Segment userSegment + * @property {google.analytics.data.v1alpha.ISessionSegment|null} [sessionSegment] Segment sessionSegment + * @property {google.analytics.data.v1alpha.IEventSegment|null} [eventSegment] Segment eventSegment + */ + + /** + * Constructs a new Segment. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a Segment. + * @implements ISegment + * @constructor + * @param {google.analytics.data.v1alpha.ISegment=} [properties] Properties to set + */ + function Segment(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]]; + } + + /** + * Segment name. + * @member {string} name + * @memberof google.analytics.data.v1alpha.Segment + * @instance + */ + Segment.prototype.name = ""; + + /** + * Segment userSegment. + * @member {google.analytics.data.v1alpha.IUserSegment|null|undefined} userSegment + * @memberof google.analytics.data.v1alpha.Segment + * @instance + */ + Segment.prototype.userSegment = null; + + /** + * Segment sessionSegment. + * @member {google.analytics.data.v1alpha.ISessionSegment|null|undefined} sessionSegment + * @memberof google.analytics.data.v1alpha.Segment + * @instance + */ + Segment.prototype.sessionSegment = null; + + /** + * Segment eventSegment. + * @member {google.analytics.data.v1alpha.IEventSegment|null|undefined} eventSegment + * @memberof google.analytics.data.v1alpha.Segment + * @instance + */ + Segment.prototype.eventSegment = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Segment oneSegmentScope. + * @member {"userSegment"|"sessionSegment"|"eventSegment"|undefined} oneSegmentScope + * @memberof google.analytics.data.v1alpha.Segment + * @instance + */ + Object.defineProperty(Segment.prototype, "oneSegmentScope", { + get: $util.oneOfGetter($oneOfFields = ["userSegment", "sessionSegment", "eventSegment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Segment instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.Segment + * @static + * @param {google.analytics.data.v1alpha.ISegment=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.Segment} Segment instance + */ + Segment.create = function create(properties) { + return new Segment(properties); + }; + + /** + * Encodes the specified Segment message. Does not implicitly {@link google.analytics.data.v1alpha.Segment.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.Segment + * @static + * @param {google.analytics.data.v1alpha.ISegment} message Segment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Segment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.userSegment != null && Object.hasOwnProperty.call(message, "userSegment")) + $root.google.analytics.data.v1alpha.UserSegment.encode(message.userSegment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sessionSegment != null && Object.hasOwnProperty.call(message, "sessionSegment")) + $root.google.analytics.data.v1alpha.SessionSegment.encode(message.sessionSegment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.eventSegment != null && Object.hasOwnProperty.call(message, "eventSegment")) + $root.google.analytics.data.v1alpha.EventSegment.encode(message.eventSegment, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Segment message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.Segment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.Segment + * @static + * @param {google.analytics.data.v1alpha.ISegment} message Segment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Segment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Segment message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.Segment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.Segment} Segment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Segment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.Segment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.userSegment = $root.google.analytics.data.v1alpha.UserSegment.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sessionSegment = $root.google.analytics.data.v1alpha.SessionSegment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.eventSegment = $root.google.analytics.data.v1alpha.EventSegment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Segment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.Segment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.Segment} Segment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Segment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Segment message. + * @function verify + * @memberof google.analytics.data.v1alpha.Segment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Segment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.userSegment != null && message.hasOwnProperty("userSegment")) { + properties.oneSegmentScope = 1; + { + var error = $root.google.analytics.data.v1alpha.UserSegment.verify(message.userSegment); + if (error) + return "userSegment." + error; + } + } + if (message.sessionSegment != null && message.hasOwnProperty("sessionSegment")) { + if (properties.oneSegmentScope === 1) + return "oneSegmentScope: multiple values"; + properties.oneSegmentScope = 1; + { + var error = $root.google.analytics.data.v1alpha.SessionSegment.verify(message.sessionSegment); + if (error) + return "sessionSegment." + error; + } + } + if (message.eventSegment != null && message.hasOwnProperty("eventSegment")) { + if (properties.oneSegmentScope === 1) + return "oneSegmentScope: multiple values"; + properties.oneSegmentScope = 1; + { + var error = $root.google.analytics.data.v1alpha.EventSegment.verify(message.eventSegment); + if (error) + return "eventSegment." + error; + } + } + return null; + }; + + /** + * Creates a Segment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.Segment + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.Segment} Segment + */ + Segment.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.Segment) + return object; + var message = new $root.google.analytics.data.v1alpha.Segment(); + if (object.name != null) + message.name = String(object.name); + if (object.userSegment != null) { + if (typeof object.userSegment !== "object") + throw TypeError(".google.analytics.data.v1alpha.Segment.userSegment: object expected"); + message.userSegment = $root.google.analytics.data.v1alpha.UserSegment.fromObject(object.userSegment); + } + if (object.sessionSegment != null) { + if (typeof object.sessionSegment !== "object") + throw TypeError(".google.analytics.data.v1alpha.Segment.sessionSegment: object expected"); + message.sessionSegment = $root.google.analytics.data.v1alpha.SessionSegment.fromObject(object.sessionSegment); + } + if (object.eventSegment != null) { + if (typeof object.eventSegment !== "object") + throw TypeError(".google.analytics.data.v1alpha.Segment.eventSegment: object expected"); + message.eventSegment = $root.google.analytics.data.v1alpha.EventSegment.fromObject(object.eventSegment); + } + return message; + }; + + /** + * Creates a plain object from a Segment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.Segment + * @static + * @param {google.analytics.data.v1alpha.Segment} message Segment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Segment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.userSegment != null && message.hasOwnProperty("userSegment")) { + object.userSegment = $root.google.analytics.data.v1alpha.UserSegment.toObject(message.userSegment, options); + if (options.oneofs) + object.oneSegmentScope = "userSegment"; + } + if (message.sessionSegment != null && message.hasOwnProperty("sessionSegment")) { + object.sessionSegment = $root.google.analytics.data.v1alpha.SessionSegment.toObject(message.sessionSegment, options); + if (options.oneofs) + object.oneSegmentScope = "sessionSegment"; + } + if (message.eventSegment != null && message.hasOwnProperty("eventSegment")) { + object.eventSegment = $root.google.analytics.data.v1alpha.EventSegment.toObject(message.eventSegment, options); + if (options.oneofs) + object.oneSegmentScope = "eventSegment"; + } + return object; + }; + + /** + * Converts this Segment to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.Segment + * @instance + * @returns {Object.} JSON object + */ + Segment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Segment + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.Segment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Segment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.Segment"; + }; + + return Segment; + })(); + + v1alpha.SegmentFilterExpression = (function() { + + /** + * Properties of a SegmentFilterExpression. + * @memberof google.analytics.data.v1alpha + * @interface ISegmentFilterExpression + * @property {google.analytics.data.v1alpha.ISegmentFilterExpressionList|null} [andGroup] SegmentFilterExpression andGroup + * @property {google.analytics.data.v1alpha.ISegmentFilterExpressionList|null} [orGroup] SegmentFilterExpression orGroup + * @property {google.analytics.data.v1alpha.ISegmentFilterExpression|null} [notExpression] SegmentFilterExpression notExpression + * @property {google.analytics.data.v1alpha.ISegmentFilter|null} [segmentFilter] SegmentFilterExpression segmentFilter + * @property {google.analytics.data.v1alpha.ISegmentEventFilter|null} [segmentEventFilter] SegmentFilterExpression segmentEventFilter + */ + + /** + * Constructs a new SegmentFilterExpression. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a SegmentFilterExpression. + * @implements ISegmentFilterExpression + * @constructor + * @param {google.analytics.data.v1alpha.ISegmentFilterExpression=} [properties] Properties to set + */ + function SegmentFilterExpression(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]]; + } + + /** + * SegmentFilterExpression andGroup. + * @member {google.analytics.data.v1alpha.ISegmentFilterExpressionList|null|undefined} andGroup + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @instance + */ + SegmentFilterExpression.prototype.andGroup = null; + + /** + * SegmentFilterExpression orGroup. + * @member {google.analytics.data.v1alpha.ISegmentFilterExpressionList|null|undefined} orGroup + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @instance + */ + SegmentFilterExpression.prototype.orGroup = null; + + /** + * SegmentFilterExpression notExpression. + * @member {google.analytics.data.v1alpha.ISegmentFilterExpression|null|undefined} notExpression + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @instance + */ + SegmentFilterExpression.prototype.notExpression = null; + + /** + * SegmentFilterExpression segmentFilter. + * @member {google.analytics.data.v1alpha.ISegmentFilter|null|undefined} segmentFilter + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @instance + */ + SegmentFilterExpression.prototype.segmentFilter = null; + + /** + * SegmentFilterExpression segmentEventFilter. + * @member {google.analytics.data.v1alpha.ISegmentEventFilter|null|undefined} segmentEventFilter + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @instance + */ + SegmentFilterExpression.prototype.segmentEventFilter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SegmentFilterExpression expr. + * @member {"andGroup"|"orGroup"|"notExpression"|"segmentFilter"|"segmentEventFilter"|undefined} expr + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @instance + */ + Object.defineProperty(SegmentFilterExpression.prototype, "expr", { + get: $util.oneOfGetter($oneOfFields = ["andGroup", "orGroup", "notExpression", "segmentFilter", "segmentEventFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SegmentFilterExpression instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @static + * @param {google.analytics.data.v1alpha.ISegmentFilterExpression=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.SegmentFilterExpression} SegmentFilterExpression instance + */ + SegmentFilterExpression.create = function create(properties) { + return new SegmentFilterExpression(properties); + }; + + /** + * Encodes the specified SegmentFilterExpression message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilterExpression.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @static + * @param {google.analytics.data.v1alpha.ISegmentFilterExpression} message SegmentFilterExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentFilterExpression.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.andGroup != null && Object.hasOwnProperty.call(message, "andGroup")) + $root.google.analytics.data.v1alpha.SegmentFilterExpressionList.encode(message.andGroup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.orGroup != null && Object.hasOwnProperty.call(message, "orGroup")) + $root.google.analytics.data.v1alpha.SegmentFilterExpressionList.encode(message.orGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.notExpression != null && Object.hasOwnProperty.call(message, "notExpression")) + $root.google.analytics.data.v1alpha.SegmentFilterExpression.encode(message.notExpression, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.segmentFilter != null && Object.hasOwnProperty.call(message, "segmentFilter")) + $root.google.analytics.data.v1alpha.SegmentFilter.encode(message.segmentFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.segmentEventFilter != null && Object.hasOwnProperty.call(message, "segmentEventFilter")) + $root.google.analytics.data.v1alpha.SegmentEventFilter.encode(message.segmentEventFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SegmentFilterExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilterExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @static + * @param {google.analytics.data.v1alpha.ISegmentFilterExpression} message SegmentFilterExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentFilterExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SegmentFilterExpression message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.SegmentFilterExpression} SegmentFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentFilterExpression.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.SegmentFilterExpression(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.andGroup = $root.google.analytics.data.v1alpha.SegmentFilterExpressionList.decode(reader, reader.uint32()); + break; + } + case 2: { + message.orGroup = $root.google.analytics.data.v1alpha.SegmentFilterExpressionList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.notExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.decode(reader, reader.uint32()); + break; + } + case 4: { + message.segmentFilter = $root.google.analytics.data.v1alpha.SegmentFilter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.segmentEventFilter = $root.google.analytics.data.v1alpha.SegmentEventFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SegmentFilterExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.SegmentFilterExpression} SegmentFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentFilterExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SegmentFilterExpression message. + * @function verify + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SegmentFilterExpression.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.andGroup != null && message.hasOwnProperty("andGroup")) { + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.SegmentFilterExpressionList.verify(message.andGroup); + if (error) + return "andGroup." + error; + } + } + if (message.orGroup != null && message.hasOwnProperty("orGroup")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.SegmentFilterExpressionList.verify(message.orGroup); + if (error) + return "orGroup." + error; + } + } + if (message.notExpression != null && message.hasOwnProperty("notExpression")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.SegmentFilterExpression.verify(message.notExpression); + if (error) + return "notExpression." + error; + } + } + if (message.segmentFilter != null && message.hasOwnProperty("segmentFilter")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.SegmentFilter.verify(message.segmentFilter); + if (error) + return "segmentFilter." + error; + } + } + if (message.segmentEventFilter != null && message.hasOwnProperty("segmentEventFilter")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.SegmentEventFilter.verify(message.segmentEventFilter); + if (error) + return "segmentEventFilter." + error; + } + } + return null; + }; + + /** + * Creates a SegmentFilterExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.SegmentFilterExpression} SegmentFilterExpression + */ + SegmentFilterExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.SegmentFilterExpression) + return object; + var message = new $root.google.analytics.data.v1alpha.SegmentFilterExpression(); + if (object.andGroup != null) { + if (typeof object.andGroup !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentFilterExpression.andGroup: object expected"); + message.andGroup = $root.google.analytics.data.v1alpha.SegmentFilterExpressionList.fromObject(object.andGroup); + } + if (object.orGroup != null) { + if (typeof object.orGroup !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentFilterExpression.orGroup: object expected"); + message.orGroup = $root.google.analytics.data.v1alpha.SegmentFilterExpressionList.fromObject(object.orGroup); + } + if (object.notExpression != null) { + if (typeof object.notExpression !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentFilterExpression.notExpression: object expected"); + message.notExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.fromObject(object.notExpression); + } + if (object.segmentFilter != null) { + if (typeof object.segmentFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentFilterExpression.segmentFilter: object expected"); + message.segmentFilter = $root.google.analytics.data.v1alpha.SegmentFilter.fromObject(object.segmentFilter); + } + if (object.segmentEventFilter != null) { + if (typeof object.segmentEventFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentFilterExpression.segmentEventFilter: object expected"); + message.segmentEventFilter = $root.google.analytics.data.v1alpha.SegmentEventFilter.fromObject(object.segmentEventFilter); + } + return message; + }; + + /** + * Creates a plain object from a SegmentFilterExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @static + * @param {google.analytics.data.v1alpha.SegmentFilterExpression} message SegmentFilterExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SegmentFilterExpression.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.andGroup != null && message.hasOwnProperty("andGroup")) { + object.andGroup = $root.google.analytics.data.v1alpha.SegmentFilterExpressionList.toObject(message.andGroup, options); + if (options.oneofs) + object.expr = "andGroup"; + } + if (message.orGroup != null && message.hasOwnProperty("orGroup")) { + object.orGroup = $root.google.analytics.data.v1alpha.SegmentFilterExpressionList.toObject(message.orGroup, options); + if (options.oneofs) + object.expr = "orGroup"; + } + if (message.notExpression != null && message.hasOwnProperty("notExpression")) { + object.notExpression = $root.google.analytics.data.v1alpha.SegmentFilterExpression.toObject(message.notExpression, options); + if (options.oneofs) + object.expr = "notExpression"; + } + if (message.segmentFilter != null && message.hasOwnProperty("segmentFilter")) { + object.segmentFilter = $root.google.analytics.data.v1alpha.SegmentFilter.toObject(message.segmentFilter, options); + if (options.oneofs) + object.expr = "segmentFilter"; + } + if (message.segmentEventFilter != null && message.hasOwnProperty("segmentEventFilter")) { + object.segmentEventFilter = $root.google.analytics.data.v1alpha.SegmentEventFilter.toObject(message.segmentEventFilter, options); + if (options.oneofs) + object.expr = "segmentEventFilter"; + } + return object; + }; + + /** + * Converts this SegmentFilterExpression to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @instance + * @returns {Object.} JSON object + */ + SegmentFilterExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SegmentFilterExpression + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.SegmentFilterExpression + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SegmentFilterExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.SegmentFilterExpression"; + }; + + return SegmentFilterExpression; + })(); + + v1alpha.SegmentFilterExpressionList = (function() { + + /** + * Properties of a SegmentFilterExpressionList. + * @memberof google.analytics.data.v1alpha + * @interface ISegmentFilterExpressionList + * @property {Array.|null} [expressions] SegmentFilterExpressionList expressions + */ + + /** + * Constructs a new SegmentFilterExpressionList. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a SegmentFilterExpressionList. + * @implements ISegmentFilterExpressionList + * @constructor + * @param {google.analytics.data.v1alpha.ISegmentFilterExpressionList=} [properties] Properties to set + */ + function SegmentFilterExpressionList(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]]; + } + + /** + * SegmentFilterExpressionList expressions. + * @member {Array.} expressions + * @memberof google.analytics.data.v1alpha.SegmentFilterExpressionList + * @instance + */ + SegmentFilterExpressionList.prototype.expressions = $util.emptyArray; + + /** + * Creates a new SegmentFilterExpressionList instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.SegmentFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.ISegmentFilterExpressionList=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.SegmentFilterExpressionList} SegmentFilterExpressionList instance + */ + SegmentFilterExpressionList.create = function create(properties) { + return new SegmentFilterExpressionList(properties); + }; + + /** + * Encodes the specified SegmentFilterExpressionList message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilterExpressionList.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.SegmentFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.ISegmentFilterExpressionList} message SegmentFilterExpressionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentFilterExpressionList.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.data.v1alpha.SegmentFilterExpression.encode(message.expressions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SegmentFilterExpressionList message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilterExpressionList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.ISegmentFilterExpressionList} message SegmentFilterExpressionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentFilterExpressionList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SegmentFilterExpressionList message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.SegmentFilterExpressionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.SegmentFilterExpressionList} SegmentFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentFilterExpressionList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.SegmentFilterExpressionList(); + 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.data.v1alpha.SegmentFilterExpression.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SegmentFilterExpressionList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentFilterExpressionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.SegmentFilterExpressionList} SegmentFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentFilterExpressionList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SegmentFilterExpressionList message. + * @function verify + * @memberof google.analytics.data.v1alpha.SegmentFilterExpressionList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SegmentFilterExpressionList.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.data.v1alpha.SegmentFilterExpression.verify(message.expressions[i]); + if (error) + return "expressions." + error; + } + } + return null; + }; + + /** + * Creates a SegmentFilterExpressionList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.SegmentFilterExpressionList + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.SegmentFilterExpressionList} SegmentFilterExpressionList + */ + SegmentFilterExpressionList.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.SegmentFilterExpressionList) + return object; + var message = new $root.google.analytics.data.v1alpha.SegmentFilterExpressionList(); + if (object.expressions) { + if (!Array.isArray(object.expressions)) + throw TypeError(".google.analytics.data.v1alpha.SegmentFilterExpressionList.expressions: array expected"); + message.expressions = []; + for (var i = 0; i < object.expressions.length; ++i) { + if (typeof object.expressions[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentFilterExpressionList.expressions: object expected"); + message.expressions[i] = $root.google.analytics.data.v1alpha.SegmentFilterExpression.fromObject(object.expressions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SegmentFilterExpressionList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.SegmentFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.SegmentFilterExpressionList} message SegmentFilterExpressionList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SegmentFilterExpressionList.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.data.v1alpha.SegmentFilterExpression.toObject(message.expressions[j], options); + } + return object; + }; + + /** + * Converts this SegmentFilterExpressionList to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.SegmentFilterExpressionList + * @instance + * @returns {Object.} JSON object + */ + SegmentFilterExpressionList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SegmentFilterExpressionList + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.SegmentFilterExpressionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SegmentFilterExpressionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.SegmentFilterExpressionList"; + }; + + return SegmentFilterExpressionList; + })(); + + v1alpha.SegmentFilter = (function() { + + /** + * Properties of a SegmentFilter. + * @memberof google.analytics.data.v1alpha + * @interface ISegmentFilter + * @property {string|null} [fieldName] SegmentFilter fieldName + * @property {google.analytics.data.v1alpha.IStringFilter|null} [stringFilter] SegmentFilter stringFilter + * @property {google.analytics.data.v1alpha.IInListFilter|null} [inListFilter] SegmentFilter inListFilter + * @property {google.analytics.data.v1alpha.INumericFilter|null} [numericFilter] SegmentFilter numericFilter + * @property {google.analytics.data.v1alpha.IBetweenFilter|null} [betweenFilter] SegmentFilter betweenFilter + * @property {google.analytics.data.v1alpha.ISegmentFilterScoping|null} [filterScoping] SegmentFilter filterScoping + */ + + /** + * Constructs a new SegmentFilter. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a SegmentFilter. + * @implements ISegmentFilter + * @constructor + * @param {google.analytics.data.v1alpha.ISegmentFilter=} [properties] Properties to set + */ + function SegmentFilter(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]]; + } + + /** + * SegmentFilter fieldName. + * @member {string} fieldName + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @instance + */ + SegmentFilter.prototype.fieldName = ""; + + /** + * SegmentFilter stringFilter. + * @member {google.analytics.data.v1alpha.IStringFilter|null|undefined} stringFilter + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @instance + */ + SegmentFilter.prototype.stringFilter = null; + + /** + * SegmentFilter inListFilter. + * @member {google.analytics.data.v1alpha.IInListFilter|null|undefined} inListFilter + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @instance + */ + SegmentFilter.prototype.inListFilter = null; + + /** + * SegmentFilter numericFilter. + * @member {google.analytics.data.v1alpha.INumericFilter|null|undefined} numericFilter + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @instance + */ + SegmentFilter.prototype.numericFilter = null; + + /** + * SegmentFilter betweenFilter. + * @member {google.analytics.data.v1alpha.IBetweenFilter|null|undefined} betweenFilter + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @instance + */ + SegmentFilter.prototype.betweenFilter = null; + + /** + * SegmentFilter filterScoping. + * @member {google.analytics.data.v1alpha.ISegmentFilterScoping|null|undefined} filterScoping + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @instance + */ + SegmentFilter.prototype.filterScoping = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SegmentFilter oneFilter. + * @member {"stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"|undefined} oneFilter + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @instance + */ + Object.defineProperty(SegmentFilter.prototype, "oneFilter", { + get: $util.oneOfGetter($oneOfFields = ["stringFilter", "inListFilter", "numericFilter", "betweenFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SegmentFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @static + * @param {google.analytics.data.v1alpha.ISegmentFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.SegmentFilter} SegmentFilter instance + */ + SegmentFilter.create = function create(properties) { + return new SegmentFilter(properties); + }; + + /** + * Encodes the specified SegmentFilter message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @static + * @param {google.analytics.data.v1alpha.ISegmentFilter} message SegmentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentFilter.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.data.v1alpha.StringFilter.encode(message.stringFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inListFilter != null && Object.hasOwnProperty.call(message, "inListFilter")) + $root.google.analytics.data.v1alpha.InListFilter.encode(message.inListFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.numericFilter != null && Object.hasOwnProperty.call(message, "numericFilter")) + $root.google.analytics.data.v1alpha.NumericFilter.encode(message.numericFilter, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.betweenFilter != null && Object.hasOwnProperty.call(message, "betweenFilter")) + $root.google.analytics.data.v1alpha.BetweenFilter.encode(message.betweenFilter, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.filterScoping != null && Object.hasOwnProperty.call(message, "filterScoping")) + $root.google.analytics.data.v1alpha.SegmentFilterScoping.encode(message.filterScoping, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SegmentFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @static + * @param {google.analytics.data.v1alpha.ISegmentFilter} message SegmentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SegmentFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.SegmentFilter} SegmentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.SegmentFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldName = reader.string(); + break; + } + case 4: { + message.stringFilter = $root.google.analytics.data.v1alpha.StringFilter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.decode(reader, reader.uint32()); + break; + } + case 6: { + message.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.decode(reader, reader.uint32()); + break; + } + case 7: { + message.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.decode(reader, reader.uint32()); + break; + } + case 8: { + message.filterScoping = $root.google.analytics.data.v1alpha.SegmentFilterScoping.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SegmentFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.SegmentFilter} SegmentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SegmentFilter message. + * @function verify + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SegmentFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.stringFilter != null && message.hasOwnProperty("stringFilter")) { + properties.oneFilter = 1; + { + var error = $root.google.analytics.data.v1alpha.StringFilter.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.data.v1alpha.InListFilter.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.data.v1alpha.NumericFilter.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.data.v1alpha.BetweenFilter.verify(message.betweenFilter); + if (error) + return "betweenFilter." + error; + } + } + if (message.filterScoping != null && message.hasOwnProperty("filterScoping")) { + var error = $root.google.analytics.data.v1alpha.SegmentFilterScoping.verify(message.filterScoping); + if (error) + return "filterScoping." + error; + } + return null; + }; + + /** + * Creates a SegmentFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.SegmentFilter} SegmentFilter + */ + SegmentFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.SegmentFilter) + return object; + var message = new $root.google.analytics.data.v1alpha.SegmentFilter(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + if (object.stringFilter != null) { + if (typeof object.stringFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentFilter.stringFilter: object expected"); + message.stringFilter = $root.google.analytics.data.v1alpha.StringFilter.fromObject(object.stringFilter); + } + if (object.inListFilter != null) { + if (typeof object.inListFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentFilter.inListFilter: object expected"); + message.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.fromObject(object.inListFilter); + } + if (object.numericFilter != null) { + if (typeof object.numericFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentFilter.numericFilter: object expected"); + message.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.fromObject(object.numericFilter); + } + if (object.betweenFilter != null) { + if (typeof object.betweenFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentFilter.betweenFilter: object expected"); + message.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.fromObject(object.betweenFilter); + } + if (object.filterScoping != null) { + if (typeof object.filterScoping !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentFilter.filterScoping: object expected"); + message.filterScoping = $root.google.analytics.data.v1alpha.SegmentFilterScoping.fromObject(object.filterScoping); + } + return message; + }; + + /** + * Creates a plain object from a SegmentFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @static + * @param {google.analytics.data.v1alpha.SegmentFilter} message SegmentFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SegmentFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldName = ""; + object.filterScoping = null; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + if (message.stringFilter != null && message.hasOwnProperty("stringFilter")) { + object.stringFilter = $root.google.analytics.data.v1alpha.StringFilter.toObject(message.stringFilter, options); + if (options.oneofs) + object.oneFilter = "stringFilter"; + } + if (message.inListFilter != null && message.hasOwnProperty("inListFilter")) { + object.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.toObject(message.inListFilter, options); + if (options.oneofs) + object.oneFilter = "inListFilter"; + } + if (message.numericFilter != null && message.hasOwnProperty("numericFilter")) { + object.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.toObject(message.numericFilter, options); + if (options.oneofs) + object.oneFilter = "numericFilter"; + } + if (message.betweenFilter != null && message.hasOwnProperty("betweenFilter")) { + object.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.toObject(message.betweenFilter, options); + if (options.oneofs) + object.oneFilter = "betweenFilter"; + } + if (message.filterScoping != null && message.hasOwnProperty("filterScoping")) + object.filterScoping = $root.google.analytics.data.v1alpha.SegmentFilterScoping.toObject(message.filterScoping, options); + return object; + }; + + /** + * Converts this SegmentFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @instance + * @returns {Object.} JSON object + */ + SegmentFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SegmentFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.SegmentFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SegmentFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.SegmentFilter"; + }; + + return SegmentFilter; + })(); + + v1alpha.SegmentFilterScoping = (function() { + + /** + * Properties of a SegmentFilterScoping. + * @memberof google.analytics.data.v1alpha + * @interface ISegmentFilterScoping + * @property {boolean|null} [atAnyPointInTime] SegmentFilterScoping atAnyPointInTime + */ + + /** + * Constructs a new SegmentFilterScoping. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a SegmentFilterScoping. + * @implements ISegmentFilterScoping + * @constructor + * @param {google.analytics.data.v1alpha.ISegmentFilterScoping=} [properties] Properties to set + */ + function SegmentFilterScoping(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]]; + } + + /** + * SegmentFilterScoping atAnyPointInTime. + * @member {boolean|null|undefined} atAnyPointInTime + * @memberof google.analytics.data.v1alpha.SegmentFilterScoping + * @instance + */ + SegmentFilterScoping.prototype.atAnyPointInTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SegmentFilterScoping _atAnyPointInTime. + * @member {"atAnyPointInTime"|undefined} _atAnyPointInTime + * @memberof google.analytics.data.v1alpha.SegmentFilterScoping + * @instance + */ + Object.defineProperty(SegmentFilterScoping.prototype, "_atAnyPointInTime", { + get: $util.oneOfGetter($oneOfFields = ["atAnyPointInTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SegmentFilterScoping instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.SegmentFilterScoping + * @static + * @param {google.analytics.data.v1alpha.ISegmentFilterScoping=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.SegmentFilterScoping} SegmentFilterScoping instance + */ + SegmentFilterScoping.create = function create(properties) { + return new SegmentFilterScoping(properties); + }; + + /** + * Encodes the specified SegmentFilterScoping message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilterScoping.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.SegmentFilterScoping + * @static + * @param {google.analytics.data.v1alpha.ISegmentFilterScoping} message SegmentFilterScoping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentFilterScoping.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.atAnyPointInTime != null && Object.hasOwnProperty.call(message, "atAnyPointInTime")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.atAnyPointInTime); + return writer; + }; + + /** + * Encodes the specified SegmentFilterScoping message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentFilterScoping.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentFilterScoping + * @static + * @param {google.analytics.data.v1alpha.ISegmentFilterScoping} message SegmentFilterScoping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentFilterScoping.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SegmentFilterScoping message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.SegmentFilterScoping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.SegmentFilterScoping} SegmentFilterScoping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentFilterScoping.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.SegmentFilterScoping(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.atAnyPointInTime = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SegmentFilterScoping message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentFilterScoping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.SegmentFilterScoping} SegmentFilterScoping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentFilterScoping.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SegmentFilterScoping message. + * @function verify + * @memberof google.analytics.data.v1alpha.SegmentFilterScoping + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SegmentFilterScoping.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.atAnyPointInTime != null && message.hasOwnProperty("atAnyPointInTime")) { + properties._atAnyPointInTime = 1; + if (typeof message.atAnyPointInTime !== "boolean") + return "atAnyPointInTime: boolean expected"; + } + return null; + }; + + /** + * Creates a SegmentFilterScoping message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.SegmentFilterScoping + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.SegmentFilterScoping} SegmentFilterScoping + */ + SegmentFilterScoping.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.SegmentFilterScoping) + return object; + var message = new $root.google.analytics.data.v1alpha.SegmentFilterScoping(); + if (object.atAnyPointInTime != null) + message.atAnyPointInTime = Boolean(object.atAnyPointInTime); + return message; + }; + + /** + * Creates a plain object from a SegmentFilterScoping message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.SegmentFilterScoping + * @static + * @param {google.analytics.data.v1alpha.SegmentFilterScoping} message SegmentFilterScoping + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SegmentFilterScoping.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.atAnyPointInTime != null && message.hasOwnProperty("atAnyPointInTime")) { + object.atAnyPointInTime = message.atAnyPointInTime; + if (options.oneofs) + object._atAnyPointInTime = "atAnyPointInTime"; + } + return object; + }; + + /** + * Converts this SegmentFilterScoping to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.SegmentFilterScoping + * @instance + * @returns {Object.} JSON object + */ + SegmentFilterScoping.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SegmentFilterScoping + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.SegmentFilterScoping + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SegmentFilterScoping.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.SegmentFilterScoping"; + }; + + return SegmentFilterScoping; + })(); + + v1alpha.SegmentEventFilter = (function() { + + /** + * Properties of a SegmentEventFilter. + * @memberof google.analytics.data.v1alpha + * @interface ISegmentEventFilter + * @property {string|null} [eventName] SegmentEventFilter eventName + * @property {google.analytics.data.v1alpha.ISegmentParameterFilterExpression|null} [segmentParameterFilterExpression] SegmentEventFilter segmentParameterFilterExpression + */ + + /** + * Constructs a new SegmentEventFilter. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a SegmentEventFilter. + * @implements ISegmentEventFilter + * @constructor + * @param {google.analytics.data.v1alpha.ISegmentEventFilter=} [properties] Properties to set + */ + function SegmentEventFilter(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]]; + } + + /** + * SegmentEventFilter eventName. + * @member {string|null|undefined} eventName + * @memberof google.analytics.data.v1alpha.SegmentEventFilter + * @instance + */ + SegmentEventFilter.prototype.eventName = null; + + /** + * SegmentEventFilter segmentParameterFilterExpression. + * @member {google.analytics.data.v1alpha.ISegmentParameterFilterExpression|null|undefined} segmentParameterFilterExpression + * @memberof google.analytics.data.v1alpha.SegmentEventFilter + * @instance + */ + SegmentEventFilter.prototype.segmentParameterFilterExpression = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SegmentEventFilter _eventName. + * @member {"eventName"|undefined} _eventName + * @memberof google.analytics.data.v1alpha.SegmentEventFilter + * @instance + */ + Object.defineProperty(SegmentEventFilter.prototype, "_eventName", { + get: $util.oneOfGetter($oneOfFields = ["eventName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SegmentEventFilter _segmentParameterFilterExpression. + * @member {"segmentParameterFilterExpression"|undefined} _segmentParameterFilterExpression + * @memberof google.analytics.data.v1alpha.SegmentEventFilter + * @instance + */ + Object.defineProperty(SegmentEventFilter.prototype, "_segmentParameterFilterExpression", { + get: $util.oneOfGetter($oneOfFields = ["segmentParameterFilterExpression"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SegmentEventFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.SegmentEventFilter + * @static + * @param {google.analytics.data.v1alpha.ISegmentEventFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.SegmentEventFilter} SegmentEventFilter instance + */ + SegmentEventFilter.create = function create(properties) { + return new SegmentEventFilter(properties); + }; + + /** + * Encodes the specified SegmentEventFilter message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentEventFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.SegmentEventFilter + * @static + * @param {google.analytics.data.v1alpha.ISegmentEventFilter} message SegmentEventFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentEventFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventName != null && Object.hasOwnProperty.call(message, "eventName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventName); + if (message.segmentParameterFilterExpression != null && Object.hasOwnProperty.call(message, "segmentParameterFilterExpression")) + $root.google.analytics.data.v1alpha.SegmentParameterFilterExpression.encode(message.segmentParameterFilterExpression, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SegmentEventFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentEventFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentEventFilter + * @static + * @param {google.analytics.data.v1alpha.ISegmentEventFilter} message SegmentEventFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentEventFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SegmentEventFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.SegmentEventFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.SegmentEventFilter} SegmentEventFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentEventFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.SegmentEventFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.eventName = reader.string(); + break; + } + case 2: { + message.segmentParameterFilterExpression = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpression.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SegmentEventFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentEventFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.SegmentEventFilter} SegmentEventFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentEventFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SegmentEventFilter message. + * @function verify + * @memberof google.analytics.data.v1alpha.SegmentEventFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SegmentEventFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.eventName != null && message.hasOwnProperty("eventName")) { + properties._eventName = 1; + if (!$util.isString(message.eventName)) + return "eventName: string expected"; + } + if (message.segmentParameterFilterExpression != null && message.hasOwnProperty("segmentParameterFilterExpression")) { + properties._segmentParameterFilterExpression = 1; + { + var error = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpression.verify(message.segmentParameterFilterExpression); + if (error) + return "segmentParameterFilterExpression." + error; + } + } + return null; + }; + + /** + * Creates a SegmentEventFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.SegmentEventFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.SegmentEventFilter} SegmentEventFilter + */ + SegmentEventFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.SegmentEventFilter) + return object; + var message = new $root.google.analytics.data.v1alpha.SegmentEventFilter(); + if (object.eventName != null) + message.eventName = String(object.eventName); + if (object.segmentParameterFilterExpression != null) { + if (typeof object.segmentParameterFilterExpression !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentEventFilter.segmentParameterFilterExpression: object expected"); + message.segmentParameterFilterExpression = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpression.fromObject(object.segmentParameterFilterExpression); + } + return message; + }; + + /** + * Creates a plain object from a SegmentEventFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.SegmentEventFilter + * @static + * @param {google.analytics.data.v1alpha.SegmentEventFilter} message SegmentEventFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SegmentEventFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.eventName != null && message.hasOwnProperty("eventName")) { + object.eventName = message.eventName; + if (options.oneofs) + object._eventName = "eventName"; + } + if (message.segmentParameterFilterExpression != null && message.hasOwnProperty("segmentParameterFilterExpression")) { + object.segmentParameterFilterExpression = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpression.toObject(message.segmentParameterFilterExpression, options); + if (options.oneofs) + object._segmentParameterFilterExpression = "segmentParameterFilterExpression"; + } + return object; + }; + + /** + * Converts this SegmentEventFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.SegmentEventFilter + * @instance + * @returns {Object.} JSON object + */ + SegmentEventFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SegmentEventFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.SegmentEventFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SegmentEventFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.SegmentEventFilter"; + }; + + return SegmentEventFilter; + })(); + + v1alpha.SegmentParameterFilterExpression = (function() { + + /** + * Properties of a SegmentParameterFilterExpression. + * @memberof google.analytics.data.v1alpha + * @interface ISegmentParameterFilterExpression + * @property {google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList|null} [andGroup] SegmentParameterFilterExpression andGroup + * @property {google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList|null} [orGroup] SegmentParameterFilterExpression orGroup + * @property {google.analytics.data.v1alpha.ISegmentParameterFilterExpression|null} [notExpression] SegmentParameterFilterExpression notExpression + * @property {google.analytics.data.v1alpha.ISegmentParameterFilter|null} [segmentParameterFilter] SegmentParameterFilterExpression segmentParameterFilter + */ + + /** + * Constructs a new SegmentParameterFilterExpression. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a SegmentParameterFilterExpression. + * @implements ISegmentParameterFilterExpression + * @constructor + * @param {google.analytics.data.v1alpha.ISegmentParameterFilterExpression=} [properties] Properties to set + */ + function SegmentParameterFilterExpression(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]]; + } + + /** + * SegmentParameterFilterExpression andGroup. + * @member {google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList|null|undefined} andGroup + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @instance + */ + SegmentParameterFilterExpression.prototype.andGroup = null; + + /** + * SegmentParameterFilterExpression orGroup. + * @member {google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList|null|undefined} orGroup + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @instance + */ + SegmentParameterFilterExpression.prototype.orGroup = null; + + /** + * SegmentParameterFilterExpression notExpression. + * @member {google.analytics.data.v1alpha.ISegmentParameterFilterExpression|null|undefined} notExpression + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @instance + */ + SegmentParameterFilterExpression.prototype.notExpression = null; + + /** + * SegmentParameterFilterExpression segmentParameterFilter. + * @member {google.analytics.data.v1alpha.ISegmentParameterFilter|null|undefined} segmentParameterFilter + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @instance + */ + SegmentParameterFilterExpression.prototype.segmentParameterFilter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SegmentParameterFilterExpression expr. + * @member {"andGroup"|"orGroup"|"notExpression"|"segmentParameterFilter"|undefined} expr + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @instance + */ + Object.defineProperty(SegmentParameterFilterExpression.prototype, "expr", { + get: $util.oneOfGetter($oneOfFields = ["andGroup", "orGroup", "notExpression", "segmentParameterFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SegmentParameterFilterExpression instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @static + * @param {google.analytics.data.v1alpha.ISegmentParameterFilterExpression=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.SegmentParameterFilterExpression} SegmentParameterFilterExpression instance + */ + SegmentParameterFilterExpression.create = function create(properties) { + return new SegmentParameterFilterExpression(properties); + }; + + /** + * Encodes the specified SegmentParameterFilterExpression message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilterExpression.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @static + * @param {google.analytics.data.v1alpha.ISegmentParameterFilterExpression} message SegmentParameterFilterExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentParameterFilterExpression.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.andGroup != null && Object.hasOwnProperty.call(message, "andGroup")) + $root.google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.encode(message.andGroup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.orGroup != null && Object.hasOwnProperty.call(message, "orGroup")) + $root.google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.encode(message.orGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.notExpression != null && Object.hasOwnProperty.call(message, "notExpression")) + $root.google.analytics.data.v1alpha.SegmentParameterFilterExpression.encode(message.notExpression, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.segmentParameterFilter != null && Object.hasOwnProperty.call(message, "segmentParameterFilter")) + $root.google.analytics.data.v1alpha.SegmentParameterFilter.encode(message.segmentParameterFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SegmentParameterFilterExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilterExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @static + * @param {google.analytics.data.v1alpha.ISegmentParameterFilterExpression} message SegmentParameterFilterExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentParameterFilterExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SegmentParameterFilterExpression message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.SegmentParameterFilterExpression} SegmentParameterFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentParameterFilterExpression.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.SegmentParameterFilterExpression(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.andGroup = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.decode(reader, reader.uint32()); + break; + } + case 2: { + message.orGroup = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.notExpression = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpression.decode(reader, reader.uint32()); + break; + } + case 4: { + message.segmentParameterFilter = $root.google.analytics.data.v1alpha.SegmentParameterFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SegmentParameterFilterExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.SegmentParameterFilterExpression} SegmentParameterFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentParameterFilterExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SegmentParameterFilterExpression message. + * @function verify + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SegmentParameterFilterExpression.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.andGroup != null && message.hasOwnProperty("andGroup")) { + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.verify(message.andGroup); + if (error) + return "andGroup." + error; + } + } + if (message.orGroup != null && message.hasOwnProperty("orGroup")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.verify(message.orGroup); + if (error) + return "orGroup." + error; + } + } + if (message.notExpression != null && message.hasOwnProperty("notExpression")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpression.verify(message.notExpression); + if (error) + return "notExpression." + error; + } + } + if (message.segmentParameterFilter != null && message.hasOwnProperty("segmentParameterFilter")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.SegmentParameterFilter.verify(message.segmentParameterFilter); + if (error) + return "segmentParameterFilter." + error; + } + } + return null; + }; + + /** + * Creates a SegmentParameterFilterExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.SegmentParameterFilterExpression} SegmentParameterFilterExpression + */ + SegmentParameterFilterExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.SegmentParameterFilterExpression) + return object; + var message = new $root.google.analytics.data.v1alpha.SegmentParameterFilterExpression(); + if (object.andGroup != null) { + if (typeof object.andGroup !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentParameterFilterExpression.andGroup: object expected"); + message.andGroup = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.fromObject(object.andGroup); + } + if (object.orGroup != null) { + if (typeof object.orGroup !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentParameterFilterExpression.orGroup: object expected"); + message.orGroup = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.fromObject(object.orGroup); + } + if (object.notExpression != null) { + if (typeof object.notExpression !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentParameterFilterExpression.notExpression: object expected"); + message.notExpression = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpression.fromObject(object.notExpression); + } + if (object.segmentParameterFilter != null) { + if (typeof object.segmentParameterFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentParameterFilterExpression.segmentParameterFilter: object expected"); + message.segmentParameterFilter = $root.google.analytics.data.v1alpha.SegmentParameterFilter.fromObject(object.segmentParameterFilter); + } + return message; + }; + + /** + * Creates a plain object from a SegmentParameterFilterExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @static + * @param {google.analytics.data.v1alpha.SegmentParameterFilterExpression} message SegmentParameterFilterExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SegmentParameterFilterExpression.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.andGroup != null && message.hasOwnProperty("andGroup")) { + object.andGroup = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.toObject(message.andGroup, options); + if (options.oneofs) + object.expr = "andGroup"; + } + if (message.orGroup != null && message.hasOwnProperty("orGroup")) { + object.orGroup = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.toObject(message.orGroup, options); + if (options.oneofs) + object.expr = "orGroup"; + } + if (message.notExpression != null && message.hasOwnProperty("notExpression")) { + object.notExpression = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpression.toObject(message.notExpression, options); + if (options.oneofs) + object.expr = "notExpression"; + } + if (message.segmentParameterFilter != null && message.hasOwnProperty("segmentParameterFilter")) { + object.segmentParameterFilter = $root.google.analytics.data.v1alpha.SegmentParameterFilter.toObject(message.segmentParameterFilter, options); + if (options.oneofs) + object.expr = "segmentParameterFilter"; + } + return object; + }; + + /** + * Converts this SegmentParameterFilterExpression to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @instance + * @returns {Object.} JSON object + */ + SegmentParameterFilterExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SegmentParameterFilterExpression + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpression + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SegmentParameterFilterExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.SegmentParameterFilterExpression"; + }; + + return SegmentParameterFilterExpression; + })(); + + v1alpha.SegmentParameterFilterExpressionList = (function() { + + /** + * Properties of a SegmentParameterFilterExpressionList. + * @memberof google.analytics.data.v1alpha + * @interface ISegmentParameterFilterExpressionList + * @property {Array.|null} [expressions] SegmentParameterFilterExpressionList expressions + */ + + /** + * Constructs a new SegmentParameterFilterExpressionList. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a SegmentParameterFilterExpressionList. + * @implements ISegmentParameterFilterExpressionList + * @constructor + * @param {google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList=} [properties] Properties to set + */ + function SegmentParameterFilterExpressionList(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]]; + } + + /** + * SegmentParameterFilterExpressionList expressions. + * @member {Array.} expressions + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpressionList + * @instance + */ + SegmentParameterFilterExpressionList.prototype.expressions = $util.emptyArray; + + /** + * Creates a new SegmentParameterFilterExpressionList instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.SegmentParameterFilterExpressionList} SegmentParameterFilterExpressionList instance + */ + SegmentParameterFilterExpressionList.create = function create(properties) { + return new SegmentParameterFilterExpressionList(properties); + }; + + /** + * Encodes the specified SegmentParameterFilterExpressionList message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList} message SegmentParameterFilterExpressionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentParameterFilterExpressionList.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.data.v1alpha.SegmentParameterFilterExpression.encode(message.expressions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SegmentParameterFilterExpressionList message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.ISegmentParameterFilterExpressionList} message SegmentParameterFilterExpressionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentParameterFilterExpressionList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SegmentParameterFilterExpressionList message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpressionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.SegmentParameterFilterExpressionList} SegmentParameterFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentParameterFilterExpressionList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.SegmentParameterFilterExpressionList(); + 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.data.v1alpha.SegmentParameterFilterExpression.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SegmentParameterFilterExpressionList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpressionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.SegmentParameterFilterExpressionList} SegmentParameterFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentParameterFilterExpressionList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SegmentParameterFilterExpressionList message. + * @function verify + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpressionList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SegmentParameterFilterExpressionList.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.data.v1alpha.SegmentParameterFilterExpression.verify(message.expressions[i]); + if (error) + return "expressions." + error; + } + } + return null; + }; + + /** + * Creates a SegmentParameterFilterExpressionList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpressionList + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.SegmentParameterFilterExpressionList} SegmentParameterFilterExpressionList + */ + SegmentParameterFilterExpressionList.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.SegmentParameterFilterExpressionList) + return object; + var message = new $root.google.analytics.data.v1alpha.SegmentParameterFilterExpressionList(); + if (object.expressions) { + if (!Array.isArray(object.expressions)) + throw TypeError(".google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.expressions: array expected"); + message.expressions = []; + for (var i = 0; i < object.expressions.length; ++i) { + if (typeof object.expressions[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentParameterFilterExpressionList.expressions: object expected"); + message.expressions[i] = $root.google.analytics.data.v1alpha.SegmentParameterFilterExpression.fromObject(object.expressions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SegmentParameterFilterExpressionList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.SegmentParameterFilterExpressionList} message SegmentParameterFilterExpressionList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SegmentParameterFilterExpressionList.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.data.v1alpha.SegmentParameterFilterExpression.toObject(message.expressions[j], options); + } + return object; + }; + + /** + * Converts this SegmentParameterFilterExpressionList to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpressionList + * @instance + * @returns {Object.} JSON object + */ + SegmentParameterFilterExpressionList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SegmentParameterFilterExpressionList + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterExpressionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SegmentParameterFilterExpressionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.SegmentParameterFilterExpressionList"; + }; + + return SegmentParameterFilterExpressionList; + })(); + + v1alpha.SegmentParameterFilter = (function() { + + /** + * Properties of a SegmentParameterFilter. + * @memberof google.analytics.data.v1alpha + * @interface ISegmentParameterFilter + * @property {string|null} [eventParameterName] SegmentParameterFilter eventParameterName + * @property {string|null} [itemParameterName] SegmentParameterFilter itemParameterName + * @property {google.analytics.data.v1alpha.IStringFilter|null} [stringFilter] SegmentParameterFilter stringFilter + * @property {google.analytics.data.v1alpha.IInListFilter|null} [inListFilter] SegmentParameterFilter inListFilter + * @property {google.analytics.data.v1alpha.INumericFilter|null} [numericFilter] SegmentParameterFilter numericFilter + * @property {google.analytics.data.v1alpha.IBetweenFilter|null} [betweenFilter] SegmentParameterFilter betweenFilter + * @property {google.analytics.data.v1alpha.ISegmentParameterFilterScoping|null} [filterScoping] SegmentParameterFilter filterScoping + */ + + /** + * Constructs a new SegmentParameterFilter. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a SegmentParameterFilter. + * @implements ISegmentParameterFilter + * @constructor + * @param {google.analytics.data.v1alpha.ISegmentParameterFilter=} [properties] Properties to set + */ + function SegmentParameterFilter(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]]; + } + + /** + * SegmentParameterFilter eventParameterName. + * @member {string|null|undefined} eventParameterName + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @instance + */ + SegmentParameterFilter.prototype.eventParameterName = null; + + /** + * SegmentParameterFilter itemParameterName. + * @member {string|null|undefined} itemParameterName + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @instance + */ + SegmentParameterFilter.prototype.itemParameterName = null; + + /** + * SegmentParameterFilter stringFilter. + * @member {google.analytics.data.v1alpha.IStringFilter|null|undefined} stringFilter + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @instance + */ + SegmentParameterFilter.prototype.stringFilter = null; + + /** + * SegmentParameterFilter inListFilter. + * @member {google.analytics.data.v1alpha.IInListFilter|null|undefined} inListFilter + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @instance + */ + SegmentParameterFilter.prototype.inListFilter = null; + + /** + * SegmentParameterFilter numericFilter. + * @member {google.analytics.data.v1alpha.INumericFilter|null|undefined} numericFilter + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @instance + */ + SegmentParameterFilter.prototype.numericFilter = null; + + /** + * SegmentParameterFilter betweenFilter. + * @member {google.analytics.data.v1alpha.IBetweenFilter|null|undefined} betweenFilter + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @instance + */ + SegmentParameterFilter.prototype.betweenFilter = null; + + /** + * SegmentParameterFilter filterScoping. + * @member {google.analytics.data.v1alpha.ISegmentParameterFilterScoping|null|undefined} filterScoping + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @instance + */ + SegmentParameterFilter.prototype.filterScoping = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SegmentParameterFilter oneParameter. + * @member {"eventParameterName"|"itemParameterName"|undefined} oneParameter + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @instance + */ + Object.defineProperty(SegmentParameterFilter.prototype, "oneParameter", { + get: $util.oneOfGetter($oneOfFields = ["eventParameterName", "itemParameterName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SegmentParameterFilter oneFilter. + * @member {"stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"|undefined} oneFilter + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @instance + */ + Object.defineProperty(SegmentParameterFilter.prototype, "oneFilter", { + get: $util.oneOfGetter($oneOfFields = ["stringFilter", "inListFilter", "numericFilter", "betweenFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SegmentParameterFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @static + * @param {google.analytics.data.v1alpha.ISegmentParameterFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.SegmentParameterFilter} SegmentParameterFilter instance + */ + SegmentParameterFilter.create = function create(properties) { + return new SegmentParameterFilter(properties); + }; + + /** + * Encodes the specified SegmentParameterFilter message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @static + * @param {google.analytics.data.v1alpha.ISegmentParameterFilter} message SegmentParameterFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentParameterFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventParameterName != null && Object.hasOwnProperty.call(message, "eventParameterName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventParameterName); + if (message.itemParameterName != null && Object.hasOwnProperty.call(message, "itemParameterName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.itemParameterName); + if (message.stringFilter != null && Object.hasOwnProperty.call(message, "stringFilter")) + $root.google.analytics.data.v1alpha.StringFilter.encode(message.stringFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inListFilter != null && Object.hasOwnProperty.call(message, "inListFilter")) + $root.google.analytics.data.v1alpha.InListFilter.encode(message.inListFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.numericFilter != null && Object.hasOwnProperty.call(message, "numericFilter")) + $root.google.analytics.data.v1alpha.NumericFilter.encode(message.numericFilter, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.betweenFilter != null && Object.hasOwnProperty.call(message, "betweenFilter")) + $root.google.analytics.data.v1alpha.BetweenFilter.encode(message.betweenFilter, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.filterScoping != null && Object.hasOwnProperty.call(message, "filterScoping")) + $root.google.analytics.data.v1alpha.SegmentParameterFilterScoping.encode(message.filterScoping, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SegmentParameterFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @static + * @param {google.analytics.data.v1alpha.ISegmentParameterFilter} message SegmentParameterFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentParameterFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SegmentParameterFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.SegmentParameterFilter} SegmentParameterFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentParameterFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.SegmentParameterFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.eventParameterName = reader.string(); + break; + } + case 2: { + message.itemParameterName = reader.string(); + break; + } + case 4: { + message.stringFilter = $root.google.analytics.data.v1alpha.StringFilter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.decode(reader, reader.uint32()); + break; + } + case 6: { + message.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.decode(reader, reader.uint32()); + break; + } + case 7: { + message.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.decode(reader, reader.uint32()); + break; + } + case 8: { + message.filterScoping = $root.google.analytics.data.v1alpha.SegmentParameterFilterScoping.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SegmentParameterFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.SegmentParameterFilter} SegmentParameterFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentParameterFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SegmentParameterFilter message. + * @function verify + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SegmentParameterFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.eventParameterName != null && message.hasOwnProperty("eventParameterName")) { + properties.oneParameter = 1; + if (!$util.isString(message.eventParameterName)) + return "eventParameterName: string expected"; + } + if (message.itemParameterName != null && message.hasOwnProperty("itemParameterName")) { + if (properties.oneParameter === 1) + return "oneParameter: multiple values"; + properties.oneParameter = 1; + if (!$util.isString(message.itemParameterName)) + return "itemParameterName: string expected"; + } + if (message.stringFilter != null && message.hasOwnProperty("stringFilter")) { + properties.oneFilter = 1; + { + var error = $root.google.analytics.data.v1alpha.StringFilter.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.data.v1alpha.InListFilter.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.data.v1alpha.NumericFilter.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.data.v1alpha.BetweenFilter.verify(message.betweenFilter); + if (error) + return "betweenFilter." + error; + } + } + if (message.filterScoping != null && message.hasOwnProperty("filterScoping")) { + var error = $root.google.analytics.data.v1alpha.SegmentParameterFilterScoping.verify(message.filterScoping); + if (error) + return "filterScoping." + error; + } + return null; + }; + + /** + * Creates a SegmentParameterFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.SegmentParameterFilter} SegmentParameterFilter + */ + SegmentParameterFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.SegmentParameterFilter) + return object; + var message = new $root.google.analytics.data.v1alpha.SegmentParameterFilter(); + if (object.eventParameterName != null) + message.eventParameterName = String(object.eventParameterName); + if (object.itemParameterName != null) + message.itemParameterName = String(object.itemParameterName); + if (object.stringFilter != null) { + if (typeof object.stringFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentParameterFilter.stringFilter: object expected"); + message.stringFilter = $root.google.analytics.data.v1alpha.StringFilter.fromObject(object.stringFilter); + } + if (object.inListFilter != null) { + if (typeof object.inListFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentParameterFilter.inListFilter: object expected"); + message.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.fromObject(object.inListFilter); + } + if (object.numericFilter != null) { + if (typeof object.numericFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentParameterFilter.numericFilter: object expected"); + message.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.fromObject(object.numericFilter); + } + if (object.betweenFilter != null) { + if (typeof object.betweenFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentParameterFilter.betweenFilter: object expected"); + message.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.fromObject(object.betweenFilter); + } + if (object.filterScoping != null) { + if (typeof object.filterScoping !== "object") + throw TypeError(".google.analytics.data.v1alpha.SegmentParameterFilter.filterScoping: object expected"); + message.filterScoping = $root.google.analytics.data.v1alpha.SegmentParameterFilterScoping.fromObject(object.filterScoping); + } + return message; + }; + + /** + * Creates a plain object from a SegmentParameterFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @static + * @param {google.analytics.data.v1alpha.SegmentParameterFilter} message SegmentParameterFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SegmentParameterFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.filterScoping = null; + if (message.eventParameterName != null && message.hasOwnProperty("eventParameterName")) { + object.eventParameterName = message.eventParameterName; + if (options.oneofs) + object.oneParameter = "eventParameterName"; + } + if (message.itemParameterName != null && message.hasOwnProperty("itemParameterName")) { + object.itemParameterName = message.itemParameterName; + if (options.oneofs) + object.oneParameter = "itemParameterName"; + } + if (message.stringFilter != null && message.hasOwnProperty("stringFilter")) { + object.stringFilter = $root.google.analytics.data.v1alpha.StringFilter.toObject(message.stringFilter, options); + if (options.oneofs) + object.oneFilter = "stringFilter"; + } + if (message.inListFilter != null && message.hasOwnProperty("inListFilter")) { + object.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.toObject(message.inListFilter, options); + if (options.oneofs) + object.oneFilter = "inListFilter"; + } + if (message.numericFilter != null && message.hasOwnProperty("numericFilter")) { + object.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.toObject(message.numericFilter, options); + if (options.oneofs) + object.oneFilter = "numericFilter"; + } + if (message.betweenFilter != null && message.hasOwnProperty("betweenFilter")) { + object.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.toObject(message.betweenFilter, options); + if (options.oneofs) + object.oneFilter = "betweenFilter"; + } + if (message.filterScoping != null && message.hasOwnProperty("filterScoping")) + object.filterScoping = $root.google.analytics.data.v1alpha.SegmentParameterFilterScoping.toObject(message.filterScoping, options); + return object; + }; + + /** + * Converts this SegmentParameterFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @instance + * @returns {Object.} JSON object + */ + SegmentParameterFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SegmentParameterFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.SegmentParameterFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SegmentParameterFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.SegmentParameterFilter"; + }; + + return SegmentParameterFilter; + })(); + + v1alpha.SegmentParameterFilterScoping = (function() { + + /** + * Properties of a SegmentParameterFilterScoping. + * @memberof google.analytics.data.v1alpha + * @interface ISegmentParameterFilterScoping + * @property {number|Long|null} [inAnyNDayPeriod] SegmentParameterFilterScoping inAnyNDayPeriod + */ + + /** + * Constructs a new SegmentParameterFilterScoping. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a SegmentParameterFilterScoping. + * @implements ISegmentParameterFilterScoping + * @constructor + * @param {google.analytics.data.v1alpha.ISegmentParameterFilterScoping=} [properties] Properties to set + */ + function SegmentParameterFilterScoping(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]]; + } + + /** + * SegmentParameterFilterScoping inAnyNDayPeriod. + * @member {number|Long|null|undefined} inAnyNDayPeriod + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterScoping + * @instance + */ + SegmentParameterFilterScoping.prototype.inAnyNDayPeriod = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SegmentParameterFilterScoping _inAnyNDayPeriod. + * @member {"inAnyNDayPeriod"|undefined} _inAnyNDayPeriod + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterScoping + * @instance + */ + Object.defineProperty(SegmentParameterFilterScoping.prototype, "_inAnyNDayPeriod", { + get: $util.oneOfGetter($oneOfFields = ["inAnyNDayPeriod"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SegmentParameterFilterScoping instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterScoping + * @static + * @param {google.analytics.data.v1alpha.ISegmentParameterFilterScoping=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.SegmentParameterFilterScoping} SegmentParameterFilterScoping instance + */ + SegmentParameterFilterScoping.create = function create(properties) { + return new SegmentParameterFilterScoping(properties); + }; + + /** + * Encodes the specified SegmentParameterFilterScoping message. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilterScoping.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterScoping + * @static + * @param {google.analytics.data.v1alpha.ISegmentParameterFilterScoping} message SegmentParameterFilterScoping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentParameterFilterScoping.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inAnyNDayPeriod != null && Object.hasOwnProperty.call(message, "inAnyNDayPeriod")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.inAnyNDayPeriod); + return writer; + }; + + /** + * Encodes the specified SegmentParameterFilterScoping message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SegmentParameterFilterScoping.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterScoping + * @static + * @param {google.analytics.data.v1alpha.ISegmentParameterFilterScoping} message SegmentParameterFilterScoping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentParameterFilterScoping.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SegmentParameterFilterScoping message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterScoping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.SegmentParameterFilterScoping} SegmentParameterFilterScoping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentParameterFilterScoping.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.SegmentParameterFilterScoping(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inAnyNDayPeriod = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SegmentParameterFilterScoping message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterScoping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.SegmentParameterFilterScoping} SegmentParameterFilterScoping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentParameterFilterScoping.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SegmentParameterFilterScoping message. + * @function verify + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterScoping + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SegmentParameterFilterScoping.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.inAnyNDayPeriod != null && message.hasOwnProperty("inAnyNDayPeriod")) { + properties._inAnyNDayPeriod = 1; + if (!$util.isInteger(message.inAnyNDayPeriod) && !(message.inAnyNDayPeriod && $util.isInteger(message.inAnyNDayPeriod.low) && $util.isInteger(message.inAnyNDayPeriod.high))) + return "inAnyNDayPeriod: integer|Long expected"; + } + return null; + }; + + /** + * Creates a SegmentParameterFilterScoping message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterScoping + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.SegmentParameterFilterScoping} SegmentParameterFilterScoping + */ + SegmentParameterFilterScoping.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.SegmentParameterFilterScoping) + return object; + var message = new $root.google.analytics.data.v1alpha.SegmentParameterFilterScoping(); + if (object.inAnyNDayPeriod != null) + if ($util.Long) + (message.inAnyNDayPeriod = $util.Long.fromValue(object.inAnyNDayPeriod)).unsigned = false; + else if (typeof object.inAnyNDayPeriod === "string") + message.inAnyNDayPeriod = parseInt(object.inAnyNDayPeriod, 10); + else if (typeof object.inAnyNDayPeriod === "number") + message.inAnyNDayPeriod = object.inAnyNDayPeriod; + else if (typeof object.inAnyNDayPeriod === "object") + message.inAnyNDayPeriod = new $util.LongBits(object.inAnyNDayPeriod.low >>> 0, object.inAnyNDayPeriod.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SegmentParameterFilterScoping message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterScoping + * @static + * @param {google.analytics.data.v1alpha.SegmentParameterFilterScoping} message SegmentParameterFilterScoping + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SegmentParameterFilterScoping.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.inAnyNDayPeriod != null && message.hasOwnProperty("inAnyNDayPeriod")) { + if (typeof message.inAnyNDayPeriod === "number") + object.inAnyNDayPeriod = options.longs === String ? String(message.inAnyNDayPeriod) : message.inAnyNDayPeriod; + else + object.inAnyNDayPeriod = options.longs === String ? $util.Long.prototype.toString.call(message.inAnyNDayPeriod) : options.longs === Number ? new $util.LongBits(message.inAnyNDayPeriod.low >>> 0, message.inAnyNDayPeriod.high >>> 0).toNumber() : message.inAnyNDayPeriod; + if (options.oneofs) + object._inAnyNDayPeriod = "inAnyNDayPeriod"; + } + return object; + }; + + /** + * Converts this SegmentParameterFilterScoping to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterScoping + * @instance + * @returns {Object.} JSON object + */ + SegmentParameterFilterScoping.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SegmentParameterFilterScoping + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.SegmentParameterFilterScoping + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SegmentParameterFilterScoping.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.SegmentParameterFilterScoping"; + }; + + return SegmentParameterFilterScoping; + })(); + + v1alpha.FunnelFilterExpression = (function() { + + /** + * Properties of a FunnelFilterExpression. + * @memberof google.analytics.data.v1alpha + * @interface IFunnelFilterExpression + * @property {google.analytics.data.v1alpha.IFunnelFilterExpressionList|null} [andGroup] FunnelFilterExpression andGroup + * @property {google.analytics.data.v1alpha.IFunnelFilterExpressionList|null} [orGroup] FunnelFilterExpression orGroup + * @property {google.analytics.data.v1alpha.IFunnelFilterExpression|null} [notExpression] FunnelFilterExpression notExpression + * @property {google.analytics.data.v1alpha.IFunnelFieldFilter|null} [funnelFieldFilter] FunnelFilterExpression funnelFieldFilter + * @property {google.analytics.data.v1alpha.IFunnelEventFilter|null} [funnelEventFilter] FunnelFilterExpression funnelEventFilter + */ + + /** + * Constructs a new FunnelFilterExpression. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a FunnelFilterExpression. + * @implements IFunnelFilterExpression + * @constructor + * @param {google.analytics.data.v1alpha.IFunnelFilterExpression=} [properties] Properties to set + */ + function FunnelFilterExpression(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]]; + } + + /** + * FunnelFilterExpression andGroup. + * @member {google.analytics.data.v1alpha.IFunnelFilterExpressionList|null|undefined} andGroup + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @instance + */ + FunnelFilterExpression.prototype.andGroup = null; + + /** + * FunnelFilterExpression orGroup. + * @member {google.analytics.data.v1alpha.IFunnelFilterExpressionList|null|undefined} orGroup + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @instance + */ + FunnelFilterExpression.prototype.orGroup = null; + + /** + * FunnelFilterExpression notExpression. + * @member {google.analytics.data.v1alpha.IFunnelFilterExpression|null|undefined} notExpression + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @instance + */ + FunnelFilterExpression.prototype.notExpression = null; + + /** + * FunnelFilterExpression funnelFieldFilter. + * @member {google.analytics.data.v1alpha.IFunnelFieldFilter|null|undefined} funnelFieldFilter + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @instance + */ + FunnelFilterExpression.prototype.funnelFieldFilter = null; + + /** + * FunnelFilterExpression funnelEventFilter. + * @member {google.analytics.data.v1alpha.IFunnelEventFilter|null|undefined} funnelEventFilter + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @instance + */ + FunnelFilterExpression.prototype.funnelEventFilter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FunnelFilterExpression expr. + * @member {"andGroup"|"orGroup"|"notExpression"|"funnelFieldFilter"|"funnelEventFilter"|undefined} expr + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @instance + */ + Object.defineProperty(FunnelFilterExpression.prototype, "expr", { + get: $util.oneOfGetter($oneOfFields = ["andGroup", "orGroup", "notExpression", "funnelFieldFilter", "funnelEventFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FunnelFilterExpression instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @static + * @param {google.analytics.data.v1alpha.IFunnelFilterExpression=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FunnelFilterExpression} FunnelFilterExpression instance + */ + FunnelFilterExpression.create = function create(properties) { + return new FunnelFilterExpression(properties); + }; + + /** + * Encodes the specified FunnelFilterExpression message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFilterExpression.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @static + * @param {google.analytics.data.v1alpha.IFunnelFilterExpression} message FunnelFilterExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelFilterExpression.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.andGroup != null && Object.hasOwnProperty.call(message, "andGroup")) + $root.google.analytics.data.v1alpha.FunnelFilterExpressionList.encode(message.andGroup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.orGroup != null && Object.hasOwnProperty.call(message, "orGroup")) + $root.google.analytics.data.v1alpha.FunnelFilterExpressionList.encode(message.orGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.notExpression != null && Object.hasOwnProperty.call(message, "notExpression")) + $root.google.analytics.data.v1alpha.FunnelFilterExpression.encode(message.notExpression, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.funnelFieldFilter != null && Object.hasOwnProperty.call(message, "funnelFieldFilter")) + $root.google.analytics.data.v1alpha.FunnelFieldFilter.encode(message.funnelFieldFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.funnelEventFilter != null && Object.hasOwnProperty.call(message, "funnelEventFilter")) + $root.google.analytics.data.v1alpha.FunnelEventFilter.encode(message.funnelEventFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunnelFilterExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFilterExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @static + * @param {google.analytics.data.v1alpha.IFunnelFilterExpression} message FunnelFilterExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelFilterExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunnelFilterExpression message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.FunnelFilterExpression} FunnelFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelFilterExpression.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FunnelFilterExpression(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.andGroup = $root.google.analytics.data.v1alpha.FunnelFilterExpressionList.decode(reader, reader.uint32()); + break; + } + case 2: { + message.orGroup = $root.google.analytics.data.v1alpha.FunnelFilterExpressionList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.notExpression = $root.google.analytics.data.v1alpha.FunnelFilterExpression.decode(reader, reader.uint32()); + break; + } + case 4: { + message.funnelFieldFilter = $root.google.analytics.data.v1alpha.FunnelFieldFilter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.funnelEventFilter = $root.google.analytics.data.v1alpha.FunnelEventFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunnelFilterExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.FunnelFilterExpression} FunnelFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelFilterExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunnelFilterExpression message. + * @function verify + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunnelFilterExpression.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.andGroup != null && message.hasOwnProperty("andGroup")) { + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.FunnelFilterExpressionList.verify(message.andGroup); + if (error) + return "andGroup." + error; + } + } + if (message.orGroup != null && message.hasOwnProperty("orGroup")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.FunnelFilterExpressionList.verify(message.orGroup); + if (error) + return "orGroup." + error; + } + } + if (message.notExpression != null && message.hasOwnProperty("notExpression")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.FunnelFilterExpression.verify(message.notExpression); + if (error) + return "notExpression." + error; + } + } + if (message.funnelFieldFilter != null && message.hasOwnProperty("funnelFieldFilter")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.FunnelFieldFilter.verify(message.funnelFieldFilter); + if (error) + return "funnelFieldFilter." + error; + } + } + if (message.funnelEventFilter != null && message.hasOwnProperty("funnelEventFilter")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.FunnelEventFilter.verify(message.funnelEventFilter); + if (error) + return "funnelEventFilter." + error; + } + } + return null; + }; + + /** + * Creates a FunnelFilterExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.FunnelFilterExpression} FunnelFilterExpression + */ + FunnelFilterExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FunnelFilterExpression) + return object; + var message = new $root.google.analytics.data.v1alpha.FunnelFilterExpression(); + if (object.andGroup != null) { + if (typeof object.andGroup !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelFilterExpression.andGroup: object expected"); + message.andGroup = $root.google.analytics.data.v1alpha.FunnelFilterExpressionList.fromObject(object.andGroup); + } + if (object.orGroup != null) { + if (typeof object.orGroup !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelFilterExpression.orGroup: object expected"); + message.orGroup = $root.google.analytics.data.v1alpha.FunnelFilterExpressionList.fromObject(object.orGroup); + } + if (object.notExpression != null) { + if (typeof object.notExpression !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelFilterExpression.notExpression: object expected"); + message.notExpression = $root.google.analytics.data.v1alpha.FunnelFilterExpression.fromObject(object.notExpression); + } + if (object.funnelFieldFilter != null) { + if (typeof object.funnelFieldFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelFilterExpression.funnelFieldFilter: object expected"); + message.funnelFieldFilter = $root.google.analytics.data.v1alpha.FunnelFieldFilter.fromObject(object.funnelFieldFilter); + } + if (object.funnelEventFilter != null) { + if (typeof object.funnelEventFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelFilterExpression.funnelEventFilter: object expected"); + message.funnelEventFilter = $root.google.analytics.data.v1alpha.FunnelEventFilter.fromObject(object.funnelEventFilter); + } + return message; + }; + + /** + * Creates a plain object from a FunnelFilterExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @static + * @param {google.analytics.data.v1alpha.FunnelFilterExpression} message FunnelFilterExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunnelFilterExpression.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.andGroup != null && message.hasOwnProperty("andGroup")) { + object.andGroup = $root.google.analytics.data.v1alpha.FunnelFilterExpressionList.toObject(message.andGroup, options); + if (options.oneofs) + object.expr = "andGroup"; + } + if (message.orGroup != null && message.hasOwnProperty("orGroup")) { + object.orGroup = $root.google.analytics.data.v1alpha.FunnelFilterExpressionList.toObject(message.orGroup, options); + if (options.oneofs) + object.expr = "orGroup"; + } + if (message.notExpression != null && message.hasOwnProperty("notExpression")) { + object.notExpression = $root.google.analytics.data.v1alpha.FunnelFilterExpression.toObject(message.notExpression, options); + if (options.oneofs) + object.expr = "notExpression"; + } + if (message.funnelFieldFilter != null && message.hasOwnProperty("funnelFieldFilter")) { + object.funnelFieldFilter = $root.google.analytics.data.v1alpha.FunnelFieldFilter.toObject(message.funnelFieldFilter, options); + if (options.oneofs) + object.expr = "funnelFieldFilter"; + } + if (message.funnelEventFilter != null && message.hasOwnProperty("funnelEventFilter")) { + object.funnelEventFilter = $root.google.analytics.data.v1alpha.FunnelEventFilter.toObject(message.funnelEventFilter, options); + if (options.oneofs) + object.expr = "funnelEventFilter"; + } + return object; + }; + + /** + * Converts this FunnelFilterExpression to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @instance + * @returns {Object.} JSON object + */ + FunnelFilterExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunnelFilterExpression + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.FunnelFilterExpression + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunnelFilterExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.FunnelFilterExpression"; + }; + + return FunnelFilterExpression; + })(); + + v1alpha.FunnelFilterExpressionList = (function() { + + /** + * Properties of a FunnelFilterExpressionList. + * @memberof google.analytics.data.v1alpha + * @interface IFunnelFilterExpressionList + * @property {Array.|null} [expressions] FunnelFilterExpressionList expressions + */ + + /** + * Constructs a new FunnelFilterExpressionList. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a FunnelFilterExpressionList. + * @implements IFunnelFilterExpressionList + * @constructor + * @param {google.analytics.data.v1alpha.IFunnelFilterExpressionList=} [properties] Properties to set + */ + function FunnelFilterExpressionList(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]]; + } + + /** + * FunnelFilterExpressionList expressions. + * @member {Array.} expressions + * @memberof google.analytics.data.v1alpha.FunnelFilterExpressionList + * @instance + */ + FunnelFilterExpressionList.prototype.expressions = $util.emptyArray; + + /** + * Creates a new FunnelFilterExpressionList instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.FunnelFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.IFunnelFilterExpressionList=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FunnelFilterExpressionList} FunnelFilterExpressionList instance + */ + FunnelFilterExpressionList.create = function create(properties) { + return new FunnelFilterExpressionList(properties); + }; + + /** + * Encodes the specified FunnelFilterExpressionList message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFilterExpressionList.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.FunnelFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.IFunnelFilterExpressionList} message FunnelFilterExpressionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelFilterExpressionList.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.data.v1alpha.FunnelFilterExpression.encode(message.expressions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunnelFilterExpressionList message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFilterExpressionList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.IFunnelFilterExpressionList} message FunnelFilterExpressionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelFilterExpressionList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunnelFilterExpressionList message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.FunnelFilterExpressionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.FunnelFilterExpressionList} FunnelFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelFilterExpressionList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FunnelFilterExpressionList(); + 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.data.v1alpha.FunnelFilterExpression.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunnelFilterExpressionList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelFilterExpressionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.FunnelFilterExpressionList} FunnelFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelFilterExpressionList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunnelFilterExpressionList message. + * @function verify + * @memberof google.analytics.data.v1alpha.FunnelFilterExpressionList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunnelFilterExpressionList.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.data.v1alpha.FunnelFilterExpression.verify(message.expressions[i]); + if (error) + return "expressions." + error; + } + } + return null; + }; + + /** + * Creates a FunnelFilterExpressionList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.FunnelFilterExpressionList + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.FunnelFilterExpressionList} FunnelFilterExpressionList + */ + FunnelFilterExpressionList.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FunnelFilterExpressionList) + return object; + var message = new $root.google.analytics.data.v1alpha.FunnelFilterExpressionList(); + if (object.expressions) { + if (!Array.isArray(object.expressions)) + throw TypeError(".google.analytics.data.v1alpha.FunnelFilterExpressionList.expressions: array expected"); + message.expressions = []; + for (var i = 0; i < object.expressions.length; ++i) { + if (typeof object.expressions[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelFilterExpressionList.expressions: object expected"); + message.expressions[i] = $root.google.analytics.data.v1alpha.FunnelFilterExpression.fromObject(object.expressions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FunnelFilterExpressionList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.FunnelFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.FunnelFilterExpressionList} message FunnelFilterExpressionList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunnelFilterExpressionList.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.data.v1alpha.FunnelFilterExpression.toObject(message.expressions[j], options); + } + return object; + }; + + /** + * Converts this FunnelFilterExpressionList to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.FunnelFilterExpressionList + * @instance + * @returns {Object.} JSON object + */ + FunnelFilterExpressionList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunnelFilterExpressionList + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.FunnelFilterExpressionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunnelFilterExpressionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.FunnelFilterExpressionList"; + }; + + return FunnelFilterExpressionList; + })(); + + v1alpha.FunnelFieldFilter = (function() { + + /** + * Properties of a FunnelFieldFilter. + * @memberof google.analytics.data.v1alpha + * @interface IFunnelFieldFilter + * @property {string|null} [fieldName] FunnelFieldFilter fieldName + * @property {google.analytics.data.v1alpha.IStringFilter|null} [stringFilter] FunnelFieldFilter stringFilter + * @property {google.analytics.data.v1alpha.IInListFilter|null} [inListFilter] FunnelFieldFilter inListFilter + * @property {google.analytics.data.v1alpha.INumericFilter|null} [numericFilter] FunnelFieldFilter numericFilter + * @property {google.analytics.data.v1alpha.IBetweenFilter|null} [betweenFilter] FunnelFieldFilter betweenFilter + */ + + /** + * Constructs a new FunnelFieldFilter. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a FunnelFieldFilter. + * @implements IFunnelFieldFilter + * @constructor + * @param {google.analytics.data.v1alpha.IFunnelFieldFilter=} [properties] Properties to set + */ + function FunnelFieldFilter(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]]; + } + + /** + * FunnelFieldFilter fieldName. + * @member {string} fieldName + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @instance + */ + FunnelFieldFilter.prototype.fieldName = ""; + + /** + * FunnelFieldFilter stringFilter. + * @member {google.analytics.data.v1alpha.IStringFilter|null|undefined} stringFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @instance + */ + FunnelFieldFilter.prototype.stringFilter = null; + + /** + * FunnelFieldFilter inListFilter. + * @member {google.analytics.data.v1alpha.IInListFilter|null|undefined} inListFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @instance + */ + FunnelFieldFilter.prototype.inListFilter = null; + + /** + * FunnelFieldFilter numericFilter. + * @member {google.analytics.data.v1alpha.INumericFilter|null|undefined} numericFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @instance + */ + FunnelFieldFilter.prototype.numericFilter = null; + + /** + * FunnelFieldFilter betweenFilter. + * @member {google.analytics.data.v1alpha.IBetweenFilter|null|undefined} betweenFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @instance + */ + FunnelFieldFilter.prototype.betweenFilter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FunnelFieldFilter oneFilter. + * @member {"stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"|undefined} oneFilter + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @instance + */ + Object.defineProperty(FunnelFieldFilter.prototype, "oneFilter", { + get: $util.oneOfGetter($oneOfFields = ["stringFilter", "inListFilter", "numericFilter", "betweenFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FunnelFieldFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @static + * @param {google.analytics.data.v1alpha.IFunnelFieldFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FunnelFieldFilter} FunnelFieldFilter instance + */ + FunnelFieldFilter.create = function create(properties) { + return new FunnelFieldFilter(properties); + }; + + /** + * Encodes the specified FunnelFieldFilter message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFieldFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @static + * @param {google.analytics.data.v1alpha.IFunnelFieldFilter} message FunnelFieldFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelFieldFilter.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.data.v1alpha.StringFilter.encode(message.stringFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inListFilter != null && Object.hasOwnProperty.call(message, "inListFilter")) + $root.google.analytics.data.v1alpha.InListFilter.encode(message.inListFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.numericFilter != null && Object.hasOwnProperty.call(message, "numericFilter")) + $root.google.analytics.data.v1alpha.NumericFilter.encode(message.numericFilter, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.betweenFilter != null && Object.hasOwnProperty.call(message, "betweenFilter")) + $root.google.analytics.data.v1alpha.BetweenFilter.encode(message.betweenFilter, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunnelFieldFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelFieldFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @static + * @param {google.analytics.data.v1alpha.IFunnelFieldFilter} message FunnelFieldFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelFieldFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunnelFieldFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.FunnelFieldFilter} FunnelFieldFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelFieldFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FunnelFieldFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldName = reader.string(); + break; + } + case 4: { + message.stringFilter = $root.google.analytics.data.v1alpha.StringFilter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.decode(reader, reader.uint32()); + break; + } + case 6: { + message.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.decode(reader, reader.uint32()); + break; + } + case 7: { + message.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunnelFieldFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.FunnelFieldFilter} FunnelFieldFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelFieldFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunnelFieldFilter message. + * @function verify + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunnelFieldFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.stringFilter != null && message.hasOwnProperty("stringFilter")) { + properties.oneFilter = 1; + { + var error = $root.google.analytics.data.v1alpha.StringFilter.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.data.v1alpha.InListFilter.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.data.v1alpha.NumericFilter.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.data.v1alpha.BetweenFilter.verify(message.betweenFilter); + if (error) + return "betweenFilter." + error; + } + } + return null; + }; + + /** + * Creates a FunnelFieldFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.FunnelFieldFilter} FunnelFieldFilter + */ + FunnelFieldFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FunnelFieldFilter) + return object; + var message = new $root.google.analytics.data.v1alpha.FunnelFieldFilter(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + if (object.stringFilter != null) { + if (typeof object.stringFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelFieldFilter.stringFilter: object expected"); + message.stringFilter = $root.google.analytics.data.v1alpha.StringFilter.fromObject(object.stringFilter); + } + if (object.inListFilter != null) { + if (typeof object.inListFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelFieldFilter.inListFilter: object expected"); + message.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.fromObject(object.inListFilter); + } + if (object.numericFilter != null) { + if (typeof object.numericFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelFieldFilter.numericFilter: object expected"); + message.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.fromObject(object.numericFilter); + } + if (object.betweenFilter != null) { + if (typeof object.betweenFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelFieldFilter.betweenFilter: object expected"); + message.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.fromObject(object.betweenFilter); + } + return message; + }; + + /** + * Creates a plain object from a FunnelFieldFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @static + * @param {google.analytics.data.v1alpha.FunnelFieldFilter} message FunnelFieldFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunnelFieldFilter.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.data.v1alpha.StringFilter.toObject(message.stringFilter, options); + if (options.oneofs) + object.oneFilter = "stringFilter"; + } + if (message.inListFilter != null && message.hasOwnProperty("inListFilter")) { + object.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.toObject(message.inListFilter, options); + if (options.oneofs) + object.oneFilter = "inListFilter"; + } + if (message.numericFilter != null && message.hasOwnProperty("numericFilter")) { + object.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.toObject(message.numericFilter, options); + if (options.oneofs) + object.oneFilter = "numericFilter"; + } + if (message.betweenFilter != null && message.hasOwnProperty("betweenFilter")) { + object.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.toObject(message.betweenFilter, options); + if (options.oneofs) + object.oneFilter = "betweenFilter"; + } + return object; + }; + + /** + * Converts this FunnelFieldFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @instance + * @returns {Object.} JSON object + */ + FunnelFieldFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunnelFieldFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.FunnelFieldFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunnelFieldFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.FunnelFieldFilter"; + }; + + return FunnelFieldFilter; + })(); + + v1alpha.FunnelEventFilter = (function() { + + /** + * Properties of a FunnelEventFilter. + * @memberof google.analytics.data.v1alpha + * @interface IFunnelEventFilter + * @property {string|null} [eventName] FunnelEventFilter eventName + * @property {google.analytics.data.v1alpha.IFunnelParameterFilterExpression|null} [funnelParameterFilterExpression] FunnelEventFilter funnelParameterFilterExpression + */ + + /** + * Constructs a new FunnelEventFilter. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a FunnelEventFilter. + * @implements IFunnelEventFilter + * @constructor + * @param {google.analytics.data.v1alpha.IFunnelEventFilter=} [properties] Properties to set + */ + function FunnelEventFilter(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]]; + } + + /** + * FunnelEventFilter eventName. + * @member {string|null|undefined} eventName + * @memberof google.analytics.data.v1alpha.FunnelEventFilter + * @instance + */ + FunnelEventFilter.prototype.eventName = null; + + /** + * FunnelEventFilter funnelParameterFilterExpression. + * @member {google.analytics.data.v1alpha.IFunnelParameterFilterExpression|null|undefined} funnelParameterFilterExpression + * @memberof google.analytics.data.v1alpha.FunnelEventFilter + * @instance + */ + FunnelEventFilter.prototype.funnelParameterFilterExpression = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FunnelEventFilter _eventName. + * @member {"eventName"|undefined} _eventName + * @memberof google.analytics.data.v1alpha.FunnelEventFilter + * @instance + */ + Object.defineProperty(FunnelEventFilter.prototype, "_eventName", { + get: $util.oneOfGetter($oneOfFields = ["eventName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FunnelEventFilter _funnelParameterFilterExpression. + * @member {"funnelParameterFilterExpression"|undefined} _funnelParameterFilterExpression + * @memberof google.analytics.data.v1alpha.FunnelEventFilter + * @instance + */ + Object.defineProperty(FunnelEventFilter.prototype, "_funnelParameterFilterExpression", { + get: $util.oneOfGetter($oneOfFields = ["funnelParameterFilterExpression"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FunnelEventFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.FunnelEventFilter + * @static + * @param {google.analytics.data.v1alpha.IFunnelEventFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FunnelEventFilter} FunnelEventFilter instance + */ + FunnelEventFilter.create = function create(properties) { + return new FunnelEventFilter(properties); + }; + + /** + * Encodes the specified FunnelEventFilter message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelEventFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.FunnelEventFilter + * @static + * @param {google.analytics.data.v1alpha.IFunnelEventFilter} message FunnelEventFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelEventFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventName != null && Object.hasOwnProperty.call(message, "eventName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventName); + if (message.funnelParameterFilterExpression != null && Object.hasOwnProperty.call(message, "funnelParameterFilterExpression")) + $root.google.analytics.data.v1alpha.FunnelParameterFilterExpression.encode(message.funnelParameterFilterExpression, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunnelEventFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelEventFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelEventFilter + * @static + * @param {google.analytics.data.v1alpha.IFunnelEventFilter} message FunnelEventFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelEventFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunnelEventFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.FunnelEventFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.FunnelEventFilter} FunnelEventFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelEventFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FunnelEventFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.eventName = reader.string(); + break; + } + case 2: { + message.funnelParameterFilterExpression = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpression.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunnelEventFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelEventFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.FunnelEventFilter} FunnelEventFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelEventFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunnelEventFilter message. + * @function verify + * @memberof google.analytics.data.v1alpha.FunnelEventFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunnelEventFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.eventName != null && message.hasOwnProperty("eventName")) { + properties._eventName = 1; + if (!$util.isString(message.eventName)) + return "eventName: string expected"; + } + if (message.funnelParameterFilterExpression != null && message.hasOwnProperty("funnelParameterFilterExpression")) { + properties._funnelParameterFilterExpression = 1; + { + var error = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpression.verify(message.funnelParameterFilterExpression); + if (error) + return "funnelParameterFilterExpression." + error; + } + } + return null; + }; + + /** + * Creates a FunnelEventFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.FunnelEventFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.FunnelEventFilter} FunnelEventFilter + */ + FunnelEventFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FunnelEventFilter) + return object; + var message = new $root.google.analytics.data.v1alpha.FunnelEventFilter(); + if (object.eventName != null) + message.eventName = String(object.eventName); + if (object.funnelParameterFilterExpression != null) { + if (typeof object.funnelParameterFilterExpression !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelEventFilter.funnelParameterFilterExpression: object expected"); + message.funnelParameterFilterExpression = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpression.fromObject(object.funnelParameterFilterExpression); + } + return message; + }; + + /** + * Creates a plain object from a FunnelEventFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.FunnelEventFilter + * @static + * @param {google.analytics.data.v1alpha.FunnelEventFilter} message FunnelEventFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunnelEventFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.eventName != null && message.hasOwnProperty("eventName")) { + object.eventName = message.eventName; + if (options.oneofs) + object._eventName = "eventName"; + } + if (message.funnelParameterFilterExpression != null && message.hasOwnProperty("funnelParameterFilterExpression")) { + object.funnelParameterFilterExpression = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpression.toObject(message.funnelParameterFilterExpression, options); + if (options.oneofs) + object._funnelParameterFilterExpression = "funnelParameterFilterExpression"; + } + return object; + }; + + /** + * Converts this FunnelEventFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.FunnelEventFilter + * @instance + * @returns {Object.} JSON object + */ + FunnelEventFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunnelEventFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.FunnelEventFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunnelEventFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.FunnelEventFilter"; + }; + + return FunnelEventFilter; + })(); + + v1alpha.FunnelParameterFilterExpression = (function() { + + /** + * Properties of a FunnelParameterFilterExpression. + * @memberof google.analytics.data.v1alpha + * @interface IFunnelParameterFilterExpression + * @property {google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList|null} [andGroup] FunnelParameterFilterExpression andGroup + * @property {google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList|null} [orGroup] FunnelParameterFilterExpression orGroup + * @property {google.analytics.data.v1alpha.IFunnelParameterFilterExpression|null} [notExpression] FunnelParameterFilterExpression notExpression + * @property {google.analytics.data.v1alpha.IFunnelParameterFilter|null} [funnelParameterFilter] FunnelParameterFilterExpression funnelParameterFilter + */ + + /** + * Constructs a new FunnelParameterFilterExpression. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a FunnelParameterFilterExpression. + * @implements IFunnelParameterFilterExpression + * @constructor + * @param {google.analytics.data.v1alpha.IFunnelParameterFilterExpression=} [properties] Properties to set + */ + function FunnelParameterFilterExpression(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]]; + } + + /** + * FunnelParameterFilterExpression andGroup. + * @member {google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList|null|undefined} andGroup + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @instance + */ + FunnelParameterFilterExpression.prototype.andGroup = null; + + /** + * FunnelParameterFilterExpression orGroup. + * @member {google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList|null|undefined} orGroup + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @instance + */ + FunnelParameterFilterExpression.prototype.orGroup = null; + + /** + * FunnelParameterFilterExpression notExpression. + * @member {google.analytics.data.v1alpha.IFunnelParameterFilterExpression|null|undefined} notExpression + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @instance + */ + FunnelParameterFilterExpression.prototype.notExpression = null; + + /** + * FunnelParameterFilterExpression funnelParameterFilter. + * @member {google.analytics.data.v1alpha.IFunnelParameterFilter|null|undefined} funnelParameterFilter + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @instance + */ + FunnelParameterFilterExpression.prototype.funnelParameterFilter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FunnelParameterFilterExpression expr. + * @member {"andGroup"|"orGroup"|"notExpression"|"funnelParameterFilter"|undefined} expr + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @instance + */ + Object.defineProperty(FunnelParameterFilterExpression.prototype, "expr", { + get: $util.oneOfGetter($oneOfFields = ["andGroup", "orGroup", "notExpression", "funnelParameterFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FunnelParameterFilterExpression instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @static + * @param {google.analytics.data.v1alpha.IFunnelParameterFilterExpression=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FunnelParameterFilterExpression} FunnelParameterFilterExpression instance + */ + FunnelParameterFilterExpression.create = function create(properties) { + return new FunnelParameterFilterExpression(properties); + }; + + /** + * Encodes the specified FunnelParameterFilterExpression message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelParameterFilterExpression.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @static + * @param {google.analytics.data.v1alpha.IFunnelParameterFilterExpression} message FunnelParameterFilterExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelParameterFilterExpression.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.andGroup != null && Object.hasOwnProperty.call(message, "andGroup")) + $root.google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.encode(message.andGroup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.orGroup != null && Object.hasOwnProperty.call(message, "orGroup")) + $root.google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.encode(message.orGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.notExpression != null && Object.hasOwnProperty.call(message, "notExpression")) + $root.google.analytics.data.v1alpha.FunnelParameterFilterExpression.encode(message.notExpression, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.funnelParameterFilter != null && Object.hasOwnProperty.call(message, "funnelParameterFilter")) + $root.google.analytics.data.v1alpha.FunnelParameterFilter.encode(message.funnelParameterFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunnelParameterFilterExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelParameterFilterExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @static + * @param {google.analytics.data.v1alpha.IFunnelParameterFilterExpression} message FunnelParameterFilterExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelParameterFilterExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunnelParameterFilterExpression message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.FunnelParameterFilterExpression} FunnelParameterFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelParameterFilterExpression.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FunnelParameterFilterExpression(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.andGroup = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.decode(reader, reader.uint32()); + break; + } + case 2: { + message.orGroup = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.notExpression = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpression.decode(reader, reader.uint32()); + break; + } + case 4: { + message.funnelParameterFilter = $root.google.analytics.data.v1alpha.FunnelParameterFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunnelParameterFilterExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.FunnelParameterFilterExpression} FunnelParameterFilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelParameterFilterExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunnelParameterFilterExpression message. + * @function verify + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunnelParameterFilterExpression.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.andGroup != null && message.hasOwnProperty("andGroup")) { + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.verify(message.andGroup); + if (error) + return "andGroup." + error; + } + } + if (message.orGroup != null && message.hasOwnProperty("orGroup")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.verify(message.orGroup); + if (error) + return "orGroup." + error; + } + } + if (message.notExpression != null && message.hasOwnProperty("notExpression")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpression.verify(message.notExpression); + if (error) + return "notExpression." + error; + } + } + if (message.funnelParameterFilter != null && message.hasOwnProperty("funnelParameterFilter")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1alpha.FunnelParameterFilter.verify(message.funnelParameterFilter); + if (error) + return "funnelParameterFilter." + error; + } + } + return null; + }; + + /** + * Creates a FunnelParameterFilterExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.FunnelParameterFilterExpression} FunnelParameterFilterExpression + */ + FunnelParameterFilterExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FunnelParameterFilterExpression) + return object; + var message = new $root.google.analytics.data.v1alpha.FunnelParameterFilterExpression(); + if (object.andGroup != null) { + if (typeof object.andGroup !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelParameterFilterExpression.andGroup: object expected"); + message.andGroup = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.fromObject(object.andGroup); + } + if (object.orGroup != null) { + if (typeof object.orGroup !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelParameterFilterExpression.orGroup: object expected"); + message.orGroup = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.fromObject(object.orGroup); + } + if (object.notExpression != null) { + if (typeof object.notExpression !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelParameterFilterExpression.notExpression: object expected"); + message.notExpression = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpression.fromObject(object.notExpression); + } + if (object.funnelParameterFilter != null) { + if (typeof object.funnelParameterFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelParameterFilterExpression.funnelParameterFilter: object expected"); + message.funnelParameterFilter = $root.google.analytics.data.v1alpha.FunnelParameterFilter.fromObject(object.funnelParameterFilter); + } + return message; + }; + + /** + * Creates a plain object from a FunnelParameterFilterExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @static + * @param {google.analytics.data.v1alpha.FunnelParameterFilterExpression} message FunnelParameterFilterExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunnelParameterFilterExpression.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.andGroup != null && message.hasOwnProperty("andGroup")) { + object.andGroup = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.toObject(message.andGroup, options); + if (options.oneofs) + object.expr = "andGroup"; + } + if (message.orGroup != null && message.hasOwnProperty("orGroup")) { + object.orGroup = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.toObject(message.orGroup, options); + if (options.oneofs) + object.expr = "orGroup"; + } + if (message.notExpression != null && message.hasOwnProperty("notExpression")) { + object.notExpression = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpression.toObject(message.notExpression, options); + if (options.oneofs) + object.expr = "notExpression"; + } + if (message.funnelParameterFilter != null && message.hasOwnProperty("funnelParameterFilter")) { + object.funnelParameterFilter = $root.google.analytics.data.v1alpha.FunnelParameterFilter.toObject(message.funnelParameterFilter, options); + if (options.oneofs) + object.expr = "funnelParameterFilter"; + } + return object; + }; + + /** + * Converts this FunnelParameterFilterExpression to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @instance + * @returns {Object.} JSON object + */ + FunnelParameterFilterExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunnelParameterFilterExpression + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpression + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunnelParameterFilterExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.FunnelParameterFilterExpression"; + }; + + return FunnelParameterFilterExpression; + })(); + + v1alpha.FunnelParameterFilterExpressionList = (function() { + + /** + * Properties of a FunnelParameterFilterExpressionList. + * @memberof google.analytics.data.v1alpha + * @interface IFunnelParameterFilterExpressionList + * @property {Array.|null} [expressions] FunnelParameterFilterExpressionList expressions + */ + + /** + * Constructs a new FunnelParameterFilterExpressionList. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a FunnelParameterFilterExpressionList. + * @implements IFunnelParameterFilterExpressionList + * @constructor + * @param {google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList=} [properties] Properties to set + */ + function FunnelParameterFilterExpressionList(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]]; + } + + /** + * FunnelParameterFilterExpressionList expressions. + * @member {Array.} expressions + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpressionList + * @instance + */ + FunnelParameterFilterExpressionList.prototype.expressions = $util.emptyArray; + + /** + * Creates a new FunnelParameterFilterExpressionList instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FunnelParameterFilterExpressionList} FunnelParameterFilterExpressionList instance + */ + FunnelParameterFilterExpressionList.create = function create(properties) { + return new FunnelParameterFilterExpressionList(properties); + }; + + /** + * Encodes the specified FunnelParameterFilterExpressionList message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList} message FunnelParameterFilterExpressionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelParameterFilterExpressionList.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.data.v1alpha.FunnelParameterFilterExpression.encode(message.expressions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunnelParameterFilterExpressionList message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.IFunnelParameterFilterExpressionList} message FunnelParameterFilterExpressionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelParameterFilterExpressionList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunnelParameterFilterExpressionList message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpressionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.FunnelParameterFilterExpressionList} FunnelParameterFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelParameterFilterExpressionList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FunnelParameterFilterExpressionList(); + 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.data.v1alpha.FunnelParameterFilterExpression.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunnelParameterFilterExpressionList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpressionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.FunnelParameterFilterExpressionList} FunnelParameterFilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelParameterFilterExpressionList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunnelParameterFilterExpressionList message. + * @function verify + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpressionList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunnelParameterFilterExpressionList.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.data.v1alpha.FunnelParameterFilterExpression.verify(message.expressions[i]); + if (error) + return "expressions." + error; + } + } + return null; + }; + + /** + * Creates a FunnelParameterFilterExpressionList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpressionList + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.FunnelParameterFilterExpressionList} FunnelParameterFilterExpressionList + */ + FunnelParameterFilterExpressionList.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FunnelParameterFilterExpressionList) + return object; + var message = new $root.google.analytics.data.v1alpha.FunnelParameterFilterExpressionList(); + if (object.expressions) { + if (!Array.isArray(object.expressions)) + throw TypeError(".google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.expressions: array expected"); + message.expressions = []; + for (var i = 0; i < object.expressions.length; ++i) { + if (typeof object.expressions[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelParameterFilterExpressionList.expressions: object expected"); + message.expressions[i] = $root.google.analytics.data.v1alpha.FunnelParameterFilterExpression.fromObject(object.expressions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FunnelParameterFilterExpressionList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpressionList + * @static + * @param {google.analytics.data.v1alpha.FunnelParameterFilterExpressionList} message FunnelParameterFilterExpressionList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunnelParameterFilterExpressionList.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.data.v1alpha.FunnelParameterFilterExpression.toObject(message.expressions[j], options); + } + return object; + }; + + /** + * Converts this FunnelParameterFilterExpressionList to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpressionList + * @instance + * @returns {Object.} JSON object + */ + FunnelParameterFilterExpressionList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunnelParameterFilterExpressionList + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.FunnelParameterFilterExpressionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunnelParameterFilterExpressionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.FunnelParameterFilterExpressionList"; + }; + + return FunnelParameterFilterExpressionList; + })(); + + v1alpha.FunnelParameterFilter = (function() { + + /** + * Properties of a FunnelParameterFilter. + * @memberof google.analytics.data.v1alpha + * @interface IFunnelParameterFilter + * @property {string|null} [eventParameterName] FunnelParameterFilter eventParameterName + * @property {string|null} [itemParameterName] FunnelParameterFilter itemParameterName + * @property {google.analytics.data.v1alpha.IStringFilter|null} [stringFilter] FunnelParameterFilter stringFilter + * @property {google.analytics.data.v1alpha.IInListFilter|null} [inListFilter] FunnelParameterFilter inListFilter + * @property {google.analytics.data.v1alpha.INumericFilter|null} [numericFilter] FunnelParameterFilter numericFilter + * @property {google.analytics.data.v1alpha.IBetweenFilter|null} [betweenFilter] FunnelParameterFilter betweenFilter + */ + + /** + * Constructs a new FunnelParameterFilter. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a FunnelParameterFilter. + * @implements IFunnelParameterFilter + * @constructor + * @param {google.analytics.data.v1alpha.IFunnelParameterFilter=} [properties] Properties to set + */ + function FunnelParameterFilter(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]]; + } + + /** + * FunnelParameterFilter eventParameterName. + * @member {string|null|undefined} eventParameterName + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @instance + */ + FunnelParameterFilter.prototype.eventParameterName = null; + + /** + * FunnelParameterFilter itemParameterName. + * @member {string|null|undefined} itemParameterName + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @instance + */ + FunnelParameterFilter.prototype.itemParameterName = null; + + /** + * FunnelParameterFilter stringFilter. + * @member {google.analytics.data.v1alpha.IStringFilter|null|undefined} stringFilter + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @instance + */ + FunnelParameterFilter.prototype.stringFilter = null; + + /** + * FunnelParameterFilter inListFilter. + * @member {google.analytics.data.v1alpha.IInListFilter|null|undefined} inListFilter + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @instance + */ + FunnelParameterFilter.prototype.inListFilter = null; + + /** + * FunnelParameterFilter numericFilter. + * @member {google.analytics.data.v1alpha.INumericFilter|null|undefined} numericFilter + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @instance + */ + FunnelParameterFilter.prototype.numericFilter = null; + + /** + * FunnelParameterFilter betweenFilter. + * @member {google.analytics.data.v1alpha.IBetweenFilter|null|undefined} betweenFilter + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @instance + */ + FunnelParameterFilter.prototype.betweenFilter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FunnelParameterFilter oneParameter. + * @member {"eventParameterName"|"itemParameterName"|undefined} oneParameter + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @instance + */ + Object.defineProperty(FunnelParameterFilter.prototype, "oneParameter", { + get: $util.oneOfGetter($oneOfFields = ["eventParameterName", "itemParameterName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FunnelParameterFilter oneFilter. + * @member {"stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"|undefined} oneFilter + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @instance + */ + Object.defineProperty(FunnelParameterFilter.prototype, "oneFilter", { + get: $util.oneOfGetter($oneOfFields = ["stringFilter", "inListFilter", "numericFilter", "betweenFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FunnelParameterFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @static + * @param {google.analytics.data.v1alpha.IFunnelParameterFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FunnelParameterFilter} FunnelParameterFilter instance + */ + FunnelParameterFilter.create = function create(properties) { + return new FunnelParameterFilter(properties); + }; + + /** + * Encodes the specified FunnelParameterFilter message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelParameterFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @static + * @param {google.analytics.data.v1alpha.IFunnelParameterFilter} message FunnelParameterFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelParameterFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventParameterName != null && Object.hasOwnProperty.call(message, "eventParameterName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventParameterName); + if (message.itemParameterName != null && Object.hasOwnProperty.call(message, "itemParameterName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.itemParameterName); + if (message.stringFilter != null && Object.hasOwnProperty.call(message, "stringFilter")) + $root.google.analytics.data.v1alpha.StringFilter.encode(message.stringFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inListFilter != null && Object.hasOwnProperty.call(message, "inListFilter")) + $root.google.analytics.data.v1alpha.InListFilter.encode(message.inListFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.numericFilter != null && Object.hasOwnProperty.call(message, "numericFilter")) + $root.google.analytics.data.v1alpha.NumericFilter.encode(message.numericFilter, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.betweenFilter != null && Object.hasOwnProperty.call(message, "betweenFilter")) + $root.google.analytics.data.v1alpha.BetweenFilter.encode(message.betweenFilter, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunnelParameterFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelParameterFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @static + * @param {google.analytics.data.v1alpha.IFunnelParameterFilter} message FunnelParameterFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelParameterFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunnelParameterFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.FunnelParameterFilter} FunnelParameterFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelParameterFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FunnelParameterFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.eventParameterName = reader.string(); + break; + } + case 2: { + message.itemParameterName = reader.string(); + break; + } + case 4: { + message.stringFilter = $root.google.analytics.data.v1alpha.StringFilter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.decode(reader, reader.uint32()); + break; + } + case 6: { + message.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.decode(reader, reader.uint32()); + break; + } + case 7: { + message.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunnelParameterFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.FunnelParameterFilter} FunnelParameterFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelParameterFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunnelParameterFilter message. + * @function verify + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunnelParameterFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.eventParameterName != null && message.hasOwnProperty("eventParameterName")) { + properties.oneParameter = 1; + if (!$util.isString(message.eventParameterName)) + return "eventParameterName: string expected"; + } + if (message.itemParameterName != null && message.hasOwnProperty("itemParameterName")) { + if (properties.oneParameter === 1) + return "oneParameter: multiple values"; + properties.oneParameter = 1; + if (!$util.isString(message.itemParameterName)) + return "itemParameterName: string expected"; + } + if (message.stringFilter != null && message.hasOwnProperty("stringFilter")) { + properties.oneFilter = 1; + { + var error = $root.google.analytics.data.v1alpha.StringFilter.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.data.v1alpha.InListFilter.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.data.v1alpha.NumericFilter.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.data.v1alpha.BetweenFilter.verify(message.betweenFilter); + if (error) + return "betweenFilter." + error; + } + } + return null; + }; + + /** + * Creates a FunnelParameterFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.FunnelParameterFilter} FunnelParameterFilter + */ + FunnelParameterFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FunnelParameterFilter) + return object; + var message = new $root.google.analytics.data.v1alpha.FunnelParameterFilter(); + if (object.eventParameterName != null) + message.eventParameterName = String(object.eventParameterName); + if (object.itemParameterName != null) + message.itemParameterName = String(object.itemParameterName); + if (object.stringFilter != null) { + if (typeof object.stringFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelParameterFilter.stringFilter: object expected"); + message.stringFilter = $root.google.analytics.data.v1alpha.StringFilter.fromObject(object.stringFilter); + } + if (object.inListFilter != null) { + if (typeof object.inListFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelParameterFilter.inListFilter: object expected"); + message.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.fromObject(object.inListFilter); + } + if (object.numericFilter != null) { + if (typeof object.numericFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelParameterFilter.numericFilter: object expected"); + message.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.fromObject(object.numericFilter); + } + if (object.betweenFilter != null) { + if (typeof object.betweenFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelParameterFilter.betweenFilter: object expected"); + message.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.fromObject(object.betweenFilter); + } + return message; + }; + + /** + * Creates a plain object from a FunnelParameterFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @static + * @param {google.analytics.data.v1alpha.FunnelParameterFilter} message FunnelParameterFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunnelParameterFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.eventParameterName != null && message.hasOwnProperty("eventParameterName")) { + object.eventParameterName = message.eventParameterName; + if (options.oneofs) + object.oneParameter = "eventParameterName"; + } + if (message.itemParameterName != null && message.hasOwnProperty("itemParameterName")) { + object.itemParameterName = message.itemParameterName; + if (options.oneofs) + object.oneParameter = "itemParameterName"; + } + if (message.stringFilter != null && message.hasOwnProperty("stringFilter")) { + object.stringFilter = $root.google.analytics.data.v1alpha.StringFilter.toObject(message.stringFilter, options); + if (options.oneofs) + object.oneFilter = "stringFilter"; + } + if (message.inListFilter != null && message.hasOwnProperty("inListFilter")) { + object.inListFilter = $root.google.analytics.data.v1alpha.InListFilter.toObject(message.inListFilter, options); + if (options.oneofs) + object.oneFilter = "inListFilter"; + } + if (message.numericFilter != null && message.hasOwnProperty("numericFilter")) { + object.numericFilter = $root.google.analytics.data.v1alpha.NumericFilter.toObject(message.numericFilter, options); + if (options.oneofs) + object.oneFilter = "numericFilter"; + } + if (message.betweenFilter != null && message.hasOwnProperty("betweenFilter")) { + object.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.toObject(message.betweenFilter, options); + if (options.oneofs) + object.oneFilter = "betweenFilter"; + } + return object; + }; + + /** + * Converts this FunnelParameterFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @instance + * @returns {Object.} JSON object + */ + FunnelParameterFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunnelParameterFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.FunnelParameterFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunnelParameterFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.FunnelParameterFilter"; + }; + + return FunnelParameterFilter; + })(); + + v1alpha.FunnelResponseMetadata = (function() { + + /** + * Properties of a FunnelResponseMetadata. + * @memberof google.analytics.data.v1alpha + * @interface IFunnelResponseMetadata + * @property {Array.|null} [samplingMetadatas] FunnelResponseMetadata samplingMetadatas + */ + + /** + * Constructs a new FunnelResponseMetadata. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a FunnelResponseMetadata. + * @implements IFunnelResponseMetadata + * @constructor + * @param {google.analytics.data.v1alpha.IFunnelResponseMetadata=} [properties] Properties to set + */ + function FunnelResponseMetadata(properties) { + this.samplingMetadatas = []; + 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]]; + } + + /** + * FunnelResponseMetadata samplingMetadatas. + * @member {Array.} samplingMetadatas + * @memberof google.analytics.data.v1alpha.FunnelResponseMetadata + * @instance + */ + FunnelResponseMetadata.prototype.samplingMetadatas = $util.emptyArray; + + /** + * Creates a new FunnelResponseMetadata instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.FunnelResponseMetadata + * @static + * @param {google.analytics.data.v1alpha.IFunnelResponseMetadata=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.FunnelResponseMetadata} FunnelResponseMetadata instance + */ + FunnelResponseMetadata.create = function create(properties) { + return new FunnelResponseMetadata(properties); + }; + + /** + * Encodes the specified FunnelResponseMetadata message. Does not implicitly {@link google.analytics.data.v1alpha.FunnelResponseMetadata.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.FunnelResponseMetadata + * @static + * @param {google.analytics.data.v1alpha.IFunnelResponseMetadata} message FunnelResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelResponseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.samplingMetadatas != null && message.samplingMetadatas.length) + for (var i = 0; i < message.samplingMetadatas.length; ++i) + $root.google.analytics.data.v1alpha.SamplingMetadata.encode(message.samplingMetadatas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunnelResponseMetadata message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.FunnelResponseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelResponseMetadata + * @static + * @param {google.analytics.data.v1alpha.IFunnelResponseMetadata} message FunnelResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunnelResponseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunnelResponseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.FunnelResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.FunnelResponseMetadata} FunnelResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelResponseMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.FunnelResponseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.samplingMetadatas && message.samplingMetadatas.length)) + message.samplingMetadatas = []; + message.samplingMetadatas.push($root.google.analytics.data.v1alpha.SamplingMetadata.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunnelResponseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.FunnelResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.FunnelResponseMetadata} FunnelResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunnelResponseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunnelResponseMetadata message. + * @function verify + * @memberof google.analytics.data.v1alpha.FunnelResponseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunnelResponseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.samplingMetadatas != null && message.hasOwnProperty("samplingMetadatas")) { + if (!Array.isArray(message.samplingMetadatas)) + return "samplingMetadatas: array expected"; + for (var i = 0; i < message.samplingMetadatas.length; ++i) { + var error = $root.google.analytics.data.v1alpha.SamplingMetadata.verify(message.samplingMetadatas[i]); + if (error) + return "samplingMetadatas." + error; + } + } + return null; + }; + + /** + * Creates a FunnelResponseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.FunnelResponseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.FunnelResponseMetadata} FunnelResponseMetadata + */ + FunnelResponseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.FunnelResponseMetadata) + return object; + var message = new $root.google.analytics.data.v1alpha.FunnelResponseMetadata(); + if (object.samplingMetadatas) { + if (!Array.isArray(object.samplingMetadatas)) + throw TypeError(".google.analytics.data.v1alpha.FunnelResponseMetadata.samplingMetadatas: array expected"); + message.samplingMetadatas = []; + for (var i = 0; i < object.samplingMetadatas.length; ++i) { + if (typeof object.samplingMetadatas[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.FunnelResponseMetadata.samplingMetadatas: object expected"); + message.samplingMetadatas[i] = $root.google.analytics.data.v1alpha.SamplingMetadata.fromObject(object.samplingMetadatas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FunnelResponseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.FunnelResponseMetadata + * @static + * @param {google.analytics.data.v1alpha.FunnelResponseMetadata} message FunnelResponseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunnelResponseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.samplingMetadatas = []; + if (message.samplingMetadatas && message.samplingMetadatas.length) { + object.samplingMetadatas = []; + for (var j = 0; j < message.samplingMetadatas.length; ++j) + object.samplingMetadatas[j] = $root.google.analytics.data.v1alpha.SamplingMetadata.toObject(message.samplingMetadatas[j], options); + } + return object; + }; + + /** + * Converts this FunnelResponseMetadata to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.FunnelResponseMetadata + * @instance + * @returns {Object.} JSON object + */ + FunnelResponseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunnelResponseMetadata + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.FunnelResponseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunnelResponseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.FunnelResponseMetadata"; + }; + + return FunnelResponseMetadata; + })(); + + v1alpha.SamplingMetadata = (function() { + + /** + * Properties of a SamplingMetadata. + * @memberof google.analytics.data.v1alpha + * @interface ISamplingMetadata + * @property {number|Long|null} [samplesReadCount] SamplingMetadata samplesReadCount + * @property {number|Long|null} [samplingSpaceSize] SamplingMetadata samplingSpaceSize + */ + + /** + * Constructs a new SamplingMetadata. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents a SamplingMetadata. + * @implements ISamplingMetadata + * @constructor + * @param {google.analytics.data.v1alpha.ISamplingMetadata=} [properties] Properties to set + */ + function SamplingMetadata(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]]; + } + + /** + * SamplingMetadata samplesReadCount. + * @member {number|Long} samplesReadCount + * @memberof google.analytics.data.v1alpha.SamplingMetadata + * @instance + */ + SamplingMetadata.prototype.samplesReadCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SamplingMetadata samplingSpaceSize. + * @member {number|Long} samplingSpaceSize + * @memberof google.analytics.data.v1alpha.SamplingMetadata + * @instance + */ + SamplingMetadata.prototype.samplingSpaceSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SamplingMetadata instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1alpha.SamplingMetadata + * @static + * @param {google.analytics.data.v1alpha.ISamplingMetadata=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.SamplingMetadata} SamplingMetadata instance + */ + SamplingMetadata.create = function create(properties) { + return new SamplingMetadata(properties); + }; + + /** + * Encodes the specified SamplingMetadata message. Does not implicitly {@link google.analytics.data.v1alpha.SamplingMetadata.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.SamplingMetadata + * @static + * @param {google.analytics.data.v1alpha.ISamplingMetadata} message SamplingMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SamplingMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.samplesReadCount != null && Object.hasOwnProperty.call(message, "samplesReadCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.samplesReadCount); + if (message.samplingSpaceSize != null && Object.hasOwnProperty.call(message, "samplingSpaceSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.samplingSpaceSize); + return writer; + }; + + /** + * Encodes the specified SamplingMetadata message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.SamplingMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.SamplingMetadata + * @static + * @param {google.analytics.data.v1alpha.ISamplingMetadata} message SamplingMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SamplingMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SamplingMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1alpha.SamplingMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1alpha.SamplingMetadata} SamplingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SamplingMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1alpha.SamplingMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.samplesReadCount = reader.int64(); + break; + } + case 2: { + message.samplingSpaceSize = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SamplingMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1alpha.SamplingMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.SamplingMetadata} SamplingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SamplingMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SamplingMetadata message. + * @function verify + * @memberof google.analytics.data.v1alpha.SamplingMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SamplingMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.samplesReadCount != null && message.hasOwnProperty("samplesReadCount")) + if (!$util.isInteger(message.samplesReadCount) && !(message.samplesReadCount && $util.isInteger(message.samplesReadCount.low) && $util.isInteger(message.samplesReadCount.high))) + return "samplesReadCount: integer|Long expected"; + if (message.samplingSpaceSize != null && message.hasOwnProperty("samplingSpaceSize")) + if (!$util.isInteger(message.samplingSpaceSize) && !(message.samplingSpaceSize && $util.isInteger(message.samplingSpaceSize.low) && $util.isInteger(message.samplingSpaceSize.high))) + return "samplingSpaceSize: integer|Long expected"; + return null; + }; + + /** + * Creates a SamplingMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1alpha.SamplingMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.SamplingMetadata} SamplingMetadata + */ + SamplingMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.SamplingMetadata) + return object; + var message = new $root.google.analytics.data.v1alpha.SamplingMetadata(); + if (object.samplesReadCount != null) + if ($util.Long) + (message.samplesReadCount = $util.Long.fromValue(object.samplesReadCount)).unsigned = false; + else if (typeof object.samplesReadCount === "string") + message.samplesReadCount = parseInt(object.samplesReadCount, 10); + else if (typeof object.samplesReadCount === "number") + message.samplesReadCount = object.samplesReadCount; + else if (typeof object.samplesReadCount === "object") + message.samplesReadCount = new $util.LongBits(object.samplesReadCount.low >>> 0, object.samplesReadCount.high >>> 0).toNumber(); + if (object.samplingSpaceSize != null) + if ($util.Long) + (message.samplingSpaceSize = $util.Long.fromValue(object.samplingSpaceSize)).unsigned = false; + else if (typeof object.samplingSpaceSize === "string") + message.samplingSpaceSize = parseInt(object.samplingSpaceSize, 10); + else if (typeof object.samplingSpaceSize === "number") + message.samplingSpaceSize = object.samplingSpaceSize; + else if (typeof object.samplingSpaceSize === "object") + message.samplingSpaceSize = new $util.LongBits(object.samplingSpaceSize.low >>> 0, object.samplingSpaceSize.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SamplingMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.SamplingMetadata + * @static + * @param {google.analytics.data.v1alpha.SamplingMetadata} message SamplingMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SamplingMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.samplesReadCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.samplesReadCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.samplingSpaceSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.samplingSpaceSize = options.longs === String ? "0" : 0; + } + if (message.samplesReadCount != null && message.hasOwnProperty("samplesReadCount")) + if (typeof message.samplesReadCount === "number") + object.samplesReadCount = options.longs === String ? String(message.samplesReadCount) : message.samplesReadCount; + else + object.samplesReadCount = options.longs === String ? $util.Long.prototype.toString.call(message.samplesReadCount) : options.longs === Number ? new $util.LongBits(message.samplesReadCount.low >>> 0, message.samplesReadCount.high >>> 0).toNumber() : message.samplesReadCount; + if (message.samplingSpaceSize != null && message.hasOwnProperty("samplingSpaceSize")) + if (typeof message.samplingSpaceSize === "number") + object.samplingSpaceSize = options.longs === String ? String(message.samplingSpaceSize) : message.samplingSpaceSize; + else + object.samplingSpaceSize = options.longs === String ? $util.Long.prototype.toString.call(message.samplingSpaceSize) : options.longs === Number ? new $util.LongBits(message.samplingSpaceSize.low >>> 0, message.samplingSpaceSize.high >>> 0).toNumber() : message.samplingSpaceSize; + return object; + }; + + /** + * Converts this SamplingMetadata to JSON. + * @function toJSON + * @memberof google.analytics.data.v1alpha.SamplingMetadata + * @instance + * @returns {Object.} JSON object + */ + SamplingMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SamplingMetadata + * @function getTypeUrl + * @memberof google.analytics.data.v1alpha.SamplingMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SamplingMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1alpha.SamplingMetadata"; + }; + + return SamplingMetadata; + })(); + + /** + * MetricType enum. + * @name google.analytics.data.v1alpha.MetricType + * @enum {number} + * @property {number} METRIC_TYPE_UNSPECIFIED=0 METRIC_TYPE_UNSPECIFIED value + * @property {number} TYPE_INTEGER=1 TYPE_INTEGER value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_SECONDS=4 TYPE_SECONDS value + * @property {number} TYPE_MILLISECONDS=5 TYPE_MILLISECONDS value + * @property {number} TYPE_MINUTES=6 TYPE_MINUTES value + * @property {number} TYPE_HOURS=7 TYPE_HOURS value + * @property {number} TYPE_STANDARD=8 TYPE_STANDARD value + * @property {number} TYPE_CURRENCY=9 TYPE_CURRENCY value + * @property {number} TYPE_FEET=10 TYPE_FEET value + * @property {number} TYPE_MILES=11 TYPE_MILES value + * @property {number} TYPE_METERS=12 TYPE_METERS value + * @property {number} TYPE_KILOMETERS=13 TYPE_KILOMETERS value + */ + v1alpha.MetricType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METRIC_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TYPE_INTEGER"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[4] = "TYPE_SECONDS"] = 4; + values[valuesById[5] = "TYPE_MILLISECONDS"] = 5; + values[valuesById[6] = "TYPE_MINUTES"] = 6; + values[valuesById[7] = "TYPE_HOURS"] = 7; + values[valuesById[8] = "TYPE_STANDARD"] = 8; + values[valuesById[9] = "TYPE_CURRENCY"] = 9; + values[valuesById[10] = "TYPE_FEET"] = 10; + values[valuesById[11] = "TYPE_MILES"] = 11; + values[valuesById[12] = "TYPE_METERS"] = 12; + values[valuesById[13] = "TYPE_KILOMETERS"] = 13; + return values; + })(); + + return v1alpha; + })(); + + data.v1beta = (function() { + + /** + * Namespace v1beta. + * @memberof google.analytics.data + * @namespace + */ + var v1beta = {}; + + v1beta.BetaAnalyticsData = (function() { + + /** + * Constructs a new BetaAnalyticsData service. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a BetaAnalyticsData + * @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 BetaAnalyticsData(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BetaAnalyticsData.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BetaAnalyticsData; + + /** + * Creates new BetaAnalyticsData service using the specified rpc implementation. + * @function create + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @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 {BetaAnalyticsData} RPC service. Useful where requests and/or responses are streamed. + */ + BetaAnalyticsData.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.analytics.data.v1beta.BetaAnalyticsData|runReport}. + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @typedef RunReportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.data.v1beta.RunReportResponse} [response] RunReportResponse + */ + + /** + * Calls RunReport. + * @function runReport + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @instance + * @param {google.analytics.data.v1beta.IRunReportRequest} request RunReportRequest message or plain object + * @param {google.analytics.data.v1beta.BetaAnalyticsData.RunReportCallback} callback Node-style callback called with the error, if any, and RunReportResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BetaAnalyticsData.prototype.runReport = function runReport(request, callback) { + return this.rpcCall(runReport, $root.google.analytics.data.v1beta.RunReportRequest, $root.google.analytics.data.v1beta.RunReportResponse, request, callback); + }, "name", { value: "RunReport" }); + + /** + * Calls RunReport. + * @function runReport + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @instance + * @param {google.analytics.data.v1beta.IRunReportRequest} request RunReportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.data.v1beta.BetaAnalyticsData|runPivotReport}. + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @typedef RunPivotReportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.data.v1beta.RunPivotReportResponse} [response] RunPivotReportResponse + */ + + /** + * Calls RunPivotReport. + * @function runPivotReport + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @instance + * @param {google.analytics.data.v1beta.IRunPivotReportRequest} request RunPivotReportRequest message or plain object + * @param {google.analytics.data.v1beta.BetaAnalyticsData.RunPivotReportCallback} callback Node-style callback called with the error, if any, and RunPivotReportResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BetaAnalyticsData.prototype.runPivotReport = function runPivotReport(request, callback) { + return this.rpcCall(runPivotReport, $root.google.analytics.data.v1beta.RunPivotReportRequest, $root.google.analytics.data.v1beta.RunPivotReportResponse, request, callback); + }, "name", { value: "RunPivotReport" }); + + /** + * Calls RunPivotReport. + * @function runPivotReport + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @instance + * @param {google.analytics.data.v1beta.IRunPivotReportRequest} request RunPivotReportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.data.v1beta.BetaAnalyticsData|batchRunReports}. + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @typedef BatchRunReportsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.data.v1beta.BatchRunReportsResponse} [response] BatchRunReportsResponse + */ + + /** + * Calls BatchRunReports. + * @function batchRunReports + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @instance + * @param {google.analytics.data.v1beta.IBatchRunReportsRequest} request BatchRunReportsRequest message or plain object + * @param {google.analytics.data.v1beta.BetaAnalyticsData.BatchRunReportsCallback} callback Node-style callback called with the error, if any, and BatchRunReportsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BetaAnalyticsData.prototype.batchRunReports = function batchRunReports(request, callback) { + return this.rpcCall(batchRunReports, $root.google.analytics.data.v1beta.BatchRunReportsRequest, $root.google.analytics.data.v1beta.BatchRunReportsResponse, request, callback); + }, "name", { value: "BatchRunReports" }); + + /** + * Calls BatchRunReports. + * @function batchRunReports + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @instance + * @param {google.analytics.data.v1beta.IBatchRunReportsRequest} request BatchRunReportsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.data.v1beta.BetaAnalyticsData|batchRunPivotReports}. + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @typedef BatchRunPivotReportsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.data.v1beta.BatchRunPivotReportsResponse} [response] BatchRunPivotReportsResponse + */ + + /** + * Calls BatchRunPivotReports. + * @function batchRunPivotReports + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @instance + * @param {google.analytics.data.v1beta.IBatchRunPivotReportsRequest} request BatchRunPivotReportsRequest message or plain object + * @param {google.analytics.data.v1beta.BetaAnalyticsData.BatchRunPivotReportsCallback} callback Node-style callback called with the error, if any, and BatchRunPivotReportsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BetaAnalyticsData.prototype.batchRunPivotReports = function batchRunPivotReports(request, callback) { + return this.rpcCall(batchRunPivotReports, $root.google.analytics.data.v1beta.BatchRunPivotReportsRequest, $root.google.analytics.data.v1beta.BatchRunPivotReportsResponse, request, callback); + }, "name", { value: "BatchRunPivotReports" }); + + /** + * Calls BatchRunPivotReports. + * @function batchRunPivotReports + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @instance + * @param {google.analytics.data.v1beta.IBatchRunPivotReportsRequest} request BatchRunPivotReportsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.data.v1beta.BetaAnalyticsData|getMetadata}. + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @typedef GetMetadataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.data.v1beta.Metadata} [response] Metadata + */ + + /** + * Calls GetMetadata. + * @function getMetadata + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @instance + * @param {google.analytics.data.v1beta.IGetMetadataRequest} request GetMetadataRequest message or plain object + * @param {google.analytics.data.v1beta.BetaAnalyticsData.GetMetadataCallback} callback Node-style callback called with the error, if any, and Metadata + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BetaAnalyticsData.prototype.getMetadata = function getMetadata(request, callback) { + return this.rpcCall(getMetadata, $root.google.analytics.data.v1beta.GetMetadataRequest, $root.google.analytics.data.v1beta.Metadata, request, callback); + }, "name", { value: "GetMetadata" }); + + /** + * Calls GetMetadata. + * @function getMetadata + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @instance + * @param {google.analytics.data.v1beta.IGetMetadataRequest} request GetMetadataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.data.v1beta.BetaAnalyticsData|runRealtimeReport}. + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @typedef RunRealtimeReportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.data.v1beta.RunRealtimeReportResponse} [response] RunRealtimeReportResponse + */ + + /** + * Calls RunRealtimeReport. + * @function runRealtimeReport + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @instance + * @param {google.analytics.data.v1beta.IRunRealtimeReportRequest} request RunRealtimeReportRequest message or plain object + * @param {google.analytics.data.v1beta.BetaAnalyticsData.RunRealtimeReportCallback} callback Node-style callback called with the error, if any, and RunRealtimeReportResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BetaAnalyticsData.prototype.runRealtimeReport = function runRealtimeReport(request, callback) { + return this.rpcCall(runRealtimeReport, $root.google.analytics.data.v1beta.RunRealtimeReportRequest, $root.google.analytics.data.v1beta.RunRealtimeReportResponse, request, callback); + }, "name", { value: "RunRealtimeReport" }); + + /** + * Calls RunRealtimeReport. + * @function runRealtimeReport + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @instance + * @param {google.analytics.data.v1beta.IRunRealtimeReportRequest} request RunRealtimeReportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.analytics.data.v1beta.BetaAnalyticsData|checkCompatibility}. + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @typedef CheckCompatibilityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.data.v1beta.CheckCompatibilityResponse} [response] CheckCompatibilityResponse + */ + + /** + * Calls CheckCompatibility. + * @function checkCompatibility + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @instance + * @param {google.analytics.data.v1beta.ICheckCompatibilityRequest} request CheckCompatibilityRequest message or plain object + * @param {google.analytics.data.v1beta.BetaAnalyticsData.CheckCompatibilityCallback} callback Node-style callback called with the error, if any, and CheckCompatibilityResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BetaAnalyticsData.prototype.checkCompatibility = function checkCompatibility(request, callback) { + return this.rpcCall(checkCompatibility, $root.google.analytics.data.v1beta.CheckCompatibilityRequest, $root.google.analytics.data.v1beta.CheckCompatibilityResponse, request, callback); + }, "name", { value: "CheckCompatibility" }); + + /** + * Calls CheckCompatibility. + * @function checkCompatibility + * @memberof google.analytics.data.v1beta.BetaAnalyticsData + * @instance + * @param {google.analytics.data.v1beta.ICheckCompatibilityRequest} request CheckCompatibilityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BetaAnalyticsData; + })(); + + v1beta.CheckCompatibilityRequest = (function() { + + /** + * Properties of a CheckCompatibilityRequest. + * @memberof google.analytics.data.v1beta + * @interface ICheckCompatibilityRequest + * @property {string|null} [property] CheckCompatibilityRequest property + * @property {Array.|null} [dimensions] CheckCompatibilityRequest dimensions + * @property {Array.|null} [metrics] CheckCompatibilityRequest metrics + * @property {google.analytics.data.v1beta.IFilterExpression|null} [dimensionFilter] CheckCompatibilityRequest dimensionFilter + * @property {google.analytics.data.v1beta.IFilterExpression|null} [metricFilter] CheckCompatibilityRequest metricFilter + * @property {google.analytics.data.v1beta.Compatibility|null} [compatibilityFilter] CheckCompatibilityRequest compatibilityFilter + */ + + /** + * Constructs a new CheckCompatibilityRequest. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a CheckCompatibilityRequest. + * @implements ICheckCompatibilityRequest + * @constructor + * @param {google.analytics.data.v1beta.ICheckCompatibilityRequest=} [properties] Properties to set + */ + function CheckCompatibilityRequest(properties) { + this.dimensions = []; + this.metrics = []; + 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]]; + } + + /** + * CheckCompatibilityRequest property. + * @member {string} property + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @instance + */ + CheckCompatibilityRequest.prototype.property = ""; + + /** + * CheckCompatibilityRequest dimensions. + * @member {Array.} dimensions + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @instance + */ + CheckCompatibilityRequest.prototype.dimensions = $util.emptyArray; + + /** + * CheckCompatibilityRequest metrics. + * @member {Array.} metrics + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @instance + */ + CheckCompatibilityRequest.prototype.metrics = $util.emptyArray; + + /** + * CheckCompatibilityRequest dimensionFilter. + * @member {google.analytics.data.v1beta.IFilterExpression|null|undefined} dimensionFilter + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @instance + */ + CheckCompatibilityRequest.prototype.dimensionFilter = null; + + /** + * CheckCompatibilityRequest metricFilter. + * @member {google.analytics.data.v1beta.IFilterExpression|null|undefined} metricFilter + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @instance + */ + CheckCompatibilityRequest.prototype.metricFilter = null; + + /** + * CheckCompatibilityRequest compatibilityFilter. + * @member {google.analytics.data.v1beta.Compatibility} compatibilityFilter + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @instance + */ + CheckCompatibilityRequest.prototype.compatibilityFilter = 0; + + /** + * Creates a new CheckCompatibilityRequest instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @static + * @param {google.analytics.data.v1beta.ICheckCompatibilityRequest=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.CheckCompatibilityRequest} CheckCompatibilityRequest instance + */ + CheckCompatibilityRequest.create = function create(properties) { + return new CheckCompatibilityRequest(properties); + }; + + /** + * Encodes the specified CheckCompatibilityRequest message. Does not implicitly {@link google.analytics.data.v1beta.CheckCompatibilityRequest.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @static + * @param {google.analytics.data.v1beta.ICheckCompatibilityRequest} message CheckCompatibilityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckCompatibilityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && Object.hasOwnProperty.call(message, "property")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); + if (message.dimensions != null && message.dimensions.length) + for (var i = 0; i < message.dimensions.length; ++i) + $root.google.analytics.data.v1beta.Dimension.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.data.v1beta.Metric.encode(message.metrics[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dimensionFilter != null && Object.hasOwnProperty.call(message, "dimensionFilter")) + $root.google.analytics.data.v1beta.FilterExpression.encode(message.dimensionFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.metricFilter != null && Object.hasOwnProperty.call(message, "metricFilter")) + $root.google.analytics.data.v1beta.FilterExpression.encode(message.metricFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.compatibilityFilter != null && Object.hasOwnProperty.call(message, "compatibilityFilter")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.compatibilityFilter); + return writer; + }; + + /** + * Encodes the specified CheckCompatibilityRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.CheckCompatibilityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @static + * @param {google.analytics.data.v1beta.ICheckCompatibilityRequest} message CheckCompatibilityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckCompatibilityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckCompatibilityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.CheckCompatibilityRequest} CheckCompatibilityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckCompatibilityRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.CheckCompatibilityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.property = reader.string(); + break; + } + case 2: { + if (!(message.dimensions && message.dimensions.length)) + message.dimensions = []; + message.dimensions.push($root.google.analytics.data.v1beta.Dimension.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.analytics.data.v1beta.Metric.decode(reader, reader.uint32())); + break; + } + case 4: { + message.dimensionFilter = $root.google.analytics.data.v1beta.FilterExpression.decode(reader, reader.uint32()); + break; + } + case 5: { + message.metricFilter = $root.google.analytics.data.v1beta.FilterExpression.decode(reader, reader.uint32()); + break; + } + case 6: { + message.compatibilityFilter = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckCompatibilityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.CheckCompatibilityRequest} CheckCompatibilityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckCompatibilityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckCompatibilityRequest message. + * @function verify + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckCompatibilityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) + if (!$util.isString(message.property)) + return "property: 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.data.v1beta.Dimension.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.data.v1beta.Metric.verify(message.metrics[i]); + if (error) + return "metrics." + error; + } + } + if (message.dimensionFilter != null && message.hasOwnProperty("dimensionFilter")) { + var error = $root.google.analytics.data.v1beta.FilterExpression.verify(message.dimensionFilter); + if (error) + return "dimensionFilter." + error; + } + if (message.metricFilter != null && message.hasOwnProperty("metricFilter")) { + var error = $root.google.analytics.data.v1beta.FilterExpression.verify(message.metricFilter); + if (error) + return "metricFilter." + error; + } + if (message.compatibilityFilter != null && message.hasOwnProperty("compatibilityFilter")) + switch (message.compatibilityFilter) { + default: + return "compatibilityFilter: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a CheckCompatibilityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.CheckCompatibilityRequest} CheckCompatibilityRequest + */ + CheckCompatibilityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.CheckCompatibilityRequest) + return object; + var message = new $root.google.analytics.data.v1beta.CheckCompatibilityRequest(); + if (object.property != null) + message.property = String(object.property); + if (object.dimensions) { + if (!Array.isArray(object.dimensions)) + throw TypeError(".google.analytics.data.v1beta.CheckCompatibilityRequest.dimensions: array expected"); + message.dimensions = []; + for (var i = 0; i < object.dimensions.length; ++i) { + if (typeof object.dimensions[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.CheckCompatibilityRequest.dimensions: object expected"); + message.dimensions[i] = $root.google.analytics.data.v1beta.Dimension.fromObject(object.dimensions[i]); + } + } + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.analytics.data.v1beta.CheckCompatibilityRequest.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.CheckCompatibilityRequest.metrics: object expected"); + message.metrics[i] = $root.google.analytics.data.v1beta.Metric.fromObject(object.metrics[i]); + } + } + if (object.dimensionFilter != null) { + if (typeof object.dimensionFilter !== "object") + throw TypeError(".google.analytics.data.v1beta.CheckCompatibilityRequest.dimensionFilter: object expected"); + message.dimensionFilter = $root.google.analytics.data.v1beta.FilterExpression.fromObject(object.dimensionFilter); + } + if (object.metricFilter != null) { + if (typeof object.metricFilter !== "object") + throw TypeError(".google.analytics.data.v1beta.CheckCompatibilityRequest.metricFilter: object expected"); + message.metricFilter = $root.google.analytics.data.v1beta.FilterExpression.fromObject(object.metricFilter); + } + switch (object.compatibilityFilter) { + default: + if (typeof object.compatibilityFilter === "number") { + message.compatibilityFilter = object.compatibilityFilter; + break; + } + break; + case "COMPATIBILITY_UNSPECIFIED": + case 0: + message.compatibilityFilter = 0; + break; + case "COMPATIBLE": + case 1: + message.compatibilityFilter = 1; + break; + case "INCOMPATIBLE": + case 2: + message.compatibilityFilter = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a CheckCompatibilityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @static + * @param {google.analytics.data.v1beta.CheckCompatibilityRequest} message CheckCompatibilityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckCompatibilityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dimensions = []; + object.metrics = []; + } + if (options.defaults) { + object.property = ""; + object.dimensionFilter = null; + object.metricFilter = null; + object.compatibilityFilter = options.enums === String ? "COMPATIBILITY_UNSPECIFIED" : 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = message.property; + if (message.dimensions && message.dimensions.length) { + object.dimensions = []; + for (var j = 0; j < message.dimensions.length; ++j) + object.dimensions[j] = $root.google.analytics.data.v1beta.Dimension.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.data.v1beta.Metric.toObject(message.metrics[j], options); + } + if (message.dimensionFilter != null && message.hasOwnProperty("dimensionFilter")) + object.dimensionFilter = $root.google.analytics.data.v1beta.FilterExpression.toObject(message.dimensionFilter, options); + if (message.metricFilter != null && message.hasOwnProperty("metricFilter")) + object.metricFilter = $root.google.analytics.data.v1beta.FilterExpression.toObject(message.metricFilter, options); + if (message.compatibilityFilter != null && message.hasOwnProperty("compatibilityFilter")) + object.compatibilityFilter = options.enums === String ? $root.google.analytics.data.v1beta.Compatibility[message.compatibilityFilter] === undefined ? message.compatibilityFilter : $root.google.analytics.data.v1beta.Compatibility[message.compatibilityFilter] : message.compatibilityFilter; + return object; + }; + + /** + * Converts this CheckCompatibilityRequest to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @instance + * @returns {Object.} JSON object + */ + CheckCompatibilityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckCompatibilityRequest + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.CheckCompatibilityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckCompatibilityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.CheckCompatibilityRequest"; + }; + + return CheckCompatibilityRequest; + })(); + + v1beta.CheckCompatibilityResponse = (function() { + + /** + * Properties of a CheckCompatibilityResponse. + * @memberof google.analytics.data.v1beta + * @interface ICheckCompatibilityResponse + * @property {Array.|null} [dimensionCompatibilities] CheckCompatibilityResponse dimensionCompatibilities + * @property {Array.|null} [metricCompatibilities] CheckCompatibilityResponse metricCompatibilities + */ + + /** + * Constructs a new CheckCompatibilityResponse. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a CheckCompatibilityResponse. + * @implements ICheckCompatibilityResponse + * @constructor + * @param {google.analytics.data.v1beta.ICheckCompatibilityResponse=} [properties] Properties to set + */ + function CheckCompatibilityResponse(properties) { + this.dimensionCompatibilities = []; + this.metricCompatibilities = []; + 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]]; + } + + /** + * CheckCompatibilityResponse dimensionCompatibilities. + * @member {Array.} dimensionCompatibilities + * @memberof google.analytics.data.v1beta.CheckCompatibilityResponse + * @instance + */ + CheckCompatibilityResponse.prototype.dimensionCompatibilities = $util.emptyArray; + + /** + * CheckCompatibilityResponse metricCompatibilities. + * @member {Array.} metricCompatibilities + * @memberof google.analytics.data.v1beta.CheckCompatibilityResponse + * @instance + */ + CheckCompatibilityResponse.prototype.metricCompatibilities = $util.emptyArray; + + /** + * Creates a new CheckCompatibilityResponse instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.CheckCompatibilityResponse + * @static + * @param {google.analytics.data.v1beta.ICheckCompatibilityResponse=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.CheckCompatibilityResponse} CheckCompatibilityResponse instance + */ + CheckCompatibilityResponse.create = function create(properties) { + return new CheckCompatibilityResponse(properties); + }; + + /** + * Encodes the specified CheckCompatibilityResponse message. Does not implicitly {@link google.analytics.data.v1beta.CheckCompatibilityResponse.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.CheckCompatibilityResponse + * @static + * @param {google.analytics.data.v1beta.ICheckCompatibilityResponse} message CheckCompatibilityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckCompatibilityResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dimensionCompatibilities != null && message.dimensionCompatibilities.length) + for (var i = 0; i < message.dimensionCompatibilities.length; ++i) + $root.google.analytics.data.v1beta.DimensionCompatibility.encode(message.dimensionCompatibilities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metricCompatibilities != null && message.metricCompatibilities.length) + for (var i = 0; i < message.metricCompatibilities.length; ++i) + $root.google.analytics.data.v1beta.MetricCompatibility.encode(message.metricCompatibilities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CheckCompatibilityResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.CheckCompatibilityResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.CheckCompatibilityResponse + * @static + * @param {google.analytics.data.v1beta.ICheckCompatibilityResponse} message CheckCompatibilityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckCompatibilityResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckCompatibilityResponse message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.CheckCompatibilityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.CheckCompatibilityResponse} CheckCompatibilityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckCompatibilityResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.CheckCompatibilityResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dimensionCompatibilities && message.dimensionCompatibilities.length)) + message.dimensionCompatibilities = []; + message.dimensionCompatibilities.push($root.google.analytics.data.v1beta.DimensionCompatibility.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.metricCompatibilities && message.metricCompatibilities.length)) + message.metricCompatibilities = []; + message.metricCompatibilities.push($root.google.analytics.data.v1beta.MetricCompatibility.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckCompatibilityResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.CheckCompatibilityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.CheckCompatibilityResponse} CheckCompatibilityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckCompatibilityResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckCompatibilityResponse message. + * @function verify + * @memberof google.analytics.data.v1beta.CheckCompatibilityResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckCompatibilityResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dimensionCompatibilities != null && message.hasOwnProperty("dimensionCompatibilities")) { + if (!Array.isArray(message.dimensionCompatibilities)) + return "dimensionCompatibilities: array expected"; + for (var i = 0; i < message.dimensionCompatibilities.length; ++i) { + var error = $root.google.analytics.data.v1beta.DimensionCompatibility.verify(message.dimensionCompatibilities[i]); + if (error) + return "dimensionCompatibilities." + error; + } + } + if (message.metricCompatibilities != null && message.hasOwnProperty("metricCompatibilities")) { + if (!Array.isArray(message.metricCompatibilities)) + return "metricCompatibilities: array expected"; + for (var i = 0; i < message.metricCompatibilities.length; ++i) { + var error = $root.google.analytics.data.v1beta.MetricCompatibility.verify(message.metricCompatibilities[i]); + if (error) + return "metricCompatibilities." + error; + } + } + return null; + }; + + /** + * Creates a CheckCompatibilityResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.CheckCompatibilityResponse + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.CheckCompatibilityResponse} CheckCompatibilityResponse + */ + CheckCompatibilityResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.CheckCompatibilityResponse) + return object; + var message = new $root.google.analytics.data.v1beta.CheckCompatibilityResponse(); + if (object.dimensionCompatibilities) { + if (!Array.isArray(object.dimensionCompatibilities)) + throw TypeError(".google.analytics.data.v1beta.CheckCompatibilityResponse.dimensionCompatibilities: array expected"); + message.dimensionCompatibilities = []; + for (var i = 0; i < object.dimensionCompatibilities.length; ++i) { + if (typeof object.dimensionCompatibilities[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.CheckCompatibilityResponse.dimensionCompatibilities: object expected"); + message.dimensionCompatibilities[i] = $root.google.analytics.data.v1beta.DimensionCompatibility.fromObject(object.dimensionCompatibilities[i]); + } + } + if (object.metricCompatibilities) { + if (!Array.isArray(object.metricCompatibilities)) + throw TypeError(".google.analytics.data.v1beta.CheckCompatibilityResponse.metricCompatibilities: array expected"); + message.metricCompatibilities = []; + for (var i = 0; i < object.metricCompatibilities.length; ++i) { + if (typeof object.metricCompatibilities[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.CheckCompatibilityResponse.metricCompatibilities: object expected"); + message.metricCompatibilities[i] = $root.google.analytics.data.v1beta.MetricCompatibility.fromObject(object.metricCompatibilities[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CheckCompatibilityResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.CheckCompatibilityResponse + * @static + * @param {google.analytics.data.v1beta.CheckCompatibilityResponse} message CheckCompatibilityResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckCompatibilityResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dimensionCompatibilities = []; + object.metricCompatibilities = []; + } + if (message.dimensionCompatibilities && message.dimensionCompatibilities.length) { + object.dimensionCompatibilities = []; + for (var j = 0; j < message.dimensionCompatibilities.length; ++j) + object.dimensionCompatibilities[j] = $root.google.analytics.data.v1beta.DimensionCompatibility.toObject(message.dimensionCompatibilities[j], options); + } + if (message.metricCompatibilities && message.metricCompatibilities.length) { + object.metricCompatibilities = []; + for (var j = 0; j < message.metricCompatibilities.length; ++j) + object.metricCompatibilities[j] = $root.google.analytics.data.v1beta.MetricCompatibility.toObject(message.metricCompatibilities[j], options); + } + return object; + }; + + /** + * Converts this CheckCompatibilityResponse to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.CheckCompatibilityResponse + * @instance + * @returns {Object.} JSON object + */ + CheckCompatibilityResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckCompatibilityResponse + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.CheckCompatibilityResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckCompatibilityResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.CheckCompatibilityResponse"; + }; + + return CheckCompatibilityResponse; + })(); + + v1beta.Metadata = (function() { + + /** + * Properties of a Metadata. + * @memberof google.analytics.data.v1beta + * @interface IMetadata + * @property {string|null} [name] Metadata name + * @property {Array.|null} [dimensions] Metadata dimensions + * @property {Array.|null} [metrics] Metadata metrics + */ + + /** + * Constructs a new Metadata. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {google.analytics.data.v1beta.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + this.dimensions = []; + this.metrics = []; + 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]]; + } + + /** + * Metadata name. + * @member {string} name + * @memberof google.analytics.data.v1beta.Metadata + * @instance + */ + Metadata.prototype.name = ""; + + /** + * Metadata dimensions. + * @member {Array.} dimensions + * @memberof google.analytics.data.v1beta.Metadata + * @instance + */ + Metadata.prototype.dimensions = $util.emptyArray; + + /** + * Metadata metrics. + * @member {Array.} metrics + * @memberof google.analytics.data.v1beta.Metadata + * @instance + */ + Metadata.prototype.metrics = $util.emptyArray; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.Metadata + * @static + * @param {google.analytics.data.v1beta.IMetadata=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.analytics.data.v1beta.Metadata.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.Metadata + * @static + * @param {google.analytics.data.v1beta.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dimensions != null && message.dimensions.length) + for (var i = 0; i < message.dimensions.length; ++i) + $root.google.analytics.data.v1beta.DimensionMetadata.encode(message.dimensions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + $root.google.analytics.data.v1beta.MetricMetadata.encode(message.metrics[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.Metadata + * @static + * @param {google.analytics.data.v1beta.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.name = reader.string(); + break; + } + case 1: { + if (!(message.dimensions && message.dimensions.length)) + message.dimensions = []; + message.dimensions.push($root.google.analytics.data.v1beta.DimensionMetadata.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.analytics.data.v1beta.MetricMetadata.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof google.analytics.data.v1beta.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: 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.data.v1beta.DimensionMetadata.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.data.v1beta.MetricMetadata.verify(message.metrics[i]); + if (error) + return "metrics." + error; + } + } + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.Metadata + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.Metadata) + return object; + var message = new $root.google.analytics.data.v1beta.Metadata(); + if (object.name != null) + message.name = String(object.name); + if (object.dimensions) { + if (!Array.isArray(object.dimensions)) + throw TypeError(".google.analytics.data.v1beta.Metadata.dimensions: array expected"); + message.dimensions = []; + for (var i = 0; i < object.dimensions.length; ++i) { + if (typeof object.dimensions[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.Metadata.dimensions: object expected"); + message.dimensions[i] = $root.google.analytics.data.v1beta.DimensionMetadata.fromObject(object.dimensions[i]); + } + } + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.analytics.data.v1beta.Metadata.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.Metadata.metrics: object expected"); + message.metrics[i] = $root.google.analytics.data.v1beta.MetricMetadata.fromObject(object.metrics[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.Metadata + * @static + * @param {google.analytics.data.v1beta.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dimensions = []; + object.metrics = []; + } + if (options.defaults) + object.name = ""; + if (message.dimensions && message.dimensions.length) { + object.dimensions = []; + for (var j = 0; j < message.dimensions.length; ++j) + object.dimensions[j] = $root.google.analytics.data.v1beta.DimensionMetadata.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.data.v1beta.MetricMetadata.toObject(message.metrics[j], options); + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metadata + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.Metadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.Metadata"; + }; + + return Metadata; + })(); + + v1beta.RunReportRequest = (function() { + + /** + * Properties of a RunReportRequest. + * @memberof google.analytics.data.v1beta + * @interface IRunReportRequest + * @property {string|null} [property] RunReportRequest property + * @property {Array.|null} [dimensions] RunReportRequest dimensions + * @property {Array.|null} [metrics] RunReportRequest metrics + * @property {Array.|null} [dateRanges] RunReportRequest dateRanges + * @property {google.analytics.data.v1beta.IFilterExpression|null} [dimensionFilter] RunReportRequest dimensionFilter + * @property {google.analytics.data.v1beta.IFilterExpression|null} [metricFilter] RunReportRequest metricFilter + * @property {number|Long|null} [offset] RunReportRequest offset + * @property {number|Long|null} [limit] RunReportRequest limit + * @property {Array.|null} [metricAggregations] RunReportRequest metricAggregations + * @property {Array.|null} [orderBys] RunReportRequest orderBys + * @property {string|null} [currencyCode] RunReportRequest currencyCode + * @property {google.analytics.data.v1beta.ICohortSpec|null} [cohortSpec] RunReportRequest cohortSpec + * @property {boolean|null} [keepEmptyRows] RunReportRequest keepEmptyRows + * @property {boolean|null} [returnPropertyQuota] RunReportRequest returnPropertyQuota + */ + + /** + * Constructs a new RunReportRequest. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a RunReportRequest. + * @implements IRunReportRequest + * @constructor + * @param {google.analytics.data.v1beta.IRunReportRequest=} [properties] Properties to set + */ + function RunReportRequest(properties) { + this.dimensions = []; + this.metrics = []; + this.dateRanges = []; + this.metricAggregations = []; + 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]]; + } + + /** + * RunReportRequest property. + * @member {string} property + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + */ + RunReportRequest.prototype.property = ""; + + /** + * RunReportRequest dimensions. + * @member {Array.} dimensions + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + */ + RunReportRequest.prototype.dimensions = $util.emptyArray; + + /** + * RunReportRequest metrics. + * @member {Array.} metrics + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + */ + RunReportRequest.prototype.metrics = $util.emptyArray; + + /** + * RunReportRequest dateRanges. + * @member {Array.} dateRanges + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + */ + RunReportRequest.prototype.dateRanges = $util.emptyArray; + + /** + * RunReportRequest dimensionFilter. + * @member {google.analytics.data.v1beta.IFilterExpression|null|undefined} dimensionFilter + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + */ + RunReportRequest.prototype.dimensionFilter = null; + + /** + * RunReportRequest metricFilter. + * @member {google.analytics.data.v1beta.IFilterExpression|null|undefined} metricFilter + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + */ + RunReportRequest.prototype.metricFilter = null; + + /** + * RunReportRequest offset. + * @member {number|Long} offset + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + */ + RunReportRequest.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RunReportRequest limit. + * @member {number|Long} limit + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + */ + RunReportRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RunReportRequest metricAggregations. + * @member {Array.} metricAggregations + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + */ + RunReportRequest.prototype.metricAggregations = $util.emptyArray; + + /** + * RunReportRequest orderBys. + * @member {Array.} orderBys + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + */ + RunReportRequest.prototype.orderBys = $util.emptyArray; + + /** + * RunReportRequest currencyCode. + * @member {string} currencyCode + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + */ + RunReportRequest.prototype.currencyCode = ""; + + /** + * RunReportRequest cohortSpec. + * @member {google.analytics.data.v1beta.ICohortSpec|null|undefined} cohortSpec + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + */ + RunReportRequest.prototype.cohortSpec = null; + + /** + * RunReportRequest keepEmptyRows. + * @member {boolean} keepEmptyRows + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + */ + RunReportRequest.prototype.keepEmptyRows = false; + + /** + * RunReportRequest returnPropertyQuota. + * @member {boolean} returnPropertyQuota + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + */ + RunReportRequest.prototype.returnPropertyQuota = false; + + /** + * Creates a new RunReportRequest instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.RunReportRequest + * @static + * @param {google.analytics.data.v1beta.IRunReportRequest=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.RunReportRequest} RunReportRequest instance + */ + RunReportRequest.create = function create(properties) { + return new RunReportRequest(properties); + }; + + /** + * Encodes the specified RunReportRequest message. Does not implicitly {@link google.analytics.data.v1beta.RunReportRequest.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.RunReportRequest + * @static + * @param {google.analytics.data.v1beta.IRunReportRequest} message RunReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunReportRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && Object.hasOwnProperty.call(message, "property")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); + if (message.dimensions != null && message.dimensions.length) + for (var i = 0; i < message.dimensions.length; ++i) + $root.google.analytics.data.v1beta.Dimension.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.data.v1beta.Metric.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.data.v1beta.DateRange.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.data.v1beta.FilterExpression.encode(message.dimensionFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.metricFilter != null && Object.hasOwnProperty.call(message, "metricFilter")) + $root.google.analytics.data.v1beta.FilterExpression.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.metricAggregations != null && message.metricAggregations.length) { + writer.uint32(/* id 9, wireType 2 =*/74).fork(); + for (var i = 0; i < message.metricAggregations.length; ++i) + writer.int32(message.metricAggregations[i]); + writer.ldelim(); + } + if (message.orderBys != null && message.orderBys.length) + for (var i = 0; i < message.orderBys.length; ++i) + $root.google.analytics.data.v1beta.OrderBy.encode(message.orderBys[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.currencyCode); + if (message.cohortSpec != null && Object.hasOwnProperty.call(message, "cohortSpec")) + $root.google.analytics.data.v1beta.CohortSpec.encode(message.cohortSpec, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.keepEmptyRows != null && Object.hasOwnProperty.call(message, "keepEmptyRows")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.keepEmptyRows); + if (message.returnPropertyQuota != null && Object.hasOwnProperty.call(message, "returnPropertyQuota")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.returnPropertyQuota); + return writer; + }; + + /** + * Encodes the specified RunReportRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.RunReportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.RunReportRequest + * @static + * @param {google.analytics.data.v1beta.IRunReportRequest} message RunReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunReportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunReportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.RunReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.RunReportRequest} RunReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunReportRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.RunReportRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.property = reader.string(); + break; + } + case 2: { + if (!(message.dimensions && message.dimensions.length)) + message.dimensions = []; + message.dimensions.push($root.google.analytics.data.v1beta.Dimension.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.analytics.data.v1beta.Metric.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.dateRanges && message.dateRanges.length)) + message.dateRanges = []; + message.dateRanges.push($root.google.analytics.data.v1beta.DateRange.decode(reader, reader.uint32())); + break; + } + case 5: { + message.dimensionFilter = $root.google.analytics.data.v1beta.FilterExpression.decode(reader, reader.uint32()); + break; + } + case 6: { + message.metricFilter = $root.google.analytics.data.v1beta.FilterExpression.decode(reader, reader.uint32()); + break; + } + case 7: { + message.offset = reader.int64(); + break; + } + case 8: { + message.limit = reader.int64(); + break; + } + case 9: { + if (!(message.metricAggregations && message.metricAggregations.length)) + message.metricAggregations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.metricAggregations.push(reader.int32()); + } else + message.metricAggregations.push(reader.int32()); + break; + } + case 10: { + if (!(message.orderBys && message.orderBys.length)) + message.orderBys = []; + message.orderBys.push($root.google.analytics.data.v1beta.OrderBy.decode(reader, reader.uint32())); + break; + } + case 11: { + message.currencyCode = reader.string(); + break; + } + case 12: { + message.cohortSpec = $root.google.analytics.data.v1beta.CohortSpec.decode(reader, reader.uint32()); + break; + } + case 13: { + message.keepEmptyRows = reader.bool(); + break; + } + case 14: { + message.returnPropertyQuota = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunReportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.RunReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.RunReportRequest} RunReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunReportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunReportRequest message. + * @function verify + * @memberof google.analytics.data.v1beta.RunReportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunReportRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) + if (!$util.isString(message.property)) + return "property: 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.data.v1beta.Dimension.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.data.v1beta.Metric.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.data.v1beta.DateRange.verify(message.dateRanges[i]); + if (error) + return "dateRanges." + error; + } + } + if (message.dimensionFilter != null && message.hasOwnProperty("dimensionFilter")) { + var error = $root.google.analytics.data.v1beta.FilterExpression.verify(message.dimensionFilter); + if (error) + return "dimensionFilter." + error; + } + if (message.metricFilter != null && message.hasOwnProperty("metricFilter")) { + var error = $root.google.analytics.data.v1beta.FilterExpression.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.metricAggregations != null && message.hasOwnProperty("metricAggregations")) { + if (!Array.isArray(message.metricAggregations)) + return "metricAggregations: array expected"; + for (var i = 0; i < message.metricAggregations.length; ++i) + switch (message.metricAggregations[i]) { + default: + return "metricAggregations: enum value[] expected"; + case 0: + case 1: + case 5: + case 6: + case 4: + break; + } + } + 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.data.v1beta.OrderBy.verify(message.orderBys[i]); + if (error) + return "orderBys." + error; + } + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.cohortSpec != null && message.hasOwnProperty("cohortSpec")) { + var error = $root.google.analytics.data.v1beta.CohortSpec.verify(message.cohortSpec); + if (error) + return "cohortSpec." + error; + } + if (message.keepEmptyRows != null && message.hasOwnProperty("keepEmptyRows")) + if (typeof message.keepEmptyRows !== "boolean") + return "keepEmptyRows: boolean expected"; + if (message.returnPropertyQuota != null && message.hasOwnProperty("returnPropertyQuota")) + if (typeof message.returnPropertyQuota !== "boolean") + return "returnPropertyQuota: boolean expected"; + return null; + }; + + /** + * Creates a RunReportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.RunReportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.RunReportRequest} RunReportRequest + */ + RunReportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.RunReportRequest) + return object; + var message = new $root.google.analytics.data.v1beta.RunReportRequest(); + if (object.property != null) + message.property = String(object.property); + if (object.dimensions) { + if (!Array.isArray(object.dimensions)) + throw TypeError(".google.analytics.data.v1beta.RunReportRequest.dimensions: array expected"); + message.dimensions = []; + for (var i = 0; i < object.dimensions.length; ++i) { + if (typeof object.dimensions[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportRequest.dimensions: object expected"); + message.dimensions[i] = $root.google.analytics.data.v1beta.Dimension.fromObject(object.dimensions[i]); + } + } + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.analytics.data.v1beta.RunReportRequest.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportRequest.metrics: object expected"); + message.metrics[i] = $root.google.analytics.data.v1beta.Metric.fromObject(object.metrics[i]); + } + } + if (object.dateRanges) { + if (!Array.isArray(object.dateRanges)) + throw TypeError(".google.analytics.data.v1beta.RunReportRequest.dateRanges: array expected"); + message.dateRanges = []; + for (var i = 0; i < object.dateRanges.length; ++i) { + if (typeof object.dateRanges[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportRequest.dateRanges: object expected"); + message.dateRanges[i] = $root.google.analytics.data.v1beta.DateRange.fromObject(object.dateRanges[i]); + } + } + if (object.dimensionFilter != null) { + if (typeof object.dimensionFilter !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportRequest.dimensionFilter: object expected"); + message.dimensionFilter = $root.google.analytics.data.v1beta.FilterExpression.fromObject(object.dimensionFilter); + } + if (object.metricFilter != null) { + if (typeof object.metricFilter !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportRequest.metricFilter: object expected"); + message.metricFilter = $root.google.analytics.data.v1beta.FilterExpression.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.metricAggregations) { + if (!Array.isArray(object.metricAggregations)) + throw TypeError(".google.analytics.data.v1beta.RunReportRequest.metricAggregations: array expected"); + message.metricAggregations = []; + for (var i = 0; i < object.metricAggregations.length; ++i) + switch (object.metricAggregations[i]) { + default: + if (typeof object.metricAggregations[i] === "number") { + message.metricAggregations[i] = object.metricAggregations[i]; + break; + } + case "METRIC_AGGREGATION_UNSPECIFIED": + case 0: + message.metricAggregations[i] = 0; + break; + case "TOTAL": + case 1: + message.metricAggregations[i] = 1; + break; + case "MINIMUM": + case 5: + message.metricAggregations[i] = 5; + break; + case "MAXIMUM": + case 6: + message.metricAggregations[i] = 6; + break; + case "COUNT": + case 4: + message.metricAggregations[i] = 4; + break; + } + } + if (object.orderBys) { + if (!Array.isArray(object.orderBys)) + throw TypeError(".google.analytics.data.v1beta.RunReportRequest.orderBys: array expected"); + message.orderBys = []; + for (var i = 0; i < object.orderBys.length; ++i) { + if (typeof object.orderBys[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportRequest.orderBys: object expected"); + message.orderBys[i] = $root.google.analytics.data.v1beta.OrderBy.fromObject(object.orderBys[i]); + } + } + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.cohortSpec != null) { + if (typeof object.cohortSpec !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportRequest.cohortSpec: object expected"); + message.cohortSpec = $root.google.analytics.data.v1beta.CohortSpec.fromObject(object.cohortSpec); + } + if (object.keepEmptyRows != null) + message.keepEmptyRows = Boolean(object.keepEmptyRows); + if (object.returnPropertyQuota != null) + message.returnPropertyQuota = Boolean(object.returnPropertyQuota); + return message; + }; + + /** + * Creates a plain object from a RunReportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.RunReportRequest + * @static + * @param {google.analytics.data.v1beta.RunReportRequest} message RunReportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunReportRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dimensions = []; + object.metrics = []; + object.dateRanges = []; + object.metricAggregations = []; + object.orderBys = []; + } + if (options.defaults) { + object.property = ""; + 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.currencyCode = ""; + object.cohortSpec = null; + object.keepEmptyRows = false; + object.returnPropertyQuota = false; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = message.property; + if (message.dimensions && message.dimensions.length) { + object.dimensions = []; + for (var j = 0; j < message.dimensions.length; ++j) + object.dimensions[j] = $root.google.analytics.data.v1beta.Dimension.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.data.v1beta.Metric.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.data.v1beta.DateRange.toObject(message.dateRanges[j], options); + } + if (message.dimensionFilter != null && message.hasOwnProperty("dimensionFilter")) + object.dimensionFilter = $root.google.analytics.data.v1beta.FilterExpression.toObject(message.dimensionFilter, options); + if (message.metricFilter != null && message.hasOwnProperty("metricFilter")) + object.metricFilter = $root.google.analytics.data.v1beta.FilterExpression.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.metricAggregations && message.metricAggregations.length) { + object.metricAggregations = []; + for (var j = 0; j < message.metricAggregations.length; ++j) + object.metricAggregations[j] = options.enums === String ? $root.google.analytics.data.v1beta.MetricAggregation[message.metricAggregations[j]] === undefined ? message.metricAggregations[j] : $root.google.analytics.data.v1beta.MetricAggregation[message.metricAggregations[j]] : message.metricAggregations[j]; + } + if (message.orderBys && message.orderBys.length) { + object.orderBys = []; + for (var j = 0; j < message.orderBys.length; ++j) + object.orderBys[j] = $root.google.analytics.data.v1beta.OrderBy.toObject(message.orderBys[j], options); + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.cohortSpec != null && message.hasOwnProperty("cohortSpec")) + object.cohortSpec = $root.google.analytics.data.v1beta.CohortSpec.toObject(message.cohortSpec, options); + if (message.keepEmptyRows != null && message.hasOwnProperty("keepEmptyRows")) + object.keepEmptyRows = message.keepEmptyRows; + if (message.returnPropertyQuota != null && message.hasOwnProperty("returnPropertyQuota")) + object.returnPropertyQuota = message.returnPropertyQuota; + return object; + }; + + /** + * Converts this RunReportRequest to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.RunReportRequest + * @instance + * @returns {Object.} JSON object + */ + RunReportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunReportRequest + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.RunReportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunReportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.RunReportRequest"; + }; + + return RunReportRequest; + })(); + + v1beta.RunReportResponse = (function() { + + /** + * Properties of a RunReportResponse. + * @memberof google.analytics.data.v1beta + * @interface IRunReportResponse + * @property {Array.|null} [dimensionHeaders] RunReportResponse dimensionHeaders + * @property {Array.|null} [metricHeaders] RunReportResponse metricHeaders + * @property {Array.|null} [rows] RunReportResponse rows + * @property {Array.|null} [totals] RunReportResponse totals + * @property {Array.|null} [maximums] RunReportResponse maximums + * @property {Array.|null} [minimums] RunReportResponse minimums + * @property {number|null} [rowCount] RunReportResponse rowCount + * @property {google.analytics.data.v1beta.IResponseMetaData|null} [metadata] RunReportResponse metadata + * @property {google.analytics.data.v1beta.IPropertyQuota|null} [propertyQuota] RunReportResponse propertyQuota + * @property {string|null} [kind] RunReportResponse kind + */ + + /** + * Constructs a new RunReportResponse. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a RunReportResponse. + * @implements IRunReportResponse + * @constructor + * @param {google.analytics.data.v1beta.IRunReportResponse=} [properties] Properties to set + */ + function RunReportResponse(properties) { + this.dimensionHeaders = []; + this.metricHeaders = []; + this.rows = []; + this.totals = []; + this.maximums = []; + this.minimums = []; + 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]]; + } + + /** + * RunReportResponse dimensionHeaders. + * @member {Array.} dimensionHeaders + * @memberof google.analytics.data.v1beta.RunReportResponse + * @instance + */ + RunReportResponse.prototype.dimensionHeaders = $util.emptyArray; + + /** + * RunReportResponse metricHeaders. + * @member {Array.} metricHeaders + * @memberof google.analytics.data.v1beta.RunReportResponse + * @instance + */ + RunReportResponse.prototype.metricHeaders = $util.emptyArray; + + /** + * RunReportResponse rows. + * @member {Array.} rows + * @memberof google.analytics.data.v1beta.RunReportResponse + * @instance + */ + RunReportResponse.prototype.rows = $util.emptyArray; + + /** + * RunReportResponse totals. + * @member {Array.} totals + * @memberof google.analytics.data.v1beta.RunReportResponse + * @instance + */ + RunReportResponse.prototype.totals = $util.emptyArray; + + /** + * RunReportResponse maximums. + * @member {Array.} maximums + * @memberof google.analytics.data.v1beta.RunReportResponse + * @instance + */ + RunReportResponse.prototype.maximums = $util.emptyArray; + + /** + * RunReportResponse minimums. + * @member {Array.} minimums + * @memberof google.analytics.data.v1beta.RunReportResponse + * @instance + */ + RunReportResponse.prototype.minimums = $util.emptyArray; + + /** + * RunReportResponse rowCount. + * @member {number} rowCount + * @memberof google.analytics.data.v1beta.RunReportResponse + * @instance + */ + RunReportResponse.prototype.rowCount = 0; + + /** + * RunReportResponse metadata. + * @member {google.analytics.data.v1beta.IResponseMetaData|null|undefined} metadata + * @memberof google.analytics.data.v1beta.RunReportResponse + * @instance + */ + RunReportResponse.prototype.metadata = null; + + /** + * RunReportResponse propertyQuota. + * @member {google.analytics.data.v1beta.IPropertyQuota|null|undefined} propertyQuota + * @memberof google.analytics.data.v1beta.RunReportResponse + * @instance + */ + RunReportResponse.prototype.propertyQuota = null; + + /** + * RunReportResponse kind. + * @member {string} kind + * @memberof google.analytics.data.v1beta.RunReportResponse + * @instance + */ + RunReportResponse.prototype.kind = ""; + + /** + * Creates a new RunReportResponse instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.RunReportResponse + * @static + * @param {google.analytics.data.v1beta.IRunReportResponse=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.RunReportResponse} RunReportResponse instance + */ + RunReportResponse.create = function create(properties) { + return new RunReportResponse(properties); + }; + + /** + * Encodes the specified RunReportResponse message. Does not implicitly {@link google.analytics.data.v1beta.RunReportResponse.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.RunReportResponse + * @static + * @param {google.analytics.data.v1beta.IRunReportResponse} message RunReportResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunReportResponse.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.data.v1beta.DimensionHeader.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.data.v1beta.MetricHeader.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.data.v1beta.Row.encode(message.rows[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totals != null && message.totals.length) + for (var i = 0; i < message.totals.length; ++i) + $root.google.analytics.data.v1beta.Row.encode(message.totals[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.maximums != null && message.maximums.length) + for (var i = 0; i < message.maximums.length; ++i) + $root.google.analytics.data.v1beta.Row.encode(message.maximums[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.minimums != null && message.minimums.length) + for (var i = 0; i < message.minimums.length; ++i) + $root.google.analytics.data.v1beta.Row.encode(message.minimums[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.rowCount); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.analytics.data.v1beta.ResponseMetaData.encode(message.metadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.propertyQuota != null && Object.hasOwnProperty.call(message, "propertyQuota")) + $root.google.analytics.data.v1beta.PropertyQuota.encode(message.propertyQuota, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.kind); + return writer; + }; + + /** + * Encodes the specified RunReportResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.RunReportResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.RunReportResponse + * @static + * @param {google.analytics.data.v1beta.IRunReportResponse} message RunReportResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunReportResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunReportResponse message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.RunReportResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.RunReportResponse} RunReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunReportResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.RunReportResponse(); + 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.data.v1beta.DimensionHeader.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.metricHeaders && message.metricHeaders.length)) + message.metricHeaders = []; + message.metricHeaders.push($root.google.analytics.data.v1beta.MetricHeader.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.analytics.data.v1beta.Row.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.totals && message.totals.length)) + message.totals = []; + message.totals.push($root.google.analytics.data.v1beta.Row.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.maximums && message.maximums.length)) + message.maximums = []; + message.maximums.push($root.google.analytics.data.v1beta.Row.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.minimums && message.minimums.length)) + message.minimums = []; + message.minimums.push($root.google.analytics.data.v1beta.Row.decode(reader, reader.uint32())); + break; + } + case 7: { + message.rowCount = reader.int32(); + break; + } + case 8: { + message.metadata = $root.google.analytics.data.v1beta.ResponseMetaData.decode(reader, reader.uint32()); + break; + } + case 9: { + message.propertyQuota = $root.google.analytics.data.v1beta.PropertyQuota.decode(reader, reader.uint32()); + break; + } + case 10: { + message.kind = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunReportResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.RunReportResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.RunReportResponse} RunReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunReportResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunReportResponse message. + * @function verify + * @memberof google.analytics.data.v1beta.RunReportResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunReportResponse.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.data.v1beta.DimensionHeader.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.data.v1beta.MetricHeader.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.data.v1beta.Row.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + if (message.totals != null && message.hasOwnProperty("totals")) { + if (!Array.isArray(message.totals)) + return "totals: array expected"; + for (var i = 0; i < message.totals.length; ++i) { + var error = $root.google.analytics.data.v1beta.Row.verify(message.totals[i]); + if (error) + return "totals." + error; + } + } + if (message.maximums != null && message.hasOwnProperty("maximums")) { + if (!Array.isArray(message.maximums)) + return "maximums: array expected"; + for (var i = 0; i < message.maximums.length; ++i) { + var error = $root.google.analytics.data.v1beta.Row.verify(message.maximums[i]); + if (error) + return "maximums." + error; + } + } + if (message.minimums != null && message.hasOwnProperty("minimums")) { + if (!Array.isArray(message.minimums)) + return "minimums: array expected"; + for (var i = 0; i < message.minimums.length; ++i) { + var error = $root.google.analytics.data.v1beta.Row.verify(message.minimums[i]); + if (error) + return "minimums." + error; + } + } + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount)) + return "rowCount: integer expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.analytics.data.v1beta.ResponseMetaData.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.propertyQuota != null && message.hasOwnProperty("propertyQuota")) { + var error = $root.google.analytics.data.v1beta.PropertyQuota.verify(message.propertyQuota); + if (error) + return "propertyQuota." + error; + } + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + return null; + }; + + /** + * Creates a RunReportResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.RunReportResponse + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.RunReportResponse} RunReportResponse + */ + RunReportResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.RunReportResponse) + return object; + var message = new $root.google.analytics.data.v1beta.RunReportResponse(); + if (object.dimensionHeaders) { + if (!Array.isArray(object.dimensionHeaders)) + throw TypeError(".google.analytics.data.v1beta.RunReportResponse.dimensionHeaders: array expected"); + message.dimensionHeaders = []; + for (var i = 0; i < object.dimensionHeaders.length; ++i) { + if (typeof object.dimensionHeaders[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportResponse.dimensionHeaders: object expected"); + message.dimensionHeaders[i] = $root.google.analytics.data.v1beta.DimensionHeader.fromObject(object.dimensionHeaders[i]); + } + } + if (object.metricHeaders) { + if (!Array.isArray(object.metricHeaders)) + throw TypeError(".google.analytics.data.v1beta.RunReportResponse.metricHeaders: array expected"); + message.metricHeaders = []; + for (var i = 0; i < object.metricHeaders.length; ++i) { + if (typeof object.metricHeaders[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportResponse.metricHeaders: object expected"); + message.metricHeaders[i] = $root.google.analytics.data.v1beta.MetricHeader.fromObject(object.metricHeaders[i]); + } + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.analytics.data.v1beta.RunReportResponse.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportResponse.rows: object expected"); + message.rows[i] = $root.google.analytics.data.v1beta.Row.fromObject(object.rows[i]); + } + } + if (object.totals) { + if (!Array.isArray(object.totals)) + throw TypeError(".google.analytics.data.v1beta.RunReportResponse.totals: array expected"); + message.totals = []; + for (var i = 0; i < object.totals.length; ++i) { + if (typeof object.totals[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportResponse.totals: object expected"); + message.totals[i] = $root.google.analytics.data.v1beta.Row.fromObject(object.totals[i]); + } + } + if (object.maximums) { + if (!Array.isArray(object.maximums)) + throw TypeError(".google.analytics.data.v1beta.RunReportResponse.maximums: array expected"); + message.maximums = []; + for (var i = 0; i < object.maximums.length; ++i) { + if (typeof object.maximums[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportResponse.maximums: object expected"); + message.maximums[i] = $root.google.analytics.data.v1beta.Row.fromObject(object.maximums[i]); + } + } + if (object.minimums) { + if (!Array.isArray(object.minimums)) + throw TypeError(".google.analytics.data.v1beta.RunReportResponse.minimums: array expected"); + message.minimums = []; + for (var i = 0; i < object.minimums.length; ++i) { + if (typeof object.minimums[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportResponse.minimums: object expected"); + message.minimums[i] = $root.google.analytics.data.v1beta.Row.fromObject(object.minimums[i]); + } + } + if (object.rowCount != null) + message.rowCount = object.rowCount | 0; + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportResponse.metadata: object expected"); + message.metadata = $root.google.analytics.data.v1beta.ResponseMetaData.fromObject(object.metadata); + } + if (object.propertyQuota != null) { + if (typeof object.propertyQuota !== "object") + throw TypeError(".google.analytics.data.v1beta.RunReportResponse.propertyQuota: object expected"); + message.propertyQuota = $root.google.analytics.data.v1beta.PropertyQuota.fromObject(object.propertyQuota); + } + if (object.kind != null) + message.kind = String(object.kind); + return message; + }; + + /** + * Creates a plain object from a RunReportResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.RunReportResponse + * @static + * @param {google.analytics.data.v1beta.RunReportResponse} message RunReportResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunReportResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dimensionHeaders = []; + object.metricHeaders = []; + object.rows = []; + object.totals = []; + object.maximums = []; + object.minimums = []; + } + if (options.defaults) { + object.rowCount = 0; + object.metadata = null; + object.propertyQuota = null; + object.kind = ""; + } + if (message.dimensionHeaders && message.dimensionHeaders.length) { + object.dimensionHeaders = []; + for (var j = 0; j < message.dimensionHeaders.length; ++j) + object.dimensionHeaders[j] = $root.google.analytics.data.v1beta.DimensionHeader.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.data.v1beta.MetricHeader.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.data.v1beta.Row.toObject(message.rows[j], options); + } + if (message.totals && message.totals.length) { + object.totals = []; + for (var j = 0; j < message.totals.length; ++j) + object.totals[j] = $root.google.analytics.data.v1beta.Row.toObject(message.totals[j], options); + } + if (message.maximums && message.maximums.length) { + object.maximums = []; + for (var j = 0; j < message.maximums.length; ++j) + object.maximums[j] = $root.google.analytics.data.v1beta.Row.toObject(message.maximums[j], options); + } + if (message.minimums && message.minimums.length) { + object.minimums = []; + for (var j = 0; j < message.minimums.length; ++j) + object.minimums[j] = $root.google.analytics.data.v1beta.Row.toObject(message.minimums[j], options); + } + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + object.rowCount = message.rowCount; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.analytics.data.v1beta.ResponseMetaData.toObject(message.metadata, options); + if (message.propertyQuota != null && message.hasOwnProperty("propertyQuota")) + object.propertyQuota = $root.google.analytics.data.v1beta.PropertyQuota.toObject(message.propertyQuota, options); + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + return object; + }; + + /** + * Converts this RunReportResponse to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.RunReportResponse + * @instance + * @returns {Object.} JSON object + */ + RunReportResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunReportResponse + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.RunReportResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunReportResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.RunReportResponse"; + }; + + return RunReportResponse; + })(); + + v1beta.RunPivotReportRequest = (function() { + + /** + * Properties of a RunPivotReportRequest. + * @memberof google.analytics.data.v1beta + * @interface IRunPivotReportRequest + * @property {string|null} [property] RunPivotReportRequest property + * @property {Array.|null} [dimensions] RunPivotReportRequest dimensions + * @property {Array.|null} [metrics] RunPivotReportRequest metrics + * @property {Array.|null} [dateRanges] RunPivotReportRequest dateRanges + * @property {Array.|null} [pivots] RunPivotReportRequest pivots + * @property {google.analytics.data.v1beta.IFilterExpression|null} [dimensionFilter] RunPivotReportRequest dimensionFilter + * @property {google.analytics.data.v1beta.IFilterExpression|null} [metricFilter] RunPivotReportRequest metricFilter + * @property {string|null} [currencyCode] RunPivotReportRequest currencyCode + * @property {google.analytics.data.v1beta.ICohortSpec|null} [cohortSpec] RunPivotReportRequest cohortSpec + * @property {boolean|null} [keepEmptyRows] RunPivotReportRequest keepEmptyRows + * @property {boolean|null} [returnPropertyQuota] RunPivotReportRequest returnPropertyQuota + */ + + /** + * Constructs a new RunPivotReportRequest. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a RunPivotReportRequest. + * @implements IRunPivotReportRequest + * @constructor + * @param {google.analytics.data.v1beta.IRunPivotReportRequest=} [properties] Properties to set + */ + function RunPivotReportRequest(properties) { + this.dimensions = []; + this.metrics = []; + this.dateRanges = []; + this.pivots = []; + 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]]; + } + + /** + * RunPivotReportRequest property. + * @member {string} property + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @instance + */ + RunPivotReportRequest.prototype.property = ""; + + /** + * RunPivotReportRequest dimensions. + * @member {Array.} dimensions + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @instance + */ + RunPivotReportRequest.prototype.dimensions = $util.emptyArray; + + /** + * RunPivotReportRequest metrics. + * @member {Array.} metrics + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @instance + */ + RunPivotReportRequest.prototype.metrics = $util.emptyArray; + + /** + * RunPivotReportRequest dateRanges. + * @member {Array.} dateRanges + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @instance + */ + RunPivotReportRequest.prototype.dateRanges = $util.emptyArray; + + /** + * RunPivotReportRequest pivots. + * @member {Array.} pivots + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @instance + */ + RunPivotReportRequest.prototype.pivots = $util.emptyArray; + + /** + * RunPivotReportRequest dimensionFilter. + * @member {google.analytics.data.v1beta.IFilterExpression|null|undefined} dimensionFilter + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @instance + */ + RunPivotReportRequest.prototype.dimensionFilter = null; + + /** + * RunPivotReportRequest metricFilter. + * @member {google.analytics.data.v1beta.IFilterExpression|null|undefined} metricFilter + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @instance + */ + RunPivotReportRequest.prototype.metricFilter = null; + + /** + * RunPivotReportRequest currencyCode. + * @member {string} currencyCode + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @instance + */ + RunPivotReportRequest.prototype.currencyCode = ""; + + /** + * RunPivotReportRequest cohortSpec. + * @member {google.analytics.data.v1beta.ICohortSpec|null|undefined} cohortSpec + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @instance + */ + RunPivotReportRequest.prototype.cohortSpec = null; + + /** + * RunPivotReportRequest keepEmptyRows. + * @member {boolean} keepEmptyRows + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @instance + */ + RunPivotReportRequest.prototype.keepEmptyRows = false; + + /** + * RunPivotReportRequest returnPropertyQuota. + * @member {boolean} returnPropertyQuota + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @instance + */ + RunPivotReportRequest.prototype.returnPropertyQuota = false; + + /** + * Creates a new RunPivotReportRequest instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @static + * @param {google.analytics.data.v1beta.IRunPivotReportRequest=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.RunPivotReportRequest} RunPivotReportRequest instance + */ + RunPivotReportRequest.create = function create(properties) { + return new RunPivotReportRequest(properties); + }; + + /** + * Encodes the specified RunPivotReportRequest message. Does not implicitly {@link google.analytics.data.v1beta.RunPivotReportRequest.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @static + * @param {google.analytics.data.v1beta.IRunPivotReportRequest} message RunPivotReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunPivotReportRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && Object.hasOwnProperty.call(message, "property")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); + if (message.dimensions != null && message.dimensions.length) + for (var i = 0; i < message.dimensions.length; ++i) + $root.google.analytics.data.v1beta.Dimension.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.data.v1beta.Metric.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.data.v1beta.DateRange.encode(message.dateRanges[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pivots != null && message.pivots.length) + for (var i = 0; i < message.pivots.length; ++i) + $root.google.analytics.data.v1beta.Pivot.encode(message.pivots[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.dimensionFilter != null && Object.hasOwnProperty.call(message, "dimensionFilter")) + $root.google.analytics.data.v1beta.FilterExpression.encode(message.dimensionFilter, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.metricFilter != null && Object.hasOwnProperty.call(message, "metricFilter")) + $root.google.analytics.data.v1beta.FilterExpression.encode(message.metricFilter, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.currencyCode); + if (message.cohortSpec != null && Object.hasOwnProperty.call(message, "cohortSpec")) + $root.google.analytics.data.v1beta.CohortSpec.encode(message.cohortSpec, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.keepEmptyRows != null && Object.hasOwnProperty.call(message, "keepEmptyRows")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.keepEmptyRows); + if (message.returnPropertyQuota != null && Object.hasOwnProperty.call(message, "returnPropertyQuota")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.returnPropertyQuota); + return writer; + }; + + /** + * Encodes the specified RunPivotReportRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.RunPivotReportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @static + * @param {google.analytics.data.v1beta.IRunPivotReportRequest} message RunPivotReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunPivotReportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunPivotReportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.RunPivotReportRequest} RunPivotReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunPivotReportRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.RunPivotReportRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.property = reader.string(); + break; + } + case 2: { + if (!(message.dimensions && message.dimensions.length)) + message.dimensions = []; + message.dimensions.push($root.google.analytics.data.v1beta.Dimension.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.analytics.data.v1beta.Metric.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.dateRanges && message.dateRanges.length)) + message.dateRanges = []; + message.dateRanges.push($root.google.analytics.data.v1beta.DateRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.pivots && message.pivots.length)) + message.pivots = []; + message.pivots.push($root.google.analytics.data.v1beta.Pivot.decode(reader, reader.uint32())); + break; + } + case 6: { + message.dimensionFilter = $root.google.analytics.data.v1beta.FilterExpression.decode(reader, reader.uint32()); + break; + } + case 7: { + message.metricFilter = $root.google.analytics.data.v1beta.FilterExpression.decode(reader, reader.uint32()); + break; + } + case 8: { + message.currencyCode = reader.string(); + break; + } + case 9: { + message.cohortSpec = $root.google.analytics.data.v1beta.CohortSpec.decode(reader, reader.uint32()); + break; + } + case 10: { + message.keepEmptyRows = reader.bool(); + break; + } + case 11: { + message.returnPropertyQuota = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunPivotReportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.RunPivotReportRequest} RunPivotReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunPivotReportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunPivotReportRequest message. + * @function verify + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunPivotReportRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) + if (!$util.isString(message.property)) + return "property: 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.data.v1beta.Dimension.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.data.v1beta.Metric.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.data.v1beta.DateRange.verify(message.dateRanges[i]); + if (error) + return "dateRanges." + error; + } + } + if (message.pivots != null && message.hasOwnProperty("pivots")) { + if (!Array.isArray(message.pivots)) + return "pivots: array expected"; + for (var i = 0; i < message.pivots.length; ++i) { + var error = $root.google.analytics.data.v1beta.Pivot.verify(message.pivots[i]); + if (error) + return "pivots." + error; + } + } + if (message.dimensionFilter != null && message.hasOwnProperty("dimensionFilter")) { + var error = $root.google.analytics.data.v1beta.FilterExpression.verify(message.dimensionFilter); + if (error) + return "dimensionFilter." + error; + } + if (message.metricFilter != null && message.hasOwnProperty("metricFilter")) { + var error = $root.google.analytics.data.v1beta.FilterExpression.verify(message.metricFilter); + if (error) + return "metricFilter." + error; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.cohortSpec != null && message.hasOwnProperty("cohortSpec")) { + var error = $root.google.analytics.data.v1beta.CohortSpec.verify(message.cohortSpec); + if (error) + return "cohortSpec." + error; + } + if (message.keepEmptyRows != null && message.hasOwnProperty("keepEmptyRows")) + if (typeof message.keepEmptyRows !== "boolean") + return "keepEmptyRows: boolean expected"; + if (message.returnPropertyQuota != null && message.hasOwnProperty("returnPropertyQuota")) + if (typeof message.returnPropertyQuota !== "boolean") + return "returnPropertyQuota: boolean expected"; + return null; + }; + + /** + * Creates a RunPivotReportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.RunPivotReportRequest} RunPivotReportRequest + */ + RunPivotReportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.RunPivotReportRequest) + return object; + var message = new $root.google.analytics.data.v1beta.RunPivotReportRequest(); + if (object.property != null) + message.property = String(object.property); + if (object.dimensions) { + if (!Array.isArray(object.dimensions)) + throw TypeError(".google.analytics.data.v1beta.RunPivotReportRequest.dimensions: array expected"); + message.dimensions = []; + for (var i = 0; i < object.dimensions.length; ++i) { + if (typeof object.dimensions[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunPivotReportRequest.dimensions: object expected"); + message.dimensions[i] = $root.google.analytics.data.v1beta.Dimension.fromObject(object.dimensions[i]); + } + } + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.analytics.data.v1beta.RunPivotReportRequest.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunPivotReportRequest.metrics: object expected"); + message.metrics[i] = $root.google.analytics.data.v1beta.Metric.fromObject(object.metrics[i]); + } + } + if (object.dateRanges) { + if (!Array.isArray(object.dateRanges)) + throw TypeError(".google.analytics.data.v1beta.RunPivotReportRequest.dateRanges: array expected"); + message.dateRanges = []; + for (var i = 0; i < object.dateRanges.length; ++i) { + if (typeof object.dateRanges[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunPivotReportRequest.dateRanges: object expected"); + message.dateRanges[i] = $root.google.analytics.data.v1beta.DateRange.fromObject(object.dateRanges[i]); + } + } + if (object.pivots) { + if (!Array.isArray(object.pivots)) + throw TypeError(".google.analytics.data.v1beta.RunPivotReportRequest.pivots: array expected"); + message.pivots = []; + for (var i = 0; i < object.pivots.length; ++i) { + if (typeof object.pivots[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunPivotReportRequest.pivots: object expected"); + message.pivots[i] = $root.google.analytics.data.v1beta.Pivot.fromObject(object.pivots[i]); + } + } + if (object.dimensionFilter != null) { + if (typeof object.dimensionFilter !== "object") + throw TypeError(".google.analytics.data.v1beta.RunPivotReportRequest.dimensionFilter: object expected"); + message.dimensionFilter = $root.google.analytics.data.v1beta.FilterExpression.fromObject(object.dimensionFilter); + } + if (object.metricFilter != null) { + if (typeof object.metricFilter !== "object") + throw TypeError(".google.analytics.data.v1beta.RunPivotReportRequest.metricFilter: object expected"); + message.metricFilter = $root.google.analytics.data.v1beta.FilterExpression.fromObject(object.metricFilter); + } + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.cohortSpec != null) { + if (typeof object.cohortSpec !== "object") + throw TypeError(".google.analytics.data.v1beta.RunPivotReportRequest.cohortSpec: object expected"); + message.cohortSpec = $root.google.analytics.data.v1beta.CohortSpec.fromObject(object.cohortSpec); + } + if (object.keepEmptyRows != null) + message.keepEmptyRows = Boolean(object.keepEmptyRows); + if (object.returnPropertyQuota != null) + message.returnPropertyQuota = Boolean(object.returnPropertyQuota); + return message; + }; + + /** + * Creates a plain object from a RunPivotReportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @static + * @param {google.analytics.data.v1beta.RunPivotReportRequest} message RunPivotReportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunPivotReportRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dimensions = []; + object.metrics = []; + object.dateRanges = []; + object.pivots = []; + } + if (options.defaults) { + object.property = ""; + object.dimensionFilter = null; + object.metricFilter = null; + object.currencyCode = ""; + object.cohortSpec = null; + object.keepEmptyRows = false; + object.returnPropertyQuota = false; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = message.property; + if (message.dimensions && message.dimensions.length) { + object.dimensions = []; + for (var j = 0; j < message.dimensions.length; ++j) + object.dimensions[j] = $root.google.analytics.data.v1beta.Dimension.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.data.v1beta.Metric.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.data.v1beta.DateRange.toObject(message.dateRanges[j], options); + } + if (message.pivots && message.pivots.length) { + object.pivots = []; + for (var j = 0; j < message.pivots.length; ++j) + object.pivots[j] = $root.google.analytics.data.v1beta.Pivot.toObject(message.pivots[j], options); + } + if (message.dimensionFilter != null && message.hasOwnProperty("dimensionFilter")) + object.dimensionFilter = $root.google.analytics.data.v1beta.FilterExpression.toObject(message.dimensionFilter, options); + if (message.metricFilter != null && message.hasOwnProperty("metricFilter")) + object.metricFilter = $root.google.analytics.data.v1beta.FilterExpression.toObject(message.metricFilter, options); + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.cohortSpec != null && message.hasOwnProperty("cohortSpec")) + object.cohortSpec = $root.google.analytics.data.v1beta.CohortSpec.toObject(message.cohortSpec, options); + if (message.keepEmptyRows != null && message.hasOwnProperty("keepEmptyRows")) + object.keepEmptyRows = message.keepEmptyRows; + if (message.returnPropertyQuota != null && message.hasOwnProperty("returnPropertyQuota")) + object.returnPropertyQuota = message.returnPropertyQuota; + return object; + }; + + /** + * Converts this RunPivotReportRequest to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @instance + * @returns {Object.} JSON object + */ + RunPivotReportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunPivotReportRequest + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.RunPivotReportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunPivotReportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.RunPivotReportRequest"; + }; + + return RunPivotReportRequest; + })(); + + v1beta.RunPivotReportResponse = (function() { + + /** + * Properties of a RunPivotReportResponse. + * @memberof google.analytics.data.v1beta + * @interface IRunPivotReportResponse + * @property {Array.|null} [pivotHeaders] RunPivotReportResponse pivotHeaders + * @property {Array.|null} [dimensionHeaders] RunPivotReportResponse dimensionHeaders + * @property {Array.|null} [metricHeaders] RunPivotReportResponse metricHeaders + * @property {Array.|null} [rows] RunPivotReportResponse rows + * @property {Array.|null} [aggregates] RunPivotReportResponse aggregates + * @property {google.analytics.data.v1beta.IResponseMetaData|null} [metadata] RunPivotReportResponse metadata + * @property {google.analytics.data.v1beta.IPropertyQuota|null} [propertyQuota] RunPivotReportResponse propertyQuota + * @property {string|null} [kind] RunPivotReportResponse kind + */ + + /** + * Constructs a new RunPivotReportResponse. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a RunPivotReportResponse. + * @implements IRunPivotReportResponse + * @constructor + * @param {google.analytics.data.v1beta.IRunPivotReportResponse=} [properties] Properties to set + */ + function RunPivotReportResponse(properties) { + this.pivotHeaders = []; + this.dimensionHeaders = []; + this.metricHeaders = []; + this.rows = []; + this.aggregates = []; + 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]]; + } + + /** + * RunPivotReportResponse pivotHeaders. + * @member {Array.} pivotHeaders + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @instance + */ + RunPivotReportResponse.prototype.pivotHeaders = $util.emptyArray; + + /** + * RunPivotReportResponse dimensionHeaders. + * @member {Array.} dimensionHeaders + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @instance + */ + RunPivotReportResponse.prototype.dimensionHeaders = $util.emptyArray; + + /** + * RunPivotReportResponse metricHeaders. + * @member {Array.} metricHeaders + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @instance + */ + RunPivotReportResponse.prototype.metricHeaders = $util.emptyArray; + + /** + * RunPivotReportResponse rows. + * @member {Array.} rows + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @instance + */ + RunPivotReportResponse.prototype.rows = $util.emptyArray; + + /** + * RunPivotReportResponse aggregates. + * @member {Array.} aggregates + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @instance + */ + RunPivotReportResponse.prototype.aggregates = $util.emptyArray; + + /** + * RunPivotReportResponse metadata. + * @member {google.analytics.data.v1beta.IResponseMetaData|null|undefined} metadata + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @instance + */ + RunPivotReportResponse.prototype.metadata = null; + + /** + * RunPivotReportResponse propertyQuota. + * @member {google.analytics.data.v1beta.IPropertyQuota|null|undefined} propertyQuota + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @instance + */ + RunPivotReportResponse.prototype.propertyQuota = null; + + /** + * RunPivotReportResponse kind. + * @member {string} kind + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @instance + */ + RunPivotReportResponse.prototype.kind = ""; + + /** + * Creates a new RunPivotReportResponse instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @static + * @param {google.analytics.data.v1beta.IRunPivotReportResponse=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.RunPivotReportResponse} RunPivotReportResponse instance + */ + RunPivotReportResponse.create = function create(properties) { + return new RunPivotReportResponse(properties); + }; + + /** + * Encodes the specified RunPivotReportResponse message. Does not implicitly {@link google.analytics.data.v1beta.RunPivotReportResponse.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @static + * @param {google.analytics.data.v1beta.IRunPivotReportResponse} message RunPivotReportResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunPivotReportResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pivotHeaders != null && message.pivotHeaders.length) + for (var i = 0; i < message.pivotHeaders.length; ++i) + $root.google.analytics.data.v1beta.PivotHeader.encode(message.pivotHeaders[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dimensionHeaders != null && message.dimensionHeaders.length) + for (var i = 0; i < message.dimensionHeaders.length; ++i) + $root.google.analytics.data.v1beta.DimensionHeader.encode(message.dimensionHeaders[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metricHeaders != null && message.metricHeaders.length) + for (var i = 0; i < message.metricHeaders.length; ++i) + $root.google.analytics.data.v1beta.MetricHeader.encode(message.metricHeaders[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.analytics.data.v1beta.Row.encode(message.rows[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.aggregates != null && message.aggregates.length) + for (var i = 0; i < message.aggregates.length; ++i) + $root.google.analytics.data.v1beta.Row.encode(message.aggregates[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.analytics.data.v1beta.ResponseMetaData.encode(message.metadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.propertyQuota != null && Object.hasOwnProperty.call(message, "propertyQuota")) + $root.google.analytics.data.v1beta.PropertyQuota.encode(message.propertyQuota, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.kind); + return writer; + }; + + /** + * Encodes the specified RunPivotReportResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.RunPivotReportResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @static + * @param {google.analytics.data.v1beta.IRunPivotReportResponse} message RunPivotReportResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunPivotReportResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunPivotReportResponse message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.RunPivotReportResponse} RunPivotReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunPivotReportResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.RunPivotReportResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.pivotHeaders && message.pivotHeaders.length)) + message.pivotHeaders = []; + message.pivotHeaders.push($root.google.analytics.data.v1beta.PivotHeader.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.dimensionHeaders && message.dimensionHeaders.length)) + message.dimensionHeaders = []; + message.dimensionHeaders.push($root.google.analytics.data.v1beta.DimensionHeader.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.metricHeaders && message.metricHeaders.length)) + message.metricHeaders = []; + message.metricHeaders.push($root.google.analytics.data.v1beta.MetricHeader.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.analytics.data.v1beta.Row.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.aggregates && message.aggregates.length)) + message.aggregates = []; + message.aggregates.push($root.google.analytics.data.v1beta.Row.decode(reader, reader.uint32())); + break; + } + case 6: { + message.metadata = $root.google.analytics.data.v1beta.ResponseMetaData.decode(reader, reader.uint32()); + break; + } + case 7: { + message.propertyQuota = $root.google.analytics.data.v1beta.PropertyQuota.decode(reader, reader.uint32()); + break; + } + case 8: { + message.kind = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunPivotReportResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.RunPivotReportResponse} RunPivotReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunPivotReportResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunPivotReportResponse message. + * @function verify + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunPivotReportResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pivotHeaders != null && message.hasOwnProperty("pivotHeaders")) { + if (!Array.isArray(message.pivotHeaders)) + return "pivotHeaders: array expected"; + for (var i = 0; i < message.pivotHeaders.length; ++i) { + var error = $root.google.analytics.data.v1beta.PivotHeader.verify(message.pivotHeaders[i]); + if (error) + return "pivotHeaders." + error; + } + } + 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.data.v1beta.DimensionHeader.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.data.v1beta.MetricHeader.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.data.v1beta.Row.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + if (message.aggregates != null && message.hasOwnProperty("aggregates")) { + if (!Array.isArray(message.aggregates)) + return "aggregates: array expected"; + for (var i = 0; i < message.aggregates.length; ++i) { + var error = $root.google.analytics.data.v1beta.Row.verify(message.aggregates[i]); + if (error) + return "aggregates." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.analytics.data.v1beta.ResponseMetaData.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.propertyQuota != null && message.hasOwnProperty("propertyQuota")) { + var error = $root.google.analytics.data.v1beta.PropertyQuota.verify(message.propertyQuota); + if (error) + return "propertyQuota." + error; + } + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + return null; + }; + + /** + * Creates a RunPivotReportResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.RunPivotReportResponse} RunPivotReportResponse + */ + RunPivotReportResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.RunPivotReportResponse) + return object; + var message = new $root.google.analytics.data.v1beta.RunPivotReportResponse(); + if (object.pivotHeaders) { + if (!Array.isArray(object.pivotHeaders)) + throw TypeError(".google.analytics.data.v1beta.RunPivotReportResponse.pivotHeaders: array expected"); + message.pivotHeaders = []; + for (var i = 0; i < object.pivotHeaders.length; ++i) { + if (typeof object.pivotHeaders[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunPivotReportResponse.pivotHeaders: object expected"); + message.pivotHeaders[i] = $root.google.analytics.data.v1beta.PivotHeader.fromObject(object.pivotHeaders[i]); + } + } + if (object.dimensionHeaders) { + if (!Array.isArray(object.dimensionHeaders)) + throw TypeError(".google.analytics.data.v1beta.RunPivotReportResponse.dimensionHeaders: array expected"); + message.dimensionHeaders = []; + for (var i = 0; i < object.dimensionHeaders.length; ++i) { + if (typeof object.dimensionHeaders[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunPivotReportResponse.dimensionHeaders: object expected"); + message.dimensionHeaders[i] = $root.google.analytics.data.v1beta.DimensionHeader.fromObject(object.dimensionHeaders[i]); + } + } + if (object.metricHeaders) { + if (!Array.isArray(object.metricHeaders)) + throw TypeError(".google.analytics.data.v1beta.RunPivotReportResponse.metricHeaders: array expected"); + message.metricHeaders = []; + for (var i = 0; i < object.metricHeaders.length; ++i) { + if (typeof object.metricHeaders[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunPivotReportResponse.metricHeaders: object expected"); + message.metricHeaders[i] = $root.google.analytics.data.v1beta.MetricHeader.fromObject(object.metricHeaders[i]); + } + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.analytics.data.v1beta.RunPivotReportResponse.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunPivotReportResponse.rows: object expected"); + message.rows[i] = $root.google.analytics.data.v1beta.Row.fromObject(object.rows[i]); + } + } + if (object.aggregates) { + if (!Array.isArray(object.aggregates)) + throw TypeError(".google.analytics.data.v1beta.RunPivotReportResponse.aggregates: array expected"); + message.aggregates = []; + for (var i = 0; i < object.aggregates.length; ++i) { + if (typeof object.aggregates[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunPivotReportResponse.aggregates: object expected"); + message.aggregates[i] = $root.google.analytics.data.v1beta.Row.fromObject(object.aggregates[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.analytics.data.v1beta.RunPivotReportResponse.metadata: object expected"); + message.metadata = $root.google.analytics.data.v1beta.ResponseMetaData.fromObject(object.metadata); + } + if (object.propertyQuota != null) { + if (typeof object.propertyQuota !== "object") + throw TypeError(".google.analytics.data.v1beta.RunPivotReportResponse.propertyQuota: object expected"); + message.propertyQuota = $root.google.analytics.data.v1beta.PropertyQuota.fromObject(object.propertyQuota); + } + if (object.kind != null) + message.kind = String(object.kind); + return message; + }; + + /** + * Creates a plain object from a RunPivotReportResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @static + * @param {google.analytics.data.v1beta.RunPivotReportResponse} message RunPivotReportResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunPivotReportResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pivotHeaders = []; + object.dimensionHeaders = []; + object.metricHeaders = []; + object.rows = []; + object.aggregates = []; + } + if (options.defaults) { + object.metadata = null; + object.propertyQuota = null; + object.kind = ""; + } + if (message.pivotHeaders && message.pivotHeaders.length) { + object.pivotHeaders = []; + for (var j = 0; j < message.pivotHeaders.length; ++j) + object.pivotHeaders[j] = $root.google.analytics.data.v1beta.PivotHeader.toObject(message.pivotHeaders[j], options); + } + if (message.dimensionHeaders && message.dimensionHeaders.length) { + object.dimensionHeaders = []; + for (var j = 0; j < message.dimensionHeaders.length; ++j) + object.dimensionHeaders[j] = $root.google.analytics.data.v1beta.DimensionHeader.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.data.v1beta.MetricHeader.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.data.v1beta.Row.toObject(message.rows[j], options); + } + if (message.aggregates && message.aggregates.length) { + object.aggregates = []; + for (var j = 0; j < message.aggregates.length; ++j) + object.aggregates[j] = $root.google.analytics.data.v1beta.Row.toObject(message.aggregates[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.analytics.data.v1beta.ResponseMetaData.toObject(message.metadata, options); + if (message.propertyQuota != null && message.hasOwnProperty("propertyQuota")) + object.propertyQuota = $root.google.analytics.data.v1beta.PropertyQuota.toObject(message.propertyQuota, options); + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + return object; + }; + + /** + * Converts this RunPivotReportResponse to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @instance + * @returns {Object.} JSON object + */ + RunPivotReportResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunPivotReportResponse + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.RunPivotReportResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunPivotReportResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.RunPivotReportResponse"; + }; + + return RunPivotReportResponse; + })(); + + v1beta.BatchRunReportsRequest = (function() { + + /** + * Properties of a BatchRunReportsRequest. + * @memberof google.analytics.data.v1beta + * @interface IBatchRunReportsRequest + * @property {string|null} [property] BatchRunReportsRequest property + * @property {Array.|null} [requests] BatchRunReportsRequest requests + */ + + /** + * Constructs a new BatchRunReportsRequest. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a BatchRunReportsRequest. + * @implements IBatchRunReportsRequest + * @constructor + * @param {google.analytics.data.v1beta.IBatchRunReportsRequest=} [properties] Properties to set + */ + function BatchRunReportsRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * BatchRunReportsRequest property. + * @member {string} property + * @memberof google.analytics.data.v1beta.BatchRunReportsRequest + * @instance + */ + BatchRunReportsRequest.prototype.property = ""; + + /** + * BatchRunReportsRequest requests. + * @member {Array.} requests + * @memberof google.analytics.data.v1beta.BatchRunReportsRequest + * @instance + */ + BatchRunReportsRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new BatchRunReportsRequest instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.BatchRunReportsRequest + * @static + * @param {google.analytics.data.v1beta.IBatchRunReportsRequest=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.BatchRunReportsRequest} BatchRunReportsRequest instance + */ + BatchRunReportsRequest.create = function create(properties) { + return new BatchRunReportsRequest(properties); + }; + + /** + * Encodes the specified BatchRunReportsRequest message. Does not implicitly {@link google.analytics.data.v1beta.BatchRunReportsRequest.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.BatchRunReportsRequest + * @static + * @param {google.analytics.data.v1beta.IBatchRunReportsRequest} message BatchRunReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunReportsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && Object.hasOwnProperty.call(message, "property")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.analytics.data.v1beta.RunReportRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchRunReportsRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.BatchRunReportsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.BatchRunReportsRequest + * @static + * @param {google.analytics.data.v1beta.IBatchRunReportsRequest} message BatchRunReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunReportsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRunReportsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.BatchRunReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.BatchRunReportsRequest} BatchRunReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunReportsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.BatchRunReportsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.property = reader.string(); + break; + } + case 2: { + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.analytics.data.v1beta.RunReportRequest.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRunReportsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.BatchRunReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.BatchRunReportsRequest} BatchRunReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunReportsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRunReportsRequest message. + * @function verify + * @memberof google.analytics.data.v1beta.BatchRunReportsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRunReportsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) + if (!$util.isString(message.property)) + return "property: string expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.analytics.data.v1beta.RunReportRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchRunReportsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.BatchRunReportsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.BatchRunReportsRequest} BatchRunReportsRequest + */ + BatchRunReportsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.BatchRunReportsRequest) + return object; + var message = new $root.google.analytics.data.v1beta.BatchRunReportsRequest(); + if (object.property != null) + message.property = String(object.property); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.analytics.data.v1beta.BatchRunReportsRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.BatchRunReportsRequest.requests: object expected"); + message.requests[i] = $root.google.analytics.data.v1beta.RunReportRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchRunReportsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.BatchRunReportsRequest + * @static + * @param {google.analytics.data.v1beta.BatchRunReportsRequest} message BatchRunReportsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRunReportsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.property = ""; + if (message.property != null && message.hasOwnProperty("property")) + object.property = message.property; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.analytics.data.v1beta.RunReportRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchRunReportsRequest to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.BatchRunReportsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchRunReportsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRunReportsRequest + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.BatchRunReportsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRunReportsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.BatchRunReportsRequest"; + }; + + return BatchRunReportsRequest; + })(); + + v1beta.BatchRunReportsResponse = (function() { + + /** + * Properties of a BatchRunReportsResponse. + * @memberof google.analytics.data.v1beta + * @interface IBatchRunReportsResponse + * @property {Array.|null} [reports] BatchRunReportsResponse reports + * @property {string|null} [kind] BatchRunReportsResponse kind + */ + + /** + * Constructs a new BatchRunReportsResponse. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a BatchRunReportsResponse. + * @implements IBatchRunReportsResponse + * @constructor + * @param {google.analytics.data.v1beta.IBatchRunReportsResponse=} [properties] Properties to set + */ + function BatchRunReportsResponse(properties) { + this.reports = []; + 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]]; + } + + /** + * BatchRunReportsResponse reports. + * @member {Array.} reports + * @memberof google.analytics.data.v1beta.BatchRunReportsResponse + * @instance + */ + BatchRunReportsResponse.prototype.reports = $util.emptyArray; + + /** + * BatchRunReportsResponse kind. + * @member {string} kind + * @memberof google.analytics.data.v1beta.BatchRunReportsResponse + * @instance + */ + BatchRunReportsResponse.prototype.kind = ""; + + /** + * Creates a new BatchRunReportsResponse instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.BatchRunReportsResponse + * @static + * @param {google.analytics.data.v1beta.IBatchRunReportsResponse=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.BatchRunReportsResponse} BatchRunReportsResponse instance + */ + BatchRunReportsResponse.create = function create(properties) { + return new BatchRunReportsResponse(properties); + }; + + /** + * Encodes the specified BatchRunReportsResponse message. Does not implicitly {@link google.analytics.data.v1beta.BatchRunReportsResponse.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.BatchRunReportsResponse + * @static + * @param {google.analytics.data.v1beta.IBatchRunReportsResponse} message BatchRunReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunReportsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reports != null && message.reports.length) + for (var i = 0; i < message.reports.length; ++i) + $root.google.analytics.data.v1beta.RunReportResponse.encode(message.reports[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kind); + return writer; + }; + + /** + * Encodes the specified BatchRunReportsResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.BatchRunReportsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.BatchRunReportsResponse + * @static + * @param {google.analytics.data.v1beta.IBatchRunReportsResponse} message BatchRunReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunReportsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRunReportsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.BatchRunReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.BatchRunReportsResponse} BatchRunReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunReportsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.BatchRunReportsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.reports && message.reports.length)) + message.reports = []; + message.reports.push($root.google.analytics.data.v1beta.RunReportResponse.decode(reader, reader.uint32())); + break; + } + case 2: { + message.kind = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRunReportsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.BatchRunReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.BatchRunReportsResponse} BatchRunReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunReportsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRunReportsResponse message. + * @function verify + * @memberof google.analytics.data.v1beta.BatchRunReportsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRunReportsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reports != null && message.hasOwnProperty("reports")) { + if (!Array.isArray(message.reports)) + return "reports: array expected"; + for (var i = 0; i < message.reports.length; ++i) { + var error = $root.google.analytics.data.v1beta.RunReportResponse.verify(message.reports[i]); + if (error) + return "reports." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + return null; + }; + + /** + * Creates a BatchRunReportsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.BatchRunReportsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.BatchRunReportsResponse} BatchRunReportsResponse + */ + BatchRunReportsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.BatchRunReportsResponse) + return object; + var message = new $root.google.analytics.data.v1beta.BatchRunReportsResponse(); + if (object.reports) { + if (!Array.isArray(object.reports)) + throw TypeError(".google.analytics.data.v1beta.BatchRunReportsResponse.reports: array expected"); + message.reports = []; + for (var i = 0; i < object.reports.length; ++i) { + if (typeof object.reports[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.BatchRunReportsResponse.reports: object expected"); + message.reports[i] = $root.google.analytics.data.v1beta.RunReportResponse.fromObject(object.reports[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + return message; + }; + + /** + * Creates a plain object from a BatchRunReportsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.BatchRunReportsResponse + * @static + * @param {google.analytics.data.v1beta.BatchRunReportsResponse} message BatchRunReportsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRunReportsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reports = []; + if (options.defaults) + object.kind = ""; + if (message.reports && message.reports.length) { + object.reports = []; + for (var j = 0; j < message.reports.length; ++j) + object.reports[j] = $root.google.analytics.data.v1beta.RunReportResponse.toObject(message.reports[j], options); + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + return object; + }; + + /** + * Converts this BatchRunReportsResponse to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.BatchRunReportsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchRunReportsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRunReportsResponse + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.BatchRunReportsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRunReportsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.BatchRunReportsResponse"; + }; + + return BatchRunReportsResponse; + })(); + + v1beta.BatchRunPivotReportsRequest = (function() { + + /** + * Properties of a BatchRunPivotReportsRequest. + * @memberof google.analytics.data.v1beta + * @interface IBatchRunPivotReportsRequest + * @property {string|null} [property] BatchRunPivotReportsRequest property + * @property {Array.|null} [requests] BatchRunPivotReportsRequest requests + */ + + /** + * Constructs a new BatchRunPivotReportsRequest. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a BatchRunPivotReportsRequest. + * @implements IBatchRunPivotReportsRequest + * @constructor + * @param {google.analytics.data.v1beta.IBatchRunPivotReportsRequest=} [properties] Properties to set + */ + function BatchRunPivotReportsRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * BatchRunPivotReportsRequest property. + * @member {string} property + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsRequest + * @instance + */ + BatchRunPivotReportsRequest.prototype.property = ""; + + /** + * BatchRunPivotReportsRequest requests. + * @member {Array.} requests + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsRequest + * @instance + */ + BatchRunPivotReportsRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new BatchRunPivotReportsRequest instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsRequest + * @static + * @param {google.analytics.data.v1beta.IBatchRunPivotReportsRequest=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.BatchRunPivotReportsRequest} BatchRunPivotReportsRequest instance + */ + BatchRunPivotReportsRequest.create = function create(properties) { + return new BatchRunPivotReportsRequest(properties); + }; + + /** + * Encodes the specified BatchRunPivotReportsRequest message. Does not implicitly {@link google.analytics.data.v1beta.BatchRunPivotReportsRequest.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsRequest + * @static + * @param {google.analytics.data.v1beta.IBatchRunPivotReportsRequest} message BatchRunPivotReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunPivotReportsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && Object.hasOwnProperty.call(message, "property")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.analytics.data.v1beta.RunPivotReportRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchRunPivotReportsRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.BatchRunPivotReportsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsRequest + * @static + * @param {google.analytics.data.v1beta.IBatchRunPivotReportsRequest} message BatchRunPivotReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunPivotReportsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRunPivotReportsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.BatchRunPivotReportsRequest} BatchRunPivotReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunPivotReportsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.BatchRunPivotReportsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.property = reader.string(); + break; + } + case 2: { + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.analytics.data.v1beta.RunPivotReportRequest.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRunPivotReportsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.BatchRunPivotReportsRequest} BatchRunPivotReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunPivotReportsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRunPivotReportsRequest message. + * @function verify + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRunPivotReportsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) + if (!$util.isString(message.property)) + return "property: string expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.analytics.data.v1beta.RunPivotReportRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchRunPivotReportsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.BatchRunPivotReportsRequest} BatchRunPivotReportsRequest + */ + BatchRunPivotReportsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.BatchRunPivotReportsRequest) + return object; + var message = new $root.google.analytics.data.v1beta.BatchRunPivotReportsRequest(); + if (object.property != null) + message.property = String(object.property); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.analytics.data.v1beta.BatchRunPivotReportsRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.BatchRunPivotReportsRequest.requests: object expected"); + message.requests[i] = $root.google.analytics.data.v1beta.RunPivotReportRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchRunPivotReportsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsRequest + * @static + * @param {google.analytics.data.v1beta.BatchRunPivotReportsRequest} message BatchRunPivotReportsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRunPivotReportsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.property = ""; + if (message.property != null && message.hasOwnProperty("property")) + object.property = message.property; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.analytics.data.v1beta.RunPivotReportRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchRunPivotReportsRequest to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchRunPivotReportsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRunPivotReportsRequest + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRunPivotReportsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.BatchRunPivotReportsRequest"; + }; + + return BatchRunPivotReportsRequest; + })(); + + v1beta.BatchRunPivotReportsResponse = (function() { + + /** + * Properties of a BatchRunPivotReportsResponse. + * @memberof google.analytics.data.v1beta + * @interface IBatchRunPivotReportsResponse + * @property {Array.|null} [pivotReports] BatchRunPivotReportsResponse pivotReports + * @property {string|null} [kind] BatchRunPivotReportsResponse kind + */ + + /** + * Constructs a new BatchRunPivotReportsResponse. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a BatchRunPivotReportsResponse. + * @implements IBatchRunPivotReportsResponse + * @constructor + * @param {google.analytics.data.v1beta.IBatchRunPivotReportsResponse=} [properties] Properties to set + */ + function BatchRunPivotReportsResponse(properties) { + this.pivotReports = []; + 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]]; + } + + /** + * BatchRunPivotReportsResponse pivotReports. + * @member {Array.} pivotReports + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsResponse + * @instance + */ + BatchRunPivotReportsResponse.prototype.pivotReports = $util.emptyArray; + + /** + * BatchRunPivotReportsResponse kind. + * @member {string} kind + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsResponse + * @instance + */ + BatchRunPivotReportsResponse.prototype.kind = ""; + + /** + * Creates a new BatchRunPivotReportsResponse instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsResponse + * @static + * @param {google.analytics.data.v1beta.IBatchRunPivotReportsResponse=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.BatchRunPivotReportsResponse} BatchRunPivotReportsResponse instance + */ + BatchRunPivotReportsResponse.create = function create(properties) { + return new BatchRunPivotReportsResponse(properties); + }; + + /** + * Encodes the specified BatchRunPivotReportsResponse message. Does not implicitly {@link google.analytics.data.v1beta.BatchRunPivotReportsResponse.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsResponse + * @static + * @param {google.analytics.data.v1beta.IBatchRunPivotReportsResponse} message BatchRunPivotReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunPivotReportsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pivotReports != null && message.pivotReports.length) + for (var i = 0; i < message.pivotReports.length; ++i) + $root.google.analytics.data.v1beta.RunPivotReportResponse.encode(message.pivotReports[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kind); + return writer; + }; + + /** + * Encodes the specified BatchRunPivotReportsResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.BatchRunPivotReportsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsResponse + * @static + * @param {google.analytics.data.v1beta.IBatchRunPivotReportsResponse} message BatchRunPivotReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRunPivotReportsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRunPivotReportsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.BatchRunPivotReportsResponse} BatchRunPivotReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunPivotReportsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.BatchRunPivotReportsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.pivotReports && message.pivotReports.length)) + message.pivotReports = []; + message.pivotReports.push($root.google.analytics.data.v1beta.RunPivotReportResponse.decode(reader, reader.uint32())); + break; + } + case 2: { + message.kind = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRunPivotReportsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.BatchRunPivotReportsResponse} BatchRunPivotReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRunPivotReportsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRunPivotReportsResponse message. + * @function verify + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRunPivotReportsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pivotReports != null && message.hasOwnProperty("pivotReports")) { + if (!Array.isArray(message.pivotReports)) + return "pivotReports: array expected"; + for (var i = 0; i < message.pivotReports.length; ++i) { + var error = $root.google.analytics.data.v1beta.RunPivotReportResponse.verify(message.pivotReports[i]); + if (error) + return "pivotReports." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + return null; + }; + + /** + * Creates a BatchRunPivotReportsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.BatchRunPivotReportsResponse} BatchRunPivotReportsResponse + */ + BatchRunPivotReportsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.BatchRunPivotReportsResponse) + return object; + var message = new $root.google.analytics.data.v1beta.BatchRunPivotReportsResponse(); + if (object.pivotReports) { + if (!Array.isArray(object.pivotReports)) + throw TypeError(".google.analytics.data.v1beta.BatchRunPivotReportsResponse.pivotReports: array expected"); + message.pivotReports = []; + for (var i = 0; i < object.pivotReports.length; ++i) { + if (typeof object.pivotReports[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.BatchRunPivotReportsResponse.pivotReports: object expected"); + message.pivotReports[i] = $root.google.analytics.data.v1beta.RunPivotReportResponse.fromObject(object.pivotReports[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + return message; + }; + + /** + * Creates a plain object from a BatchRunPivotReportsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsResponse + * @static + * @param {google.analytics.data.v1beta.BatchRunPivotReportsResponse} message BatchRunPivotReportsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRunPivotReportsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pivotReports = []; + if (options.defaults) + object.kind = ""; + if (message.pivotReports && message.pivotReports.length) { + object.pivotReports = []; + for (var j = 0; j < message.pivotReports.length; ++j) + object.pivotReports[j] = $root.google.analytics.data.v1beta.RunPivotReportResponse.toObject(message.pivotReports[j], options); + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + return object; + }; + + /** + * Converts this BatchRunPivotReportsResponse to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchRunPivotReportsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRunPivotReportsResponse + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.BatchRunPivotReportsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRunPivotReportsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.BatchRunPivotReportsResponse"; + }; + + return BatchRunPivotReportsResponse; + })(); + + v1beta.GetMetadataRequest = (function() { + + /** + * Properties of a GetMetadataRequest. + * @memberof google.analytics.data.v1beta + * @interface IGetMetadataRequest + * @property {string|null} [name] GetMetadataRequest name + */ + + /** + * Constructs a new GetMetadataRequest. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a GetMetadataRequest. + * @implements IGetMetadataRequest + * @constructor + * @param {google.analytics.data.v1beta.IGetMetadataRequest=} [properties] Properties to set + */ + function GetMetadataRequest(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]]; + } + + /** + * GetMetadataRequest name. + * @member {string} name + * @memberof google.analytics.data.v1beta.GetMetadataRequest + * @instance + */ + GetMetadataRequest.prototype.name = ""; + + /** + * Creates a new GetMetadataRequest instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.GetMetadataRequest + * @static + * @param {google.analytics.data.v1beta.IGetMetadataRequest=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.GetMetadataRequest} GetMetadataRequest instance + */ + GetMetadataRequest.create = function create(properties) { + return new GetMetadataRequest(properties); + }; + + /** + * Encodes the specified GetMetadataRequest message. Does not implicitly {@link google.analytics.data.v1beta.GetMetadataRequest.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.GetMetadataRequest + * @static + * @param {google.analytics.data.v1beta.IGetMetadataRequest} message GetMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMetadataRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetMetadataRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.GetMetadataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.GetMetadataRequest + * @static + * @param {google.analytics.data.v1beta.IGetMetadataRequest} message GetMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMetadataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMetadataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.GetMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.GetMetadataRequest} GetMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMetadataRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.GetMetadataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMetadataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.GetMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.GetMetadataRequest} GetMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMetadataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMetadataRequest message. + * @function verify + * @memberof google.analytics.data.v1beta.GetMetadataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMetadataRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetMetadataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.GetMetadataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.GetMetadataRequest} GetMetadataRequest + */ + GetMetadataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.GetMetadataRequest) + return object; + var message = new $root.google.analytics.data.v1beta.GetMetadataRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMetadataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.GetMetadataRequest + * @static + * @param {google.analytics.data.v1beta.GetMetadataRequest} message GetMetadataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMetadataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetMetadataRequest to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.GetMetadataRequest + * @instance + * @returns {Object.} JSON object + */ + GetMetadataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMetadataRequest + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.GetMetadataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMetadataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.GetMetadataRequest"; + }; + + return GetMetadataRequest; + })(); + + v1beta.RunRealtimeReportRequest = (function() { + + /** + * Properties of a RunRealtimeReportRequest. + * @memberof google.analytics.data.v1beta + * @interface IRunRealtimeReportRequest + * @property {string|null} [property] RunRealtimeReportRequest property + * @property {Array.|null} [dimensions] RunRealtimeReportRequest dimensions + * @property {Array.|null} [metrics] RunRealtimeReportRequest metrics + * @property {google.analytics.data.v1beta.IFilterExpression|null} [dimensionFilter] RunRealtimeReportRequest dimensionFilter + * @property {google.analytics.data.v1beta.IFilterExpression|null} [metricFilter] RunRealtimeReportRequest metricFilter + * @property {number|Long|null} [limit] RunRealtimeReportRequest limit + * @property {Array.|null} [metricAggregations] RunRealtimeReportRequest metricAggregations + * @property {Array.|null} [orderBys] RunRealtimeReportRequest orderBys + * @property {boolean|null} [returnPropertyQuota] RunRealtimeReportRequest returnPropertyQuota + * @property {Array.|null} [minuteRanges] RunRealtimeReportRequest minuteRanges + */ + + /** + * Constructs a new RunRealtimeReportRequest. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a RunRealtimeReportRequest. + * @implements IRunRealtimeReportRequest + * @constructor + * @param {google.analytics.data.v1beta.IRunRealtimeReportRequest=} [properties] Properties to set + */ + function RunRealtimeReportRequest(properties) { + this.dimensions = []; + this.metrics = []; + this.metricAggregations = []; + this.orderBys = []; + this.minuteRanges = []; + 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]]; + } + + /** + * RunRealtimeReportRequest property. + * @member {string} property + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @instance + */ + RunRealtimeReportRequest.prototype.property = ""; + + /** + * RunRealtimeReportRequest dimensions. + * @member {Array.} dimensions + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @instance + */ + RunRealtimeReportRequest.prototype.dimensions = $util.emptyArray; + + /** + * RunRealtimeReportRequest metrics. + * @member {Array.} metrics + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @instance + */ + RunRealtimeReportRequest.prototype.metrics = $util.emptyArray; + + /** + * RunRealtimeReportRequest dimensionFilter. + * @member {google.analytics.data.v1beta.IFilterExpression|null|undefined} dimensionFilter + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @instance + */ + RunRealtimeReportRequest.prototype.dimensionFilter = null; + + /** + * RunRealtimeReportRequest metricFilter. + * @member {google.analytics.data.v1beta.IFilterExpression|null|undefined} metricFilter + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @instance + */ + RunRealtimeReportRequest.prototype.metricFilter = null; + + /** + * RunRealtimeReportRequest limit. + * @member {number|Long} limit + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @instance + */ + RunRealtimeReportRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RunRealtimeReportRequest metricAggregations. + * @member {Array.} metricAggregations + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @instance + */ + RunRealtimeReportRequest.prototype.metricAggregations = $util.emptyArray; + + /** + * RunRealtimeReportRequest orderBys. + * @member {Array.} orderBys + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @instance + */ + RunRealtimeReportRequest.prototype.orderBys = $util.emptyArray; + + /** + * RunRealtimeReportRequest returnPropertyQuota. + * @member {boolean} returnPropertyQuota + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @instance + */ + RunRealtimeReportRequest.prototype.returnPropertyQuota = false; + + /** + * RunRealtimeReportRequest minuteRanges. + * @member {Array.} minuteRanges + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @instance + */ + RunRealtimeReportRequest.prototype.minuteRanges = $util.emptyArray; + + /** + * Creates a new RunRealtimeReportRequest instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @static + * @param {google.analytics.data.v1beta.IRunRealtimeReportRequest=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.RunRealtimeReportRequest} RunRealtimeReportRequest instance + */ + RunRealtimeReportRequest.create = function create(properties) { + return new RunRealtimeReportRequest(properties); + }; + + /** + * Encodes the specified RunRealtimeReportRequest message. Does not implicitly {@link google.analytics.data.v1beta.RunRealtimeReportRequest.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @static + * @param {google.analytics.data.v1beta.IRunRealtimeReportRequest} message RunRealtimeReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunRealtimeReportRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && Object.hasOwnProperty.call(message, "property")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); + if (message.dimensions != null && message.dimensions.length) + for (var i = 0; i < message.dimensions.length; ++i) + $root.google.analytics.data.v1beta.Dimension.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.data.v1beta.Metric.encode(message.metrics[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dimensionFilter != null && Object.hasOwnProperty.call(message, "dimensionFilter")) + $root.google.analytics.data.v1beta.FilterExpression.encode(message.dimensionFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.metricFilter != null && Object.hasOwnProperty.call(message, "metricFilter")) + $root.google.analytics.data.v1beta.FilterExpression.encode(message.metricFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.limit); + if (message.metricAggregations != null && message.metricAggregations.length) { + writer.uint32(/* id 7, wireType 2 =*/58).fork(); + for (var i = 0; i < message.metricAggregations.length; ++i) + writer.int32(message.metricAggregations[i]); + writer.ldelim(); + } + if (message.orderBys != null && message.orderBys.length) + for (var i = 0; i < message.orderBys.length; ++i) + $root.google.analytics.data.v1beta.OrderBy.encode(message.orderBys[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.returnPropertyQuota != null && Object.hasOwnProperty.call(message, "returnPropertyQuota")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.returnPropertyQuota); + if (message.minuteRanges != null && message.minuteRanges.length) + for (var i = 0; i < message.minuteRanges.length; ++i) + $root.google.analytics.data.v1beta.MinuteRange.encode(message.minuteRanges[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunRealtimeReportRequest message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.RunRealtimeReportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @static + * @param {google.analytics.data.v1beta.IRunRealtimeReportRequest} message RunRealtimeReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunRealtimeReportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunRealtimeReportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.RunRealtimeReportRequest} RunRealtimeReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunRealtimeReportRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.RunRealtimeReportRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.property = reader.string(); + break; + } + case 2: { + if (!(message.dimensions && message.dimensions.length)) + message.dimensions = []; + message.dimensions.push($root.google.analytics.data.v1beta.Dimension.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.analytics.data.v1beta.Metric.decode(reader, reader.uint32())); + break; + } + case 4: { + message.dimensionFilter = $root.google.analytics.data.v1beta.FilterExpression.decode(reader, reader.uint32()); + break; + } + case 5: { + message.metricFilter = $root.google.analytics.data.v1beta.FilterExpression.decode(reader, reader.uint32()); + break; + } + case 6: { + message.limit = reader.int64(); + break; + } + case 7: { + if (!(message.metricAggregations && message.metricAggregations.length)) + message.metricAggregations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.metricAggregations.push(reader.int32()); + } else + message.metricAggregations.push(reader.int32()); + break; + } + case 8: { + if (!(message.orderBys && message.orderBys.length)) + message.orderBys = []; + message.orderBys.push($root.google.analytics.data.v1beta.OrderBy.decode(reader, reader.uint32())); + break; + } + case 9: { + message.returnPropertyQuota = reader.bool(); + break; + } + case 10: { + if (!(message.minuteRanges && message.minuteRanges.length)) + message.minuteRanges = []; + message.minuteRanges.push($root.google.analytics.data.v1beta.MinuteRange.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunRealtimeReportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.RunRealtimeReportRequest} RunRealtimeReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunRealtimeReportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunRealtimeReportRequest message. + * @function verify + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunRealtimeReportRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) + if (!$util.isString(message.property)) + return "property: 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.data.v1beta.Dimension.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.data.v1beta.Metric.verify(message.metrics[i]); + if (error) + return "metrics." + error; + } + } + if (message.dimensionFilter != null && message.hasOwnProperty("dimensionFilter")) { + var error = $root.google.analytics.data.v1beta.FilterExpression.verify(message.dimensionFilter); + if (error) + return "dimensionFilter." + error; + } + if (message.metricFilter != null && message.hasOwnProperty("metricFilter")) { + var error = $root.google.analytics.data.v1beta.FilterExpression.verify(message.metricFilter); + if (error) + return "metricFilter." + error; + } + 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.metricAggregations != null && message.hasOwnProperty("metricAggregations")) { + if (!Array.isArray(message.metricAggregations)) + return "metricAggregations: array expected"; + for (var i = 0; i < message.metricAggregations.length; ++i) + switch (message.metricAggregations[i]) { + default: + return "metricAggregations: enum value[] expected"; + case 0: + case 1: + case 5: + case 6: + case 4: + break; + } + } + 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.data.v1beta.OrderBy.verify(message.orderBys[i]); + if (error) + return "orderBys." + error; + } + } + if (message.returnPropertyQuota != null && message.hasOwnProperty("returnPropertyQuota")) + if (typeof message.returnPropertyQuota !== "boolean") + return "returnPropertyQuota: boolean expected"; + if (message.minuteRanges != null && message.hasOwnProperty("minuteRanges")) { + if (!Array.isArray(message.minuteRanges)) + return "minuteRanges: array expected"; + for (var i = 0; i < message.minuteRanges.length; ++i) { + var error = $root.google.analytics.data.v1beta.MinuteRange.verify(message.minuteRanges[i]); + if (error) + return "minuteRanges." + error; + } + } + return null; + }; + + /** + * Creates a RunRealtimeReportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.RunRealtimeReportRequest} RunRealtimeReportRequest + */ + RunRealtimeReportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.RunRealtimeReportRequest) + return object; + var message = new $root.google.analytics.data.v1beta.RunRealtimeReportRequest(); + if (object.property != null) + message.property = String(object.property); + if (object.dimensions) { + if (!Array.isArray(object.dimensions)) + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportRequest.dimensions: array expected"); + message.dimensions = []; + for (var i = 0; i < object.dimensions.length; ++i) { + if (typeof object.dimensions[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportRequest.dimensions: object expected"); + message.dimensions[i] = $root.google.analytics.data.v1beta.Dimension.fromObject(object.dimensions[i]); + } + } + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportRequest.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportRequest.metrics: object expected"); + message.metrics[i] = $root.google.analytics.data.v1beta.Metric.fromObject(object.metrics[i]); + } + } + if (object.dimensionFilter != null) { + if (typeof object.dimensionFilter !== "object") + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportRequest.dimensionFilter: object expected"); + message.dimensionFilter = $root.google.analytics.data.v1beta.FilterExpression.fromObject(object.dimensionFilter); + } + if (object.metricFilter != null) { + if (typeof object.metricFilter !== "object") + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportRequest.metricFilter: object expected"); + message.metricFilter = $root.google.analytics.data.v1beta.FilterExpression.fromObject(object.metricFilter); + } + 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.metricAggregations) { + if (!Array.isArray(object.metricAggregations)) + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportRequest.metricAggregations: array expected"); + message.metricAggregations = []; + for (var i = 0; i < object.metricAggregations.length; ++i) + switch (object.metricAggregations[i]) { + default: + if (typeof object.metricAggregations[i] === "number") { + message.metricAggregations[i] = object.metricAggregations[i]; + break; + } + case "METRIC_AGGREGATION_UNSPECIFIED": + case 0: + message.metricAggregations[i] = 0; + break; + case "TOTAL": + case 1: + message.metricAggregations[i] = 1; + break; + case "MINIMUM": + case 5: + message.metricAggregations[i] = 5; + break; + case "MAXIMUM": + case 6: + message.metricAggregations[i] = 6; + break; + case "COUNT": + case 4: + message.metricAggregations[i] = 4; + break; + } + } + if (object.orderBys) { + if (!Array.isArray(object.orderBys)) + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportRequest.orderBys: array expected"); + message.orderBys = []; + for (var i = 0; i < object.orderBys.length; ++i) { + if (typeof object.orderBys[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportRequest.orderBys: object expected"); + message.orderBys[i] = $root.google.analytics.data.v1beta.OrderBy.fromObject(object.orderBys[i]); + } + } + if (object.returnPropertyQuota != null) + message.returnPropertyQuota = Boolean(object.returnPropertyQuota); + if (object.minuteRanges) { + if (!Array.isArray(object.minuteRanges)) + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportRequest.minuteRanges: array expected"); + message.minuteRanges = []; + for (var i = 0; i < object.minuteRanges.length; ++i) { + if (typeof object.minuteRanges[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportRequest.minuteRanges: object expected"); + message.minuteRanges[i] = $root.google.analytics.data.v1beta.MinuteRange.fromObject(object.minuteRanges[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RunRealtimeReportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @static + * @param {google.analytics.data.v1beta.RunRealtimeReportRequest} message RunRealtimeReportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunRealtimeReportRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dimensions = []; + object.metrics = []; + object.metricAggregations = []; + object.orderBys = []; + object.minuteRanges = []; + } + if (options.defaults) { + object.property = ""; + object.dimensionFilter = null; + object.metricFilter = null; + 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.returnPropertyQuota = false; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = message.property; + if (message.dimensions && message.dimensions.length) { + object.dimensions = []; + for (var j = 0; j < message.dimensions.length; ++j) + object.dimensions[j] = $root.google.analytics.data.v1beta.Dimension.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.data.v1beta.Metric.toObject(message.metrics[j], options); + } + if (message.dimensionFilter != null && message.hasOwnProperty("dimensionFilter")) + object.dimensionFilter = $root.google.analytics.data.v1beta.FilterExpression.toObject(message.dimensionFilter, options); + if (message.metricFilter != null && message.hasOwnProperty("metricFilter")) + object.metricFilter = $root.google.analytics.data.v1beta.FilterExpression.toObject(message.metricFilter, options); + 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.metricAggregations && message.metricAggregations.length) { + object.metricAggregations = []; + for (var j = 0; j < message.metricAggregations.length; ++j) + object.metricAggregations[j] = options.enums === String ? $root.google.analytics.data.v1beta.MetricAggregation[message.metricAggregations[j]] === undefined ? message.metricAggregations[j] : $root.google.analytics.data.v1beta.MetricAggregation[message.metricAggregations[j]] : message.metricAggregations[j]; + } + if (message.orderBys && message.orderBys.length) { + object.orderBys = []; + for (var j = 0; j < message.orderBys.length; ++j) + object.orderBys[j] = $root.google.analytics.data.v1beta.OrderBy.toObject(message.orderBys[j], options); + } + if (message.returnPropertyQuota != null && message.hasOwnProperty("returnPropertyQuota")) + object.returnPropertyQuota = message.returnPropertyQuota; + if (message.minuteRanges && message.minuteRanges.length) { + object.minuteRanges = []; + for (var j = 0; j < message.minuteRanges.length; ++j) + object.minuteRanges[j] = $root.google.analytics.data.v1beta.MinuteRange.toObject(message.minuteRanges[j], options); + } + return object; + }; + + /** + * Converts this RunRealtimeReportRequest to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @instance + * @returns {Object.} JSON object + */ + RunRealtimeReportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunRealtimeReportRequest + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.RunRealtimeReportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunRealtimeReportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.RunRealtimeReportRequest"; + }; + + return RunRealtimeReportRequest; + })(); + + v1beta.RunRealtimeReportResponse = (function() { + + /** + * Properties of a RunRealtimeReportResponse. + * @memberof google.analytics.data.v1beta + * @interface IRunRealtimeReportResponse + * @property {Array.|null} [dimensionHeaders] RunRealtimeReportResponse dimensionHeaders + * @property {Array.|null} [metricHeaders] RunRealtimeReportResponse metricHeaders + * @property {Array.|null} [rows] RunRealtimeReportResponse rows + * @property {Array.|null} [totals] RunRealtimeReportResponse totals + * @property {Array.|null} [maximums] RunRealtimeReportResponse maximums + * @property {Array.|null} [minimums] RunRealtimeReportResponse minimums + * @property {number|null} [rowCount] RunRealtimeReportResponse rowCount + * @property {google.analytics.data.v1beta.IPropertyQuota|null} [propertyQuota] RunRealtimeReportResponse propertyQuota + * @property {string|null} [kind] RunRealtimeReportResponse kind + */ + + /** + * Constructs a new RunRealtimeReportResponse. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a RunRealtimeReportResponse. + * @implements IRunRealtimeReportResponse + * @constructor + * @param {google.analytics.data.v1beta.IRunRealtimeReportResponse=} [properties] Properties to set + */ + function RunRealtimeReportResponse(properties) { + this.dimensionHeaders = []; + this.metricHeaders = []; + this.rows = []; + this.totals = []; + this.maximums = []; + this.minimums = []; + 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]]; + } + + /** + * RunRealtimeReportResponse dimensionHeaders. + * @member {Array.} dimensionHeaders + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @instance + */ + RunRealtimeReportResponse.prototype.dimensionHeaders = $util.emptyArray; + + /** + * RunRealtimeReportResponse metricHeaders. + * @member {Array.} metricHeaders + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @instance + */ + RunRealtimeReportResponse.prototype.metricHeaders = $util.emptyArray; + + /** + * RunRealtimeReportResponse rows. + * @member {Array.} rows + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @instance + */ + RunRealtimeReportResponse.prototype.rows = $util.emptyArray; + + /** + * RunRealtimeReportResponse totals. + * @member {Array.} totals + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @instance + */ + RunRealtimeReportResponse.prototype.totals = $util.emptyArray; + + /** + * RunRealtimeReportResponse maximums. + * @member {Array.} maximums + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @instance + */ + RunRealtimeReportResponse.prototype.maximums = $util.emptyArray; + + /** + * RunRealtimeReportResponse minimums. + * @member {Array.} minimums + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @instance + */ + RunRealtimeReportResponse.prototype.minimums = $util.emptyArray; + + /** + * RunRealtimeReportResponse rowCount. + * @member {number} rowCount + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @instance + */ + RunRealtimeReportResponse.prototype.rowCount = 0; + + /** + * RunRealtimeReportResponse propertyQuota. + * @member {google.analytics.data.v1beta.IPropertyQuota|null|undefined} propertyQuota + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @instance + */ + RunRealtimeReportResponse.prototype.propertyQuota = null; + + /** + * RunRealtimeReportResponse kind. + * @member {string} kind + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @instance + */ + RunRealtimeReportResponse.prototype.kind = ""; + + /** + * Creates a new RunRealtimeReportResponse instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @static + * @param {google.analytics.data.v1beta.IRunRealtimeReportResponse=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.RunRealtimeReportResponse} RunRealtimeReportResponse instance + */ + RunRealtimeReportResponse.create = function create(properties) { + return new RunRealtimeReportResponse(properties); + }; + + /** + * Encodes the specified RunRealtimeReportResponse message. Does not implicitly {@link google.analytics.data.v1beta.RunRealtimeReportResponse.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @static + * @param {google.analytics.data.v1beta.IRunRealtimeReportResponse} message RunRealtimeReportResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunRealtimeReportResponse.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.data.v1beta.DimensionHeader.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.data.v1beta.MetricHeader.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.data.v1beta.Row.encode(message.rows[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totals != null && message.totals.length) + for (var i = 0; i < message.totals.length; ++i) + $root.google.analytics.data.v1beta.Row.encode(message.totals[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.maximums != null && message.maximums.length) + for (var i = 0; i < message.maximums.length; ++i) + $root.google.analytics.data.v1beta.Row.encode(message.maximums[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.minimums != null && message.minimums.length) + for (var i = 0; i < message.minimums.length; ++i) + $root.google.analytics.data.v1beta.Row.encode(message.minimums[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.rowCount); + if (message.propertyQuota != null && Object.hasOwnProperty.call(message, "propertyQuota")) + $root.google.analytics.data.v1beta.PropertyQuota.encode(message.propertyQuota, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.kind); + return writer; + }; + + /** + * Encodes the specified RunRealtimeReportResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.RunRealtimeReportResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @static + * @param {google.analytics.data.v1beta.IRunRealtimeReportResponse} message RunRealtimeReportResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunRealtimeReportResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunRealtimeReportResponse message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.RunRealtimeReportResponse} RunRealtimeReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunRealtimeReportResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.RunRealtimeReportResponse(); + 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.data.v1beta.DimensionHeader.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.metricHeaders && message.metricHeaders.length)) + message.metricHeaders = []; + message.metricHeaders.push($root.google.analytics.data.v1beta.MetricHeader.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.analytics.data.v1beta.Row.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.totals && message.totals.length)) + message.totals = []; + message.totals.push($root.google.analytics.data.v1beta.Row.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.maximums && message.maximums.length)) + message.maximums = []; + message.maximums.push($root.google.analytics.data.v1beta.Row.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.minimums && message.minimums.length)) + message.minimums = []; + message.minimums.push($root.google.analytics.data.v1beta.Row.decode(reader, reader.uint32())); + break; + } + case 7: { + message.rowCount = reader.int32(); + break; + } + case 8: { + message.propertyQuota = $root.google.analytics.data.v1beta.PropertyQuota.decode(reader, reader.uint32()); + break; + } + case 9: { + message.kind = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunRealtimeReportResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.RunRealtimeReportResponse} RunRealtimeReportResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunRealtimeReportResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunRealtimeReportResponse message. + * @function verify + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunRealtimeReportResponse.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.data.v1beta.DimensionHeader.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.data.v1beta.MetricHeader.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.data.v1beta.Row.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + if (message.totals != null && message.hasOwnProperty("totals")) { + if (!Array.isArray(message.totals)) + return "totals: array expected"; + for (var i = 0; i < message.totals.length; ++i) { + var error = $root.google.analytics.data.v1beta.Row.verify(message.totals[i]); + if (error) + return "totals." + error; + } + } + if (message.maximums != null && message.hasOwnProperty("maximums")) { + if (!Array.isArray(message.maximums)) + return "maximums: array expected"; + for (var i = 0; i < message.maximums.length; ++i) { + var error = $root.google.analytics.data.v1beta.Row.verify(message.maximums[i]); + if (error) + return "maximums." + error; + } + } + if (message.minimums != null && message.hasOwnProperty("minimums")) { + if (!Array.isArray(message.minimums)) + return "minimums: array expected"; + for (var i = 0; i < message.minimums.length; ++i) { + var error = $root.google.analytics.data.v1beta.Row.verify(message.minimums[i]); + if (error) + return "minimums." + error; + } + } + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount)) + return "rowCount: integer expected"; + if (message.propertyQuota != null && message.hasOwnProperty("propertyQuota")) { + var error = $root.google.analytics.data.v1beta.PropertyQuota.verify(message.propertyQuota); + if (error) + return "propertyQuota." + error; + } + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + return null; + }; + + /** + * Creates a RunRealtimeReportResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.RunRealtimeReportResponse} RunRealtimeReportResponse + */ + RunRealtimeReportResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.RunRealtimeReportResponse) + return object; + var message = new $root.google.analytics.data.v1beta.RunRealtimeReportResponse(); + if (object.dimensionHeaders) { + if (!Array.isArray(object.dimensionHeaders)) + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportResponse.dimensionHeaders: array expected"); + message.dimensionHeaders = []; + for (var i = 0; i < object.dimensionHeaders.length; ++i) { + if (typeof object.dimensionHeaders[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportResponse.dimensionHeaders: object expected"); + message.dimensionHeaders[i] = $root.google.analytics.data.v1beta.DimensionHeader.fromObject(object.dimensionHeaders[i]); + } + } + if (object.metricHeaders) { + if (!Array.isArray(object.metricHeaders)) + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportResponse.metricHeaders: array expected"); + message.metricHeaders = []; + for (var i = 0; i < object.metricHeaders.length; ++i) { + if (typeof object.metricHeaders[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportResponse.metricHeaders: object expected"); + message.metricHeaders[i] = $root.google.analytics.data.v1beta.MetricHeader.fromObject(object.metricHeaders[i]); + } + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportResponse.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportResponse.rows: object expected"); + message.rows[i] = $root.google.analytics.data.v1beta.Row.fromObject(object.rows[i]); + } + } + if (object.totals) { + if (!Array.isArray(object.totals)) + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportResponse.totals: array expected"); + message.totals = []; + for (var i = 0; i < object.totals.length; ++i) { + if (typeof object.totals[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportResponse.totals: object expected"); + message.totals[i] = $root.google.analytics.data.v1beta.Row.fromObject(object.totals[i]); + } + } + if (object.maximums) { + if (!Array.isArray(object.maximums)) + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportResponse.maximums: array expected"); + message.maximums = []; + for (var i = 0; i < object.maximums.length; ++i) { + if (typeof object.maximums[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportResponse.maximums: object expected"); + message.maximums[i] = $root.google.analytics.data.v1beta.Row.fromObject(object.maximums[i]); + } + } + if (object.minimums) { + if (!Array.isArray(object.minimums)) + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportResponse.minimums: array expected"); + message.minimums = []; + for (var i = 0; i < object.minimums.length; ++i) { + if (typeof object.minimums[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportResponse.minimums: object expected"); + message.minimums[i] = $root.google.analytics.data.v1beta.Row.fromObject(object.minimums[i]); + } + } + if (object.rowCount != null) + message.rowCount = object.rowCount | 0; + if (object.propertyQuota != null) { + if (typeof object.propertyQuota !== "object") + throw TypeError(".google.analytics.data.v1beta.RunRealtimeReportResponse.propertyQuota: object expected"); + message.propertyQuota = $root.google.analytics.data.v1beta.PropertyQuota.fromObject(object.propertyQuota); + } + if (object.kind != null) + message.kind = String(object.kind); + return message; + }; + + /** + * Creates a plain object from a RunRealtimeReportResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @static + * @param {google.analytics.data.v1beta.RunRealtimeReportResponse} message RunRealtimeReportResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunRealtimeReportResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dimensionHeaders = []; + object.metricHeaders = []; + object.rows = []; + object.totals = []; + object.maximums = []; + object.minimums = []; + } + if (options.defaults) { + object.rowCount = 0; + object.propertyQuota = null; + object.kind = ""; + } + if (message.dimensionHeaders && message.dimensionHeaders.length) { + object.dimensionHeaders = []; + for (var j = 0; j < message.dimensionHeaders.length; ++j) + object.dimensionHeaders[j] = $root.google.analytics.data.v1beta.DimensionHeader.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.data.v1beta.MetricHeader.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.data.v1beta.Row.toObject(message.rows[j], options); + } + if (message.totals && message.totals.length) { + object.totals = []; + for (var j = 0; j < message.totals.length; ++j) + object.totals[j] = $root.google.analytics.data.v1beta.Row.toObject(message.totals[j], options); + } + if (message.maximums && message.maximums.length) { + object.maximums = []; + for (var j = 0; j < message.maximums.length; ++j) + object.maximums[j] = $root.google.analytics.data.v1beta.Row.toObject(message.maximums[j], options); + } + if (message.minimums && message.minimums.length) { + object.minimums = []; + for (var j = 0; j < message.minimums.length; ++j) + object.minimums[j] = $root.google.analytics.data.v1beta.Row.toObject(message.minimums[j], options); + } + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + object.rowCount = message.rowCount; + if (message.propertyQuota != null && message.hasOwnProperty("propertyQuota")) + object.propertyQuota = $root.google.analytics.data.v1beta.PropertyQuota.toObject(message.propertyQuota, options); + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + return object; + }; + + /** + * Converts this RunRealtimeReportResponse to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @instance + * @returns {Object.} JSON object + */ + RunRealtimeReportResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunRealtimeReportResponse + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.RunRealtimeReportResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunRealtimeReportResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.RunRealtimeReportResponse"; + }; + + return RunRealtimeReportResponse; + })(); + + v1beta.DateRange = (function() { + + /** + * Properties of a DateRange. + * @memberof google.analytics.data.v1beta + * @interface IDateRange + * @property {string|null} [startDate] DateRange startDate + * @property {string|null} [endDate] DateRange endDate + * @property {string|null} [name] DateRange name + */ + + /** + * Constructs a new DateRange. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a DateRange. + * @implements IDateRange + * @constructor + * @param {google.analytics.data.v1beta.IDateRange=} [properties] Properties to set + */ + function DateRange(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]]; + } + + /** + * DateRange startDate. + * @member {string} startDate + * @memberof google.analytics.data.v1beta.DateRange + * @instance + */ + DateRange.prototype.startDate = ""; + + /** + * DateRange endDate. + * @member {string} endDate + * @memberof google.analytics.data.v1beta.DateRange + * @instance + */ + DateRange.prototype.endDate = ""; + + /** + * DateRange name. + * @member {string} name + * @memberof google.analytics.data.v1beta.DateRange + * @instance + */ + DateRange.prototype.name = ""; + + /** + * Creates a new DateRange instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.DateRange + * @static + * @param {google.analytics.data.v1beta.IDateRange=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.DateRange} DateRange instance + */ + DateRange.create = function create(properties) { + return new DateRange(properties); + }; + + /** + * Encodes the specified DateRange message. Does not implicitly {@link google.analytics.data.v1beta.DateRange.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.DateRange + * @static + * @param {google.analytics.data.v1beta.IDateRange} message DateRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateRange.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); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified DateRange message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DateRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.DateRange + * @static + * @param {google.analytics.data.v1beta.IDateRange} message DateRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateRange message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.DateRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.DateRange} DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.DateRange(); + 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; + } + case 3: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DateRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.DateRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.DateRange} DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateRange message. + * @function verify + * @memberof google.analytics.data.v1beta.DateRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateRange.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"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DateRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.DateRange + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.DateRange} DateRange + */ + DateRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.DateRange) + return object; + var message = new $root.google.analytics.data.v1beta.DateRange(); + if (object.startDate != null) + message.startDate = String(object.startDate); + if (object.endDate != null) + message.endDate = String(object.endDate); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DateRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.DateRange + * @static + * @param {google.analytics.data.v1beta.DateRange} message DateRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startDate = ""; + object.endDate = ""; + object.name = ""; + } + if (message.startDate != null && message.hasOwnProperty("startDate")) + object.startDate = message.startDate; + if (message.endDate != null && message.hasOwnProperty("endDate")) + object.endDate = message.endDate; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DateRange to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.DateRange + * @instance + * @returns {Object.} JSON object + */ + DateRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DateRange + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.DateRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DateRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.DateRange"; + }; + + return DateRange; + })(); + + v1beta.MinuteRange = (function() { + + /** + * Properties of a MinuteRange. + * @memberof google.analytics.data.v1beta + * @interface IMinuteRange + * @property {number|null} [startMinutesAgo] MinuteRange startMinutesAgo + * @property {number|null} [endMinutesAgo] MinuteRange endMinutesAgo + * @property {string|null} [name] MinuteRange name + */ + + /** + * Constructs a new MinuteRange. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a MinuteRange. + * @implements IMinuteRange + * @constructor + * @param {google.analytics.data.v1beta.IMinuteRange=} [properties] Properties to set + */ + function MinuteRange(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]]; + } + + /** + * MinuteRange startMinutesAgo. + * @member {number|null|undefined} startMinutesAgo + * @memberof google.analytics.data.v1beta.MinuteRange + * @instance + */ + MinuteRange.prototype.startMinutesAgo = null; + + /** + * MinuteRange endMinutesAgo. + * @member {number|null|undefined} endMinutesAgo + * @memberof google.analytics.data.v1beta.MinuteRange + * @instance + */ + MinuteRange.prototype.endMinutesAgo = null; + + /** + * MinuteRange name. + * @member {string} name + * @memberof google.analytics.data.v1beta.MinuteRange + * @instance + */ + MinuteRange.prototype.name = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MinuteRange _startMinutesAgo. + * @member {"startMinutesAgo"|undefined} _startMinutesAgo + * @memberof google.analytics.data.v1beta.MinuteRange + * @instance + */ + Object.defineProperty(MinuteRange.prototype, "_startMinutesAgo", { + get: $util.oneOfGetter($oneOfFields = ["startMinutesAgo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MinuteRange _endMinutesAgo. + * @member {"endMinutesAgo"|undefined} _endMinutesAgo + * @memberof google.analytics.data.v1beta.MinuteRange + * @instance + */ + Object.defineProperty(MinuteRange.prototype, "_endMinutesAgo", { + get: $util.oneOfGetter($oneOfFields = ["endMinutesAgo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MinuteRange instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.MinuteRange + * @static + * @param {google.analytics.data.v1beta.IMinuteRange=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.MinuteRange} MinuteRange instance + */ + MinuteRange.create = function create(properties) { + return new MinuteRange(properties); + }; + + /** + * Encodes the specified MinuteRange message. Does not implicitly {@link google.analytics.data.v1beta.MinuteRange.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.MinuteRange + * @static + * @param {google.analytics.data.v1beta.IMinuteRange} message MinuteRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MinuteRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startMinutesAgo != null && Object.hasOwnProperty.call(message, "startMinutesAgo")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startMinutesAgo); + if (message.endMinutesAgo != null && Object.hasOwnProperty.call(message, "endMinutesAgo")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endMinutesAgo); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified MinuteRange message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.MinuteRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.MinuteRange + * @static + * @param {google.analytics.data.v1beta.IMinuteRange} message MinuteRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MinuteRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MinuteRange message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.MinuteRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.MinuteRange} MinuteRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MinuteRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.MinuteRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startMinutesAgo = reader.int32(); + break; + } + case 2: { + message.endMinutesAgo = reader.int32(); + break; + } + case 3: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MinuteRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.MinuteRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.MinuteRange} MinuteRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MinuteRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MinuteRange message. + * @function verify + * @memberof google.analytics.data.v1beta.MinuteRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MinuteRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.startMinutesAgo != null && message.hasOwnProperty("startMinutesAgo")) { + properties._startMinutesAgo = 1; + if (!$util.isInteger(message.startMinutesAgo)) + return "startMinutesAgo: integer expected"; + } + if (message.endMinutesAgo != null && message.hasOwnProperty("endMinutesAgo")) { + properties._endMinutesAgo = 1; + if (!$util.isInteger(message.endMinutesAgo)) + return "endMinutesAgo: integer expected"; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a MinuteRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.MinuteRange + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.MinuteRange} MinuteRange + */ + MinuteRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.MinuteRange) + return object; + var message = new $root.google.analytics.data.v1beta.MinuteRange(); + if (object.startMinutesAgo != null) + message.startMinutesAgo = object.startMinutesAgo | 0; + if (object.endMinutesAgo != null) + message.endMinutesAgo = object.endMinutesAgo | 0; + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a MinuteRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.MinuteRange + * @static + * @param {google.analytics.data.v1beta.MinuteRange} message MinuteRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MinuteRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.startMinutesAgo != null && message.hasOwnProperty("startMinutesAgo")) { + object.startMinutesAgo = message.startMinutesAgo; + if (options.oneofs) + object._startMinutesAgo = "startMinutesAgo"; + } + if (message.endMinutesAgo != null && message.hasOwnProperty("endMinutesAgo")) { + object.endMinutesAgo = message.endMinutesAgo; + if (options.oneofs) + object._endMinutesAgo = "endMinutesAgo"; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this MinuteRange to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.MinuteRange + * @instance + * @returns {Object.} JSON object + */ + MinuteRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MinuteRange + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.MinuteRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MinuteRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.MinuteRange"; + }; + + return MinuteRange; + })(); + + v1beta.Dimension = (function() { + + /** + * Properties of a Dimension. + * @memberof google.analytics.data.v1beta + * @interface IDimension + * @property {string|null} [name] Dimension name + * @property {google.analytics.data.v1beta.IDimensionExpression|null} [dimensionExpression] Dimension dimensionExpression + */ + + /** + * Constructs a new Dimension. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a Dimension. + * @implements IDimension + * @constructor + * @param {google.analytics.data.v1beta.IDimension=} [properties] Properties to set + */ + function Dimension(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]]; + } + + /** + * Dimension name. + * @member {string} name + * @memberof google.analytics.data.v1beta.Dimension + * @instance + */ + Dimension.prototype.name = ""; + + /** + * Dimension dimensionExpression. + * @member {google.analytics.data.v1beta.IDimensionExpression|null|undefined} dimensionExpression + * @memberof google.analytics.data.v1beta.Dimension + * @instance + */ + Dimension.prototype.dimensionExpression = null; + + /** + * Creates a new Dimension instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.Dimension + * @static + * @param {google.analytics.data.v1beta.IDimension=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.Dimension} Dimension instance + */ + Dimension.create = function create(properties) { + return new Dimension(properties); + }; + + /** + * Encodes the specified Dimension message. Does not implicitly {@link google.analytics.data.v1beta.Dimension.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.Dimension + * @static + * @param {google.analytics.data.v1beta.IDimension} message Dimension message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dimension.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.dimensionExpression != null && Object.hasOwnProperty.call(message, "dimensionExpression")) + $root.google.analytics.data.v1beta.DimensionExpression.encode(message.dimensionExpression, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Dimension message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Dimension.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.Dimension + * @static + * @param {google.analytics.data.v1beta.IDimension} message Dimension message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dimension.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dimension message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.Dimension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.Dimension} Dimension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dimension.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.Dimension(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.dimensionExpression = $root.google.analytics.data.v1beta.DimensionExpression.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dimension message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.Dimension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.Dimension} Dimension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dimension.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dimension message. + * @function verify + * @memberof google.analytics.data.v1beta.Dimension + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dimension.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.dimensionExpression != null && message.hasOwnProperty("dimensionExpression")) { + var error = $root.google.analytics.data.v1beta.DimensionExpression.verify(message.dimensionExpression); + if (error) + return "dimensionExpression." + error; + } + return null; + }; + + /** + * Creates a Dimension message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.Dimension + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.Dimension} Dimension + */ + Dimension.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.Dimension) + return object; + var message = new $root.google.analytics.data.v1beta.Dimension(); + if (object.name != null) + message.name = String(object.name); + if (object.dimensionExpression != null) { + if (typeof object.dimensionExpression !== "object") + throw TypeError(".google.analytics.data.v1beta.Dimension.dimensionExpression: object expected"); + message.dimensionExpression = $root.google.analytics.data.v1beta.DimensionExpression.fromObject(object.dimensionExpression); + } + return message; + }; + + /** + * Creates a plain object from a Dimension message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.Dimension + * @static + * @param {google.analytics.data.v1beta.Dimension} message Dimension + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dimension.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.dimensionExpression = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dimensionExpression != null && message.hasOwnProperty("dimensionExpression")) + object.dimensionExpression = $root.google.analytics.data.v1beta.DimensionExpression.toObject(message.dimensionExpression, options); + return object; + }; + + /** + * Converts this Dimension to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.Dimension + * @instance + * @returns {Object.} JSON object + */ + Dimension.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dimension + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.Dimension + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dimension.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.Dimension"; + }; + + return Dimension; + })(); + + v1beta.DimensionExpression = (function() { + + /** + * Properties of a DimensionExpression. + * @memberof google.analytics.data.v1beta + * @interface IDimensionExpression + * @property {google.analytics.data.v1beta.DimensionExpression.ICaseExpression|null} [lowerCase] DimensionExpression lowerCase + * @property {google.analytics.data.v1beta.DimensionExpression.ICaseExpression|null} [upperCase] DimensionExpression upperCase + * @property {google.analytics.data.v1beta.DimensionExpression.IConcatenateExpression|null} [concatenate] DimensionExpression concatenate + */ + + /** + * Constructs a new DimensionExpression. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a DimensionExpression. + * @implements IDimensionExpression + * @constructor + * @param {google.analytics.data.v1beta.IDimensionExpression=} [properties] Properties to set + */ + function DimensionExpression(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]]; + } + + /** + * DimensionExpression lowerCase. + * @member {google.analytics.data.v1beta.DimensionExpression.ICaseExpression|null|undefined} lowerCase + * @memberof google.analytics.data.v1beta.DimensionExpression + * @instance + */ + DimensionExpression.prototype.lowerCase = null; + + /** + * DimensionExpression upperCase. + * @member {google.analytics.data.v1beta.DimensionExpression.ICaseExpression|null|undefined} upperCase + * @memberof google.analytics.data.v1beta.DimensionExpression + * @instance + */ + DimensionExpression.prototype.upperCase = null; + + /** + * DimensionExpression concatenate. + * @member {google.analytics.data.v1beta.DimensionExpression.IConcatenateExpression|null|undefined} concatenate + * @memberof google.analytics.data.v1beta.DimensionExpression + * @instance + */ + DimensionExpression.prototype.concatenate = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DimensionExpression oneExpression. + * @member {"lowerCase"|"upperCase"|"concatenate"|undefined} oneExpression + * @memberof google.analytics.data.v1beta.DimensionExpression + * @instance + */ + Object.defineProperty(DimensionExpression.prototype, "oneExpression", { + get: $util.oneOfGetter($oneOfFields = ["lowerCase", "upperCase", "concatenate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DimensionExpression instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.DimensionExpression + * @static + * @param {google.analytics.data.v1beta.IDimensionExpression=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.DimensionExpression} DimensionExpression instance + */ + DimensionExpression.create = function create(properties) { + return new DimensionExpression(properties); + }; + + /** + * Encodes the specified DimensionExpression message. Does not implicitly {@link google.analytics.data.v1beta.DimensionExpression.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.DimensionExpression + * @static + * @param {google.analytics.data.v1beta.IDimensionExpression} message DimensionExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionExpression.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lowerCase != null && Object.hasOwnProperty.call(message, "lowerCase")) + $root.google.analytics.data.v1beta.DimensionExpression.CaseExpression.encode(message.lowerCase, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.upperCase != null && Object.hasOwnProperty.call(message, "upperCase")) + $root.google.analytics.data.v1beta.DimensionExpression.CaseExpression.encode(message.upperCase, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.concatenate != null && Object.hasOwnProperty.call(message, "concatenate")) + $root.google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression.encode(message.concatenate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DimensionExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DimensionExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.DimensionExpression + * @static + * @param {google.analytics.data.v1beta.IDimensionExpression} message DimensionExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DimensionExpression message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.DimensionExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.DimensionExpression} DimensionExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionExpression.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.DimensionExpression(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.lowerCase = $root.google.analytics.data.v1beta.DimensionExpression.CaseExpression.decode(reader, reader.uint32()); + break; + } + case 5: { + message.upperCase = $root.google.analytics.data.v1beta.DimensionExpression.CaseExpression.decode(reader, reader.uint32()); + break; + } + case 6: { + message.concatenate = $root.google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DimensionExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.DimensionExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.DimensionExpression} DimensionExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DimensionExpression message. + * @function verify + * @memberof google.analytics.data.v1beta.DimensionExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DimensionExpression.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.lowerCase != null && message.hasOwnProperty("lowerCase")) { + properties.oneExpression = 1; + { + var error = $root.google.analytics.data.v1beta.DimensionExpression.CaseExpression.verify(message.lowerCase); + if (error) + return "lowerCase." + error; + } + } + if (message.upperCase != null && message.hasOwnProperty("upperCase")) { + if (properties.oneExpression === 1) + return "oneExpression: multiple values"; + properties.oneExpression = 1; + { + var error = $root.google.analytics.data.v1beta.DimensionExpression.CaseExpression.verify(message.upperCase); + if (error) + return "upperCase." + error; + } + } + if (message.concatenate != null && message.hasOwnProperty("concatenate")) { + if (properties.oneExpression === 1) + return "oneExpression: multiple values"; + properties.oneExpression = 1; + { + var error = $root.google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression.verify(message.concatenate); + if (error) + return "concatenate." + error; + } + } + return null; + }; + + /** + * Creates a DimensionExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.DimensionExpression + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.DimensionExpression} DimensionExpression + */ + DimensionExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.DimensionExpression) + return object; + var message = new $root.google.analytics.data.v1beta.DimensionExpression(); + if (object.lowerCase != null) { + if (typeof object.lowerCase !== "object") + throw TypeError(".google.analytics.data.v1beta.DimensionExpression.lowerCase: object expected"); + message.lowerCase = $root.google.analytics.data.v1beta.DimensionExpression.CaseExpression.fromObject(object.lowerCase); + } + if (object.upperCase != null) { + if (typeof object.upperCase !== "object") + throw TypeError(".google.analytics.data.v1beta.DimensionExpression.upperCase: object expected"); + message.upperCase = $root.google.analytics.data.v1beta.DimensionExpression.CaseExpression.fromObject(object.upperCase); + } + if (object.concatenate != null) { + if (typeof object.concatenate !== "object") + throw TypeError(".google.analytics.data.v1beta.DimensionExpression.concatenate: object expected"); + message.concatenate = $root.google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression.fromObject(object.concatenate); + } + return message; + }; + + /** + * Creates a plain object from a DimensionExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.DimensionExpression + * @static + * @param {google.analytics.data.v1beta.DimensionExpression} message DimensionExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DimensionExpression.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.lowerCase != null && message.hasOwnProperty("lowerCase")) { + object.lowerCase = $root.google.analytics.data.v1beta.DimensionExpression.CaseExpression.toObject(message.lowerCase, options); + if (options.oneofs) + object.oneExpression = "lowerCase"; + } + if (message.upperCase != null && message.hasOwnProperty("upperCase")) { + object.upperCase = $root.google.analytics.data.v1beta.DimensionExpression.CaseExpression.toObject(message.upperCase, options); + if (options.oneofs) + object.oneExpression = "upperCase"; + } + if (message.concatenate != null && message.hasOwnProperty("concatenate")) { + object.concatenate = $root.google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression.toObject(message.concatenate, options); + if (options.oneofs) + object.oneExpression = "concatenate"; + } + return object; + }; + + /** + * Converts this DimensionExpression to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.DimensionExpression + * @instance + * @returns {Object.} JSON object + */ + DimensionExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DimensionExpression + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.DimensionExpression + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DimensionExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.DimensionExpression"; + }; + + DimensionExpression.CaseExpression = (function() { + + /** + * Properties of a CaseExpression. + * @memberof google.analytics.data.v1beta.DimensionExpression + * @interface ICaseExpression + * @property {string|null} [dimensionName] CaseExpression dimensionName + */ + + /** + * Constructs a new CaseExpression. + * @memberof google.analytics.data.v1beta.DimensionExpression + * @classdesc Represents a CaseExpression. + * @implements ICaseExpression + * @constructor + * @param {google.analytics.data.v1beta.DimensionExpression.ICaseExpression=} [properties] Properties to set + */ + function CaseExpression(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]]; + } + + /** + * CaseExpression dimensionName. + * @member {string} dimensionName + * @memberof google.analytics.data.v1beta.DimensionExpression.CaseExpression + * @instance + */ + CaseExpression.prototype.dimensionName = ""; + + /** + * Creates a new CaseExpression instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.DimensionExpression.CaseExpression + * @static + * @param {google.analytics.data.v1beta.DimensionExpression.ICaseExpression=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.DimensionExpression.CaseExpression} CaseExpression instance + */ + CaseExpression.create = function create(properties) { + return new CaseExpression(properties); + }; + + /** + * Encodes the specified CaseExpression message. Does not implicitly {@link google.analytics.data.v1beta.DimensionExpression.CaseExpression.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.DimensionExpression.CaseExpression + * @static + * @param {google.analytics.data.v1beta.DimensionExpression.ICaseExpression} message CaseExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseExpression.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 CaseExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DimensionExpression.CaseExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.DimensionExpression.CaseExpression + * @static + * @param {google.analytics.data.v1beta.DimensionExpression.ICaseExpression} message CaseExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaseExpression message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.DimensionExpression.CaseExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.DimensionExpression.CaseExpression} CaseExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseExpression.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.DimensionExpression.CaseExpression(); + 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 a CaseExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.DimensionExpression.CaseExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.DimensionExpression.CaseExpression} CaseExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaseExpression message. + * @function verify + * @memberof google.analytics.data.v1beta.DimensionExpression.CaseExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaseExpression.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 a CaseExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.DimensionExpression.CaseExpression + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.DimensionExpression.CaseExpression} CaseExpression + */ + CaseExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.DimensionExpression.CaseExpression) + return object; + var message = new $root.google.analytics.data.v1beta.DimensionExpression.CaseExpression(); + if (object.dimensionName != null) + message.dimensionName = String(object.dimensionName); + return message; + }; + + /** + * Creates a plain object from a CaseExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.DimensionExpression.CaseExpression + * @static + * @param {google.analytics.data.v1beta.DimensionExpression.CaseExpression} message CaseExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaseExpression.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 CaseExpression to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.DimensionExpression.CaseExpression + * @instance + * @returns {Object.} JSON object + */ + CaseExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaseExpression + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.DimensionExpression.CaseExpression + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaseExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.DimensionExpression.CaseExpression"; + }; + + return CaseExpression; + })(); + + DimensionExpression.ConcatenateExpression = (function() { + + /** + * Properties of a ConcatenateExpression. + * @memberof google.analytics.data.v1beta.DimensionExpression + * @interface IConcatenateExpression + * @property {Array.|null} [dimensionNames] ConcatenateExpression dimensionNames + * @property {string|null} [delimiter] ConcatenateExpression delimiter + */ + + /** + * Constructs a new ConcatenateExpression. + * @memberof google.analytics.data.v1beta.DimensionExpression + * @classdesc Represents a ConcatenateExpression. + * @implements IConcatenateExpression + * @constructor + * @param {google.analytics.data.v1beta.DimensionExpression.IConcatenateExpression=} [properties] Properties to set + */ + function ConcatenateExpression(properties) { + this.dimensionNames = []; + 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]]; + } + + /** + * ConcatenateExpression dimensionNames. + * @member {Array.} dimensionNames + * @memberof google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression + * @instance + */ + ConcatenateExpression.prototype.dimensionNames = $util.emptyArray; + + /** + * ConcatenateExpression delimiter. + * @member {string} delimiter + * @memberof google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression + * @instance + */ + ConcatenateExpression.prototype.delimiter = ""; + + /** + * Creates a new ConcatenateExpression instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression + * @static + * @param {google.analytics.data.v1beta.DimensionExpression.IConcatenateExpression=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression} ConcatenateExpression instance + */ + ConcatenateExpression.create = function create(properties) { + return new ConcatenateExpression(properties); + }; + + /** + * Encodes the specified ConcatenateExpression message. Does not implicitly {@link google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression + * @static + * @param {google.analytics.data.v1beta.DimensionExpression.IConcatenateExpression} message ConcatenateExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConcatenateExpression.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dimensionNames != null && message.dimensionNames.length) + for (var i = 0; i < message.dimensionNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dimensionNames[i]); + if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.delimiter); + return writer; + }; + + /** + * Encodes the specified ConcatenateExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression + * @static + * @param {google.analytics.data.v1beta.DimensionExpression.IConcatenateExpression} message ConcatenateExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConcatenateExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConcatenateExpression message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression} ConcatenateExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConcatenateExpression.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dimensionNames && message.dimensionNames.length)) + message.dimensionNames = []; + message.dimensionNames.push(reader.string()); + break; + } + case 2: { + message.delimiter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConcatenateExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression} ConcatenateExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConcatenateExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConcatenateExpression message. + * @function verify + * @memberof google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConcatenateExpression.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dimensionNames != null && message.hasOwnProperty("dimensionNames")) { + if (!Array.isArray(message.dimensionNames)) + return "dimensionNames: array expected"; + for (var i = 0; i < message.dimensionNames.length; ++i) + if (!$util.isString(message.dimensionNames[i])) + return "dimensionNames: string[] expected"; + } + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + if (!$util.isString(message.delimiter)) + return "delimiter: string expected"; + return null; + }; + + /** + * Creates a ConcatenateExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression} ConcatenateExpression + */ + ConcatenateExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression) + return object; + var message = new $root.google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression(); + if (object.dimensionNames) { + if (!Array.isArray(object.dimensionNames)) + throw TypeError(".google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression.dimensionNames: array expected"); + message.dimensionNames = []; + for (var i = 0; i < object.dimensionNames.length; ++i) + message.dimensionNames[i] = String(object.dimensionNames[i]); + } + if (object.delimiter != null) + message.delimiter = String(object.delimiter); + return message; + }; + + /** + * Creates a plain object from a ConcatenateExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression + * @static + * @param {google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression} message ConcatenateExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConcatenateExpression.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dimensionNames = []; + if (options.defaults) + object.delimiter = ""; + if (message.dimensionNames && message.dimensionNames.length) { + object.dimensionNames = []; + for (var j = 0; j < message.dimensionNames.length; ++j) + object.dimensionNames[j] = message.dimensionNames[j]; + } + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + object.delimiter = message.delimiter; + return object; + }; + + /** + * Converts this ConcatenateExpression to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression + * @instance + * @returns {Object.} JSON object + */ + ConcatenateExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConcatenateExpression + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConcatenateExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.DimensionExpression.ConcatenateExpression"; + }; + + return ConcatenateExpression; + })(); + + return DimensionExpression; + })(); + + v1beta.Metric = (function() { + + /** + * Properties of a Metric. + * @memberof google.analytics.data.v1beta + * @interface IMetric + * @property {string|null} [name] Metric name + * @property {string|null} [expression] Metric expression + * @property {boolean|null} [invisible] Metric invisible + */ + + /** + * Constructs a new Metric. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a Metric. + * @implements IMetric + * @constructor + * @param {google.analytics.data.v1beta.IMetric=} [properties] Properties to set + */ + function Metric(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]]; + } + + /** + * Metric name. + * @member {string} name + * @memberof google.analytics.data.v1beta.Metric + * @instance + */ + Metric.prototype.name = ""; + + /** + * Metric expression. + * @member {string} expression + * @memberof google.analytics.data.v1beta.Metric + * @instance + */ + Metric.prototype.expression = ""; + + /** + * Metric invisible. + * @member {boolean} invisible + * @memberof google.analytics.data.v1beta.Metric + * @instance + */ + Metric.prototype.invisible = false; + + /** + * Creates a new Metric instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.Metric + * @static + * @param {google.analytics.data.v1beta.IMetric=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.Metric} Metric instance + */ + Metric.create = function create(properties) { + return new Metric(properties); + }; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.analytics.data.v1beta.Metric.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.Metric + * @static + * @param {google.analytics.data.v1beta.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.expression); + if (message.invisible != null && Object.hasOwnProperty.call(message, "invisible")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.invisible); + return writer; + }; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Metric.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.Metric + * @static + * @param {google.analytics.data.v1beta.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.Metric(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.expression = reader.string(); + break; + } + case 3: { + message.invisible = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metric message. + * @function verify + * @memberof google.analytics.data.v1beta.Metric + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metric.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.invisible != null && message.hasOwnProperty("invisible")) + if (typeof message.invisible !== "boolean") + return "invisible: boolean expected"; + return null; + }; + + /** + * Creates a Metric message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.Metric + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.Metric} Metric + */ + Metric.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.Metric) + return object; + var message = new $root.google.analytics.data.v1beta.Metric(); + if (object.name != null) + message.name = String(object.name); + if (object.expression != null) + message.expression = String(object.expression); + if (object.invisible != null) + message.invisible = Boolean(object.invisible); + return message; + }; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.Metric + * @static + * @param {google.analytics.data.v1beta.Metric} message Metric + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metric.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.expression = ""; + object.invisible = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.invisible != null && message.hasOwnProperty("invisible")) + object.invisible = message.invisible; + return object; + }; + + /** + * Converts this Metric to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.Metric + * @instance + * @returns {Object.} JSON object + */ + Metric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metric + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.Metric + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.Metric"; + }; + + return Metric; + })(); + + v1beta.FilterExpression = (function() { + + /** + * Properties of a FilterExpression. + * @memberof google.analytics.data.v1beta + * @interface IFilterExpression + * @property {google.analytics.data.v1beta.IFilterExpressionList|null} [andGroup] FilterExpression andGroup + * @property {google.analytics.data.v1beta.IFilterExpressionList|null} [orGroup] FilterExpression orGroup + * @property {google.analytics.data.v1beta.IFilterExpression|null} [notExpression] FilterExpression notExpression + * @property {google.analytics.data.v1beta.IFilter|null} [filter] FilterExpression filter + */ + + /** + * Constructs a new FilterExpression. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a FilterExpression. + * @implements IFilterExpression + * @constructor + * @param {google.analytics.data.v1beta.IFilterExpression=} [properties] Properties to set + */ + function FilterExpression(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]]; + } + + /** + * FilterExpression andGroup. + * @member {google.analytics.data.v1beta.IFilterExpressionList|null|undefined} andGroup + * @memberof google.analytics.data.v1beta.FilterExpression + * @instance + */ + FilterExpression.prototype.andGroup = null; + + /** + * FilterExpression orGroup. + * @member {google.analytics.data.v1beta.IFilterExpressionList|null|undefined} orGroup + * @memberof google.analytics.data.v1beta.FilterExpression + * @instance + */ + FilterExpression.prototype.orGroup = null; + + /** + * FilterExpression notExpression. + * @member {google.analytics.data.v1beta.IFilterExpression|null|undefined} notExpression + * @memberof google.analytics.data.v1beta.FilterExpression + * @instance + */ + FilterExpression.prototype.notExpression = null; + + /** + * FilterExpression filter. + * @member {google.analytics.data.v1beta.IFilter|null|undefined} filter + * @memberof google.analytics.data.v1beta.FilterExpression + * @instance + */ + FilterExpression.prototype.filter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FilterExpression expr. + * @member {"andGroup"|"orGroup"|"notExpression"|"filter"|undefined} expr + * @memberof google.analytics.data.v1beta.FilterExpression + * @instance + */ + Object.defineProperty(FilterExpression.prototype, "expr", { + get: $util.oneOfGetter($oneOfFields = ["andGroup", "orGroup", "notExpression", "filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FilterExpression instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.FilterExpression + * @static + * @param {google.analytics.data.v1beta.IFilterExpression=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.FilterExpression} FilterExpression instance + */ + FilterExpression.create = function create(properties) { + return new FilterExpression(properties); + }; + + /** + * Encodes the specified FilterExpression message. Does not implicitly {@link google.analytics.data.v1beta.FilterExpression.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.FilterExpression + * @static + * @param {google.analytics.data.v1beta.IFilterExpression} message FilterExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterExpression.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.andGroup != null && Object.hasOwnProperty.call(message, "andGroup")) + $root.google.analytics.data.v1beta.FilterExpressionList.encode(message.andGroup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.orGroup != null && Object.hasOwnProperty.call(message, "orGroup")) + $root.google.analytics.data.v1beta.FilterExpressionList.encode(message.orGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.notExpression != null && Object.hasOwnProperty.call(message, "notExpression")) + $root.google.analytics.data.v1beta.FilterExpression.encode(message.notExpression, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + $root.google.analytics.data.v1beta.Filter.encode(message.filter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FilterExpression message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.FilterExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.FilterExpression + * @static + * @param {google.analytics.data.v1beta.IFilterExpression} message FilterExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FilterExpression message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.FilterExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.FilterExpression} FilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterExpression.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.FilterExpression(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.andGroup = $root.google.analytics.data.v1beta.FilterExpressionList.decode(reader, reader.uint32()); + break; + } + case 2: { + message.orGroup = $root.google.analytics.data.v1beta.FilterExpressionList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.notExpression = $root.google.analytics.data.v1beta.FilterExpression.decode(reader, reader.uint32()); + break; + } + case 4: { + message.filter = $root.google.analytics.data.v1beta.Filter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FilterExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.FilterExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.FilterExpression} FilterExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FilterExpression message. + * @function verify + * @memberof google.analytics.data.v1beta.FilterExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FilterExpression.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.andGroup != null && message.hasOwnProperty("andGroup")) { + properties.expr = 1; + { + var error = $root.google.analytics.data.v1beta.FilterExpressionList.verify(message.andGroup); + if (error) + return "andGroup." + error; + } + } + if (message.orGroup != null && message.hasOwnProperty("orGroup")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1beta.FilterExpressionList.verify(message.orGroup); + if (error) + return "orGroup." + error; + } + } + if (message.notExpression != null && message.hasOwnProperty("notExpression")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1beta.FilterExpression.verify(message.notExpression); + if (error) + return "notExpression." + error; + } + } + if (message.filter != null && message.hasOwnProperty("filter")) { + if (properties.expr === 1) + return "expr: multiple values"; + properties.expr = 1; + { + var error = $root.google.analytics.data.v1beta.Filter.verify(message.filter); + if (error) + return "filter." + error; + } + } + return null; + }; + + /** + * Creates a FilterExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.FilterExpression + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.FilterExpression} FilterExpression + */ + FilterExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.FilterExpression) + return object; + var message = new $root.google.analytics.data.v1beta.FilterExpression(); + if (object.andGroup != null) { + if (typeof object.andGroup !== "object") + throw TypeError(".google.analytics.data.v1beta.FilterExpression.andGroup: object expected"); + message.andGroup = $root.google.analytics.data.v1beta.FilterExpressionList.fromObject(object.andGroup); + } + if (object.orGroup != null) { + if (typeof object.orGroup !== "object") + throw TypeError(".google.analytics.data.v1beta.FilterExpression.orGroup: object expected"); + message.orGroup = $root.google.analytics.data.v1beta.FilterExpressionList.fromObject(object.orGroup); + } + if (object.notExpression != null) { + if (typeof object.notExpression !== "object") + throw TypeError(".google.analytics.data.v1beta.FilterExpression.notExpression: object expected"); + message.notExpression = $root.google.analytics.data.v1beta.FilterExpression.fromObject(object.notExpression); + } + if (object.filter != null) { + if (typeof object.filter !== "object") + throw TypeError(".google.analytics.data.v1beta.FilterExpression.filter: object expected"); + message.filter = $root.google.analytics.data.v1beta.Filter.fromObject(object.filter); + } + return message; + }; + + /** + * Creates a plain object from a FilterExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.FilterExpression + * @static + * @param {google.analytics.data.v1beta.FilterExpression} message FilterExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FilterExpression.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.andGroup != null && message.hasOwnProperty("andGroup")) { + object.andGroup = $root.google.analytics.data.v1beta.FilterExpressionList.toObject(message.andGroup, options); + if (options.oneofs) + object.expr = "andGroup"; + } + if (message.orGroup != null && message.hasOwnProperty("orGroup")) { + object.orGroup = $root.google.analytics.data.v1beta.FilterExpressionList.toObject(message.orGroup, options); + if (options.oneofs) + object.expr = "orGroup"; + } + if (message.notExpression != null && message.hasOwnProperty("notExpression")) { + object.notExpression = $root.google.analytics.data.v1beta.FilterExpression.toObject(message.notExpression, options); + if (options.oneofs) + object.expr = "notExpression"; + } + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = $root.google.analytics.data.v1beta.Filter.toObject(message.filter, options); + if (options.oneofs) + object.expr = "filter"; + } + return object; + }; + + /** + * Converts this FilterExpression to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.FilterExpression + * @instance + * @returns {Object.} JSON object + */ + FilterExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FilterExpression + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.FilterExpression + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FilterExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.FilterExpression"; + }; + + return FilterExpression; + })(); + + v1beta.FilterExpressionList = (function() { + + /** + * Properties of a FilterExpressionList. + * @memberof google.analytics.data.v1beta + * @interface IFilterExpressionList + * @property {Array.|null} [expressions] FilterExpressionList expressions + */ + + /** + * Constructs a new FilterExpressionList. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a FilterExpressionList. + * @implements IFilterExpressionList + * @constructor + * @param {google.analytics.data.v1beta.IFilterExpressionList=} [properties] Properties to set + */ + function FilterExpressionList(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]]; + } + + /** + * FilterExpressionList expressions. + * @member {Array.} expressions + * @memberof google.analytics.data.v1beta.FilterExpressionList + * @instance + */ + FilterExpressionList.prototype.expressions = $util.emptyArray; + + /** + * Creates a new FilterExpressionList instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.FilterExpressionList + * @static + * @param {google.analytics.data.v1beta.IFilterExpressionList=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.FilterExpressionList} FilterExpressionList instance + */ + FilterExpressionList.create = function create(properties) { + return new FilterExpressionList(properties); + }; + + /** + * Encodes the specified FilterExpressionList message. Does not implicitly {@link google.analytics.data.v1beta.FilterExpressionList.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.FilterExpressionList + * @static + * @param {google.analytics.data.v1beta.IFilterExpressionList} message FilterExpressionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterExpressionList.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.data.v1beta.FilterExpression.encode(message.expressions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FilterExpressionList message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.FilterExpressionList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.FilterExpressionList + * @static + * @param {google.analytics.data.v1beta.IFilterExpressionList} message FilterExpressionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterExpressionList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FilterExpressionList message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.FilterExpressionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.FilterExpressionList} FilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterExpressionList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.FilterExpressionList(); + 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.data.v1beta.FilterExpression.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FilterExpressionList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.FilterExpressionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.FilterExpressionList} FilterExpressionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterExpressionList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FilterExpressionList message. + * @function verify + * @memberof google.analytics.data.v1beta.FilterExpressionList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FilterExpressionList.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.data.v1beta.FilterExpression.verify(message.expressions[i]); + if (error) + return "expressions." + error; + } + } + return null; + }; + + /** + * Creates a FilterExpressionList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.FilterExpressionList + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.FilterExpressionList} FilterExpressionList + */ + FilterExpressionList.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.FilterExpressionList) + return object; + var message = new $root.google.analytics.data.v1beta.FilterExpressionList(); + if (object.expressions) { + if (!Array.isArray(object.expressions)) + throw TypeError(".google.analytics.data.v1beta.FilterExpressionList.expressions: array expected"); + message.expressions = []; + for (var i = 0; i < object.expressions.length; ++i) { + if (typeof object.expressions[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.FilterExpressionList.expressions: object expected"); + message.expressions[i] = $root.google.analytics.data.v1beta.FilterExpression.fromObject(object.expressions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FilterExpressionList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.FilterExpressionList + * @static + * @param {google.analytics.data.v1beta.FilterExpressionList} message FilterExpressionList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FilterExpressionList.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.data.v1beta.FilterExpression.toObject(message.expressions[j], options); + } + return object; + }; + + /** + * Converts this FilterExpressionList to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.FilterExpressionList + * @instance + * @returns {Object.} JSON object + */ + FilterExpressionList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FilterExpressionList + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.FilterExpressionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FilterExpressionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.FilterExpressionList"; + }; + + return FilterExpressionList; + })(); + + v1beta.Filter = (function() { + + /** + * Properties of a Filter. + * @memberof google.analytics.data.v1beta + * @interface IFilter + * @property {string|null} [fieldName] Filter fieldName + * @property {google.analytics.data.v1beta.Filter.IStringFilter|null} [stringFilter] Filter stringFilter + * @property {google.analytics.data.v1beta.Filter.IInListFilter|null} [inListFilter] Filter inListFilter + * @property {google.analytics.data.v1beta.Filter.INumericFilter|null} [numericFilter] Filter numericFilter + * @property {google.analytics.data.v1beta.Filter.IBetweenFilter|null} [betweenFilter] Filter betweenFilter + */ + + /** + * Constructs a new Filter. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a Filter. + * @implements IFilter + * @constructor + * @param {google.analytics.data.v1beta.IFilter=} [properties] Properties to set + */ + function Filter(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]]; + } + + /** + * Filter fieldName. + * @member {string} fieldName + * @memberof google.analytics.data.v1beta.Filter + * @instance + */ + Filter.prototype.fieldName = ""; + + /** + * Filter stringFilter. + * @member {google.analytics.data.v1beta.Filter.IStringFilter|null|undefined} stringFilter + * @memberof google.analytics.data.v1beta.Filter + * @instance + */ + Filter.prototype.stringFilter = null; + + /** + * Filter inListFilter. + * @member {google.analytics.data.v1beta.Filter.IInListFilter|null|undefined} inListFilter + * @memberof google.analytics.data.v1beta.Filter + * @instance + */ + Filter.prototype.inListFilter = null; + + /** + * Filter numericFilter. + * @member {google.analytics.data.v1beta.Filter.INumericFilter|null|undefined} numericFilter + * @memberof google.analytics.data.v1beta.Filter + * @instance + */ + Filter.prototype.numericFilter = null; + + /** + * Filter betweenFilter. + * @member {google.analytics.data.v1beta.Filter.IBetweenFilter|null|undefined} betweenFilter + * @memberof google.analytics.data.v1beta.Filter + * @instance + */ + Filter.prototype.betweenFilter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Filter oneFilter. + * @member {"stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"|undefined} oneFilter + * @memberof google.analytics.data.v1beta.Filter + * @instance + */ + Object.defineProperty(Filter.prototype, "oneFilter", { + get: $util.oneOfGetter($oneOfFields = ["stringFilter", "inListFilter", "numericFilter", "betweenFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Filter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.Filter + * @static + * @param {google.analytics.data.v1beta.IFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.Filter} Filter instance + */ + Filter.create = function create(properties) { + return new Filter(properties); + }; + + /** + * Encodes the specified Filter message. Does not implicitly {@link google.analytics.data.v1beta.Filter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.Filter + * @static + * @param {google.analytics.data.v1beta.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Filter.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.data.v1beta.Filter.StringFilter.encode(message.stringFilter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.inListFilter != null && Object.hasOwnProperty.call(message, "inListFilter")) + $root.google.analytics.data.v1beta.Filter.InListFilter.encode(message.inListFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.numericFilter != null && Object.hasOwnProperty.call(message, "numericFilter")) + $root.google.analytics.data.v1beta.Filter.NumericFilter.encode(message.numericFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.betweenFilter != null && Object.hasOwnProperty.call(message, "betweenFilter")) + $root.google.analytics.data.v1beta.Filter.BetweenFilter.encode(message.betweenFilter, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Filter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.Filter + * @static + * @param {google.analytics.data.v1beta.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Filter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Filter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Filter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.Filter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldName = reader.string(); + break; + } + case 3: { + message.stringFilter = $root.google.analytics.data.v1beta.Filter.StringFilter.decode(reader, reader.uint32()); + break; + } + case 4: { + message.inListFilter = $root.google.analytics.data.v1beta.Filter.InListFilter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.numericFilter = $root.google.analytics.data.v1beta.Filter.NumericFilter.decode(reader, reader.uint32()); + break; + } + case 6: { + message.betweenFilter = $root.google.analytics.data.v1beta.Filter.BetweenFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Filter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Filter message. + * @function verify + * @memberof google.analytics.data.v1beta.Filter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Filter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.stringFilter != null && message.hasOwnProperty("stringFilter")) { + properties.oneFilter = 1; + { + var error = $root.google.analytics.data.v1beta.Filter.StringFilter.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.data.v1beta.Filter.InListFilter.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.data.v1beta.Filter.NumericFilter.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.data.v1beta.Filter.BetweenFilter.verify(message.betweenFilter); + if (error) + return "betweenFilter." + error; + } + } + return null; + }; + + /** + * Creates a Filter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.Filter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.Filter} Filter + */ + Filter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.Filter) + return object; + var message = new $root.google.analytics.data.v1beta.Filter(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + if (object.stringFilter != null) { + if (typeof object.stringFilter !== "object") + throw TypeError(".google.analytics.data.v1beta.Filter.stringFilter: object expected"); + message.stringFilter = $root.google.analytics.data.v1beta.Filter.StringFilter.fromObject(object.stringFilter); + } + if (object.inListFilter != null) { + if (typeof object.inListFilter !== "object") + throw TypeError(".google.analytics.data.v1beta.Filter.inListFilter: object expected"); + message.inListFilter = $root.google.analytics.data.v1beta.Filter.InListFilter.fromObject(object.inListFilter); + } + if (object.numericFilter != null) { + if (typeof object.numericFilter !== "object") + throw TypeError(".google.analytics.data.v1beta.Filter.numericFilter: object expected"); + message.numericFilter = $root.google.analytics.data.v1beta.Filter.NumericFilter.fromObject(object.numericFilter); + } + if (object.betweenFilter != null) { + if (typeof object.betweenFilter !== "object") + throw TypeError(".google.analytics.data.v1beta.Filter.betweenFilter: object expected"); + message.betweenFilter = $root.google.analytics.data.v1beta.Filter.BetweenFilter.fromObject(object.betweenFilter); + } + return message; + }; + + /** + * Creates a plain object from a Filter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.Filter + * @static + * @param {google.analytics.data.v1beta.Filter} message Filter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Filter.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.data.v1beta.Filter.StringFilter.toObject(message.stringFilter, options); + if (options.oneofs) + object.oneFilter = "stringFilter"; + } + if (message.inListFilter != null && message.hasOwnProperty("inListFilter")) { + object.inListFilter = $root.google.analytics.data.v1beta.Filter.InListFilter.toObject(message.inListFilter, options); + if (options.oneofs) + object.oneFilter = "inListFilter"; + } + if (message.numericFilter != null && message.hasOwnProperty("numericFilter")) { + object.numericFilter = $root.google.analytics.data.v1beta.Filter.NumericFilter.toObject(message.numericFilter, options); + if (options.oneofs) + object.oneFilter = "numericFilter"; + } + if (message.betweenFilter != null && message.hasOwnProperty("betweenFilter")) { + object.betweenFilter = $root.google.analytics.data.v1beta.Filter.BetweenFilter.toObject(message.betweenFilter, options); + if (options.oneofs) + object.oneFilter = "betweenFilter"; + } + return object; + }; + + /** + * Converts this Filter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.Filter + * @instance + * @returns {Object.} JSON object + */ + Filter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Filter + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.Filter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Filter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.Filter"; + }; + + Filter.StringFilter = (function() { + + /** + * Properties of a StringFilter. + * @memberof google.analytics.data.v1beta.Filter + * @interface IStringFilter + * @property {google.analytics.data.v1beta.Filter.StringFilter.MatchType|null} [matchType] StringFilter matchType + * @property {string|null} [value] StringFilter value + * @property {boolean|null} [caseSensitive] StringFilter caseSensitive + */ + + /** + * Constructs a new StringFilter. + * @memberof google.analytics.data.v1beta.Filter + * @classdesc Represents a StringFilter. + * @implements IStringFilter + * @constructor + * @param {google.analytics.data.v1beta.Filter.IStringFilter=} [properties] Properties to set + */ + function StringFilter(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]]; + } + + /** + * StringFilter matchType. + * @member {google.analytics.data.v1beta.Filter.StringFilter.MatchType} matchType + * @memberof google.analytics.data.v1beta.Filter.StringFilter + * @instance + */ + StringFilter.prototype.matchType = 0; + + /** + * StringFilter value. + * @member {string} value + * @memberof google.analytics.data.v1beta.Filter.StringFilter + * @instance + */ + StringFilter.prototype.value = ""; + + /** + * StringFilter caseSensitive. + * @member {boolean} caseSensitive + * @memberof google.analytics.data.v1beta.Filter.StringFilter + * @instance + */ + StringFilter.prototype.caseSensitive = false; + + /** + * Creates a new StringFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.Filter.StringFilter + * @static + * @param {google.analytics.data.v1beta.Filter.IStringFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.Filter.StringFilter} StringFilter instance + */ + StringFilter.create = function create(properties) { + return new StringFilter(properties); + }; + + /** + * Encodes the specified StringFilter message. Does not implicitly {@link google.analytics.data.v1beta.Filter.StringFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.Filter.StringFilter + * @static + * @param {google.analytics.data.v1beta.Filter.IStringFilter} message StringFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringFilter.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; + }; + + /** + * Encodes the specified StringFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Filter.StringFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.Filter.StringFilter + * @static + * @param {google.analytics.data.v1beta.Filter.IStringFilter} message StringFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.Filter.StringFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.Filter.StringFilter} StringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.Filter.StringFilter(); + 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; + }; + + /** + * Decodes a StringFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.Filter.StringFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.Filter.StringFilter} StringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringFilter message. + * @function verify + * @memberof google.analytics.data.v1beta.Filter.StringFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringFilter.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; + }; + + /** + * Creates a StringFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.Filter.StringFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.Filter.StringFilter} StringFilter + */ + StringFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.Filter.StringFilter) + return object; + var message = new $root.google.analytics.data.v1beta.Filter.StringFilter(); + 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; + }; + + /** + * Creates a plain object from a StringFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.Filter.StringFilter + * @static + * @param {google.analytics.data.v1beta.Filter.StringFilter} message StringFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringFilter.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.data.v1beta.Filter.StringFilter.MatchType[message.matchType] === undefined ? message.matchType : $root.google.analytics.data.v1beta.Filter.StringFilter.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; + }; + + /** + * Converts this StringFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.Filter.StringFilter + * @instance + * @returns {Object.} JSON object + */ + StringFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.Filter.StringFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.Filter.StringFilter"; + }; + + /** + * MatchType enum. + * @name google.analytics.data.v1beta.Filter.StringFilter.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 + */ + StringFilter.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; + })(); + + return StringFilter; + })(); + + Filter.InListFilter = (function() { + + /** + * Properties of an InListFilter. + * @memberof google.analytics.data.v1beta.Filter + * @interface IInListFilter + * @property {Array.|null} [values] InListFilter values + * @property {boolean|null} [caseSensitive] InListFilter caseSensitive + */ + + /** + * Constructs a new InListFilter. + * @memberof google.analytics.data.v1beta.Filter + * @classdesc Represents an InListFilter. + * @implements IInListFilter + * @constructor + * @param {google.analytics.data.v1beta.Filter.IInListFilter=} [properties] Properties to set + */ + function InListFilter(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]]; + } + + /** + * InListFilter values. + * @member {Array.} values + * @memberof google.analytics.data.v1beta.Filter.InListFilter + * @instance + */ + InListFilter.prototype.values = $util.emptyArray; + + /** + * InListFilter caseSensitive. + * @member {boolean} caseSensitive + * @memberof google.analytics.data.v1beta.Filter.InListFilter + * @instance + */ + InListFilter.prototype.caseSensitive = false; + + /** + * Creates a new InListFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.Filter.InListFilter + * @static + * @param {google.analytics.data.v1beta.Filter.IInListFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.Filter.InListFilter} InListFilter instance + */ + InListFilter.create = function create(properties) { + return new InListFilter(properties); + }; + + /** + * Encodes the specified InListFilter message. Does not implicitly {@link google.analytics.data.v1beta.Filter.InListFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.Filter.InListFilter + * @static + * @param {google.analytics.data.v1beta.Filter.IInListFilter} message InListFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InListFilter.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; + }; + + /** + * Encodes the specified InListFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Filter.InListFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.Filter.InListFilter + * @static + * @param {google.analytics.data.v1beta.Filter.IInListFilter} message InListFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InListFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InListFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.Filter.InListFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.Filter.InListFilter} InListFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InListFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.Filter.InListFilter(); + 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; + }; + + /** + * Decodes an InListFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.Filter.InListFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.Filter.InListFilter} InListFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InListFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InListFilter message. + * @function verify + * @memberof google.analytics.data.v1beta.Filter.InListFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InListFilter.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; + }; + + /** + * Creates an InListFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.Filter.InListFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.Filter.InListFilter} InListFilter + */ + InListFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.Filter.InListFilter) + return object; + var message = new $root.google.analytics.data.v1beta.Filter.InListFilter(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.analytics.data.v1beta.Filter.InListFilter.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; + }; + + /** + * Creates a plain object from an InListFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.Filter.InListFilter + * @static + * @param {google.analytics.data.v1beta.Filter.InListFilter} message InListFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InListFilter.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; + }; + + /** + * Converts this InListFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.Filter.InListFilter + * @instance + * @returns {Object.} JSON object + */ + InListFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InListFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.Filter.InListFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InListFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.Filter.InListFilter"; + }; + + return InListFilter; + })(); + + Filter.NumericFilter = (function() { + + /** + * Properties of a NumericFilter. + * @memberof google.analytics.data.v1beta.Filter + * @interface INumericFilter + * @property {google.analytics.data.v1beta.Filter.NumericFilter.Operation|null} [operation] NumericFilter operation + * @property {google.analytics.data.v1beta.INumericValue|null} [value] NumericFilter value + */ + + /** + * Constructs a new NumericFilter. + * @memberof google.analytics.data.v1beta.Filter + * @classdesc Represents a NumericFilter. + * @implements INumericFilter + * @constructor + * @param {google.analytics.data.v1beta.Filter.INumericFilter=} [properties] Properties to set + */ + function NumericFilter(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]]; + } + + /** + * NumericFilter operation. + * @member {google.analytics.data.v1beta.Filter.NumericFilter.Operation} operation + * @memberof google.analytics.data.v1beta.Filter.NumericFilter + * @instance + */ + NumericFilter.prototype.operation = 0; + + /** + * NumericFilter value. + * @member {google.analytics.data.v1beta.INumericValue|null|undefined} value + * @memberof google.analytics.data.v1beta.Filter.NumericFilter + * @instance + */ + NumericFilter.prototype.value = null; + + /** + * Creates a new NumericFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.Filter.NumericFilter + * @static + * @param {google.analytics.data.v1beta.Filter.INumericFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.Filter.NumericFilter} NumericFilter instance + */ + NumericFilter.create = function create(properties) { + return new NumericFilter(properties); + }; + + /** + * Encodes the specified NumericFilter message. Does not implicitly {@link google.analytics.data.v1beta.Filter.NumericFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.Filter.NumericFilter + * @static + * @param {google.analytics.data.v1beta.Filter.INumericFilter} message NumericFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumericFilter.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.data.v1beta.NumericValue.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NumericFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Filter.NumericFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.Filter.NumericFilter + * @static + * @param {google.analytics.data.v1beta.Filter.INumericFilter} message NumericFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumericFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NumericFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.Filter.NumericFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.Filter.NumericFilter} NumericFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumericFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.Filter.NumericFilter(); + 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.data.v1beta.NumericValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NumericFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.Filter.NumericFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.Filter.NumericFilter} NumericFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumericFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NumericFilter message. + * @function verify + * @memberof google.analytics.data.v1beta.Filter.NumericFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NumericFilter.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.data.v1beta.NumericValue.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a NumericFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.Filter.NumericFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.Filter.NumericFilter} NumericFilter + */ + NumericFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.Filter.NumericFilter) + return object; + var message = new $root.google.analytics.data.v1beta.Filter.NumericFilter(); + 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.data.v1beta.Filter.NumericFilter.value: object expected"); + message.value = $root.google.analytics.data.v1beta.NumericValue.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a NumericFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.Filter.NumericFilter + * @static + * @param {google.analytics.data.v1beta.Filter.NumericFilter} message NumericFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NumericFilter.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.data.v1beta.Filter.NumericFilter.Operation[message.operation] === undefined ? message.operation : $root.google.analytics.data.v1beta.Filter.NumericFilter.Operation[message.operation] : message.operation; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.analytics.data.v1beta.NumericValue.toObject(message.value, options); + return object; + }; + + /** + * Converts this NumericFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.Filter.NumericFilter + * @instance + * @returns {Object.} JSON object + */ + NumericFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NumericFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.Filter.NumericFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NumericFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.Filter.NumericFilter"; + }; + + /** + * Operation enum. + * @name google.analytics.data.v1beta.Filter.NumericFilter.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 + */ + NumericFilter.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 NumericFilter; + })(); + + Filter.BetweenFilter = (function() { + + /** + * Properties of a BetweenFilter. + * @memberof google.analytics.data.v1beta.Filter + * @interface IBetweenFilter + * @property {google.analytics.data.v1beta.INumericValue|null} [fromValue] BetweenFilter fromValue + * @property {google.analytics.data.v1beta.INumericValue|null} [toValue] BetweenFilter toValue + */ + + /** + * Constructs a new BetweenFilter. + * @memberof google.analytics.data.v1beta.Filter + * @classdesc Represents a BetweenFilter. + * @implements IBetweenFilter + * @constructor + * @param {google.analytics.data.v1beta.Filter.IBetweenFilter=} [properties] Properties to set + */ + function BetweenFilter(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]]; + } + + /** + * BetweenFilter fromValue. + * @member {google.analytics.data.v1beta.INumericValue|null|undefined} fromValue + * @memberof google.analytics.data.v1beta.Filter.BetweenFilter + * @instance + */ + BetweenFilter.prototype.fromValue = null; + + /** + * BetweenFilter toValue. + * @member {google.analytics.data.v1beta.INumericValue|null|undefined} toValue + * @memberof google.analytics.data.v1beta.Filter.BetweenFilter + * @instance + */ + BetweenFilter.prototype.toValue = null; + + /** + * Creates a new BetweenFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.Filter.BetweenFilter + * @static + * @param {google.analytics.data.v1beta.Filter.IBetweenFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.Filter.BetweenFilter} BetweenFilter instance + */ + BetweenFilter.create = function create(properties) { + return new BetweenFilter(properties); + }; + + /** + * Encodes the specified BetweenFilter message. Does not implicitly {@link google.analytics.data.v1beta.Filter.BetweenFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.Filter.BetweenFilter + * @static + * @param {google.analytics.data.v1beta.Filter.IBetweenFilter} message BetweenFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BetweenFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fromValue != null && Object.hasOwnProperty.call(message, "fromValue")) + $root.google.analytics.data.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.data.v1beta.NumericValue.encode(message.toValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BetweenFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Filter.BetweenFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.Filter.BetweenFilter + * @static + * @param {google.analytics.data.v1beta.Filter.IBetweenFilter} message BetweenFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BetweenFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BetweenFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.Filter.BetweenFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.Filter.BetweenFilter} BetweenFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BetweenFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.Filter.BetweenFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fromValue = $root.google.analytics.data.v1beta.NumericValue.decode(reader, reader.uint32()); + break; + } + case 2: { + message.toValue = $root.google.analytics.data.v1beta.NumericValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BetweenFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.Filter.BetweenFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.Filter.BetweenFilter} BetweenFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BetweenFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BetweenFilter message. + * @function verify + * @memberof google.analytics.data.v1beta.Filter.BetweenFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BetweenFilter.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.data.v1beta.NumericValue.verify(message.fromValue); + if (error) + return "fromValue." + error; + } + if (message.toValue != null && message.hasOwnProperty("toValue")) { + var error = $root.google.analytics.data.v1beta.NumericValue.verify(message.toValue); + if (error) + return "toValue." + error; + } + return null; + }; + + /** + * Creates a BetweenFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.Filter.BetweenFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.Filter.BetweenFilter} BetweenFilter + */ + BetweenFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.Filter.BetweenFilter) + return object; + var message = new $root.google.analytics.data.v1beta.Filter.BetweenFilter(); + if (object.fromValue != null) { + if (typeof object.fromValue !== "object") + throw TypeError(".google.analytics.data.v1beta.Filter.BetweenFilter.fromValue: object expected"); + message.fromValue = $root.google.analytics.data.v1beta.NumericValue.fromObject(object.fromValue); + } + if (object.toValue != null) { + if (typeof object.toValue !== "object") + throw TypeError(".google.analytics.data.v1beta.Filter.BetweenFilter.toValue: object expected"); + message.toValue = $root.google.analytics.data.v1beta.NumericValue.fromObject(object.toValue); + } + return message; + }; + + /** + * Creates a plain object from a BetweenFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.Filter.BetweenFilter + * @static + * @param {google.analytics.data.v1beta.Filter.BetweenFilter} message BetweenFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BetweenFilter.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.data.v1beta.NumericValue.toObject(message.fromValue, options); + if (message.toValue != null && message.hasOwnProperty("toValue")) + object.toValue = $root.google.analytics.data.v1beta.NumericValue.toObject(message.toValue, options); + return object; + }; + + /** + * Converts this BetweenFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.Filter.BetweenFilter + * @instance + * @returns {Object.} JSON object + */ + BetweenFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BetweenFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.Filter.BetweenFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BetweenFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.Filter.BetweenFilter"; + }; + + return BetweenFilter; + })(); + + return Filter; + })(); + + v1beta.OrderBy = (function() { + + /** + * Properties of an OrderBy. + * @memberof google.analytics.data.v1beta + * @interface IOrderBy + * @property {google.analytics.data.v1beta.OrderBy.IMetricOrderBy|null} [metric] OrderBy metric + * @property {google.analytics.data.v1beta.OrderBy.IDimensionOrderBy|null} [dimension] OrderBy dimension + * @property {google.analytics.data.v1beta.OrderBy.IPivotOrderBy|null} [pivot] OrderBy pivot + * @property {boolean|null} [desc] OrderBy desc + */ + + /** + * Constructs a new OrderBy. + * @memberof google.analytics.data.v1beta + * @classdesc Represents an OrderBy. + * @implements IOrderBy + * @constructor + * @param {google.analytics.data.v1beta.IOrderBy=} [properties] Properties to set + */ + function OrderBy(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]]; + } + + /** + * OrderBy metric. + * @member {google.analytics.data.v1beta.OrderBy.IMetricOrderBy|null|undefined} metric + * @memberof google.analytics.data.v1beta.OrderBy + * @instance + */ + OrderBy.prototype.metric = null; + + /** + * OrderBy dimension. + * @member {google.analytics.data.v1beta.OrderBy.IDimensionOrderBy|null|undefined} dimension + * @memberof google.analytics.data.v1beta.OrderBy + * @instance + */ + OrderBy.prototype.dimension = null; + + /** + * OrderBy pivot. + * @member {google.analytics.data.v1beta.OrderBy.IPivotOrderBy|null|undefined} pivot + * @memberof google.analytics.data.v1beta.OrderBy + * @instance + */ + OrderBy.prototype.pivot = null; + + /** + * OrderBy desc. + * @member {boolean} desc + * @memberof google.analytics.data.v1beta.OrderBy + * @instance + */ + OrderBy.prototype.desc = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OrderBy oneOrderBy. + * @member {"metric"|"dimension"|"pivot"|undefined} oneOrderBy + * @memberof google.analytics.data.v1beta.OrderBy + * @instance + */ + Object.defineProperty(OrderBy.prototype, "oneOrderBy", { + get: $util.oneOfGetter($oneOfFields = ["metric", "dimension", "pivot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OrderBy instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.OrderBy + * @static + * @param {google.analytics.data.v1beta.IOrderBy=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.OrderBy} OrderBy instance + */ + OrderBy.create = function create(properties) { + return new OrderBy(properties); + }; + + /** + * Encodes the specified OrderBy message. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.OrderBy + * @static + * @param {google.analytics.data.v1beta.IOrderBy} message OrderBy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderBy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) + $root.google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.DimensionOrderBy.encode(message.dimension, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pivot != null && Object.hasOwnProperty.call(message, "pivot")) + $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy.encode(message.pivot, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.desc != null && Object.hasOwnProperty.call(message, "desc")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.desc); + return writer; + }; + + /** + * Encodes the specified OrderBy message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.OrderBy + * @static + * @param {google.analytics.data.v1beta.IOrderBy} message OrderBy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderBy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrderBy message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.OrderBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.OrderBy} OrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderBy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.OrderBy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metric = $root.google.analytics.data.v1beta.OrderBy.MetricOrderBy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.dimension = $root.google.analytics.data.v1beta.OrderBy.DimensionOrderBy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.pivot = $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy.decode(reader, reader.uint32()); + break; + } + case 4: { + message.desc = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrderBy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.OrderBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.OrderBy} OrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderBy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrderBy message. + * @function verify + * @memberof google.analytics.data.v1beta.OrderBy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.DimensionOrderBy.verify(message.dimension); + if (error) + return "dimension." + error; + } + } + if (message.pivot != null && message.hasOwnProperty("pivot")) { + if (properties.oneOrderBy === 1) + return "oneOrderBy: multiple values"; + properties.oneOrderBy = 1; + { + var error = $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy.verify(message.pivot); + if (error) + return "pivot." + error; + } + } + if (message.desc != null && message.hasOwnProperty("desc")) + if (typeof message.desc !== "boolean") + return "desc: boolean expected"; + return null; + }; + + /** + * Creates an OrderBy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.OrderBy + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.OrderBy} OrderBy + */ + OrderBy.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.OrderBy) + return object; + var message = new $root.google.analytics.data.v1beta.OrderBy(); + if (object.metric != null) { + if (typeof object.metric !== "object") + throw TypeError(".google.analytics.data.v1beta.OrderBy.metric: object expected"); + message.metric = $root.google.analytics.data.v1beta.OrderBy.MetricOrderBy.fromObject(object.metric); + } + if (object.dimension != null) { + if (typeof object.dimension !== "object") + throw TypeError(".google.analytics.data.v1beta.OrderBy.dimension: object expected"); + message.dimension = $root.google.analytics.data.v1beta.OrderBy.DimensionOrderBy.fromObject(object.dimension); + } + if (object.pivot != null) { + if (typeof object.pivot !== "object") + throw TypeError(".google.analytics.data.v1beta.OrderBy.pivot: object expected"); + message.pivot = $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy.fromObject(object.pivot); + } + if (object.desc != null) + message.desc = Boolean(object.desc); + return message; + }; + + /** + * Creates a plain object from an OrderBy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.OrderBy + * @static + * @param {google.analytics.data.v1beta.OrderBy} message OrderBy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrderBy.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.data.v1beta.OrderBy.MetricOrderBy.toObject(message.metric, options); + if (options.oneofs) + object.oneOrderBy = "metric"; + } + if (message.dimension != null && message.hasOwnProperty("dimension")) { + object.dimension = $root.google.analytics.data.v1beta.OrderBy.DimensionOrderBy.toObject(message.dimension, options); + if (options.oneofs) + object.oneOrderBy = "dimension"; + } + if (message.pivot != null && message.hasOwnProperty("pivot")) { + object.pivot = $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy.toObject(message.pivot, options); + if (options.oneofs) + object.oneOrderBy = "pivot"; + } + if (message.desc != null && message.hasOwnProperty("desc")) + object.desc = message.desc; + return object; + }; + + /** + * Converts this OrderBy to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.OrderBy + * @instance + * @returns {Object.} JSON object + */ + OrderBy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrderBy + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.OrderBy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrderBy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.OrderBy"; + }; + + OrderBy.MetricOrderBy = (function() { + + /** + * Properties of a MetricOrderBy. + * @memberof google.analytics.data.v1beta.OrderBy + * @interface IMetricOrderBy + * @property {string|null} [metricName] MetricOrderBy metricName + */ + + /** + * Constructs a new MetricOrderBy. + * @memberof google.analytics.data.v1beta.OrderBy + * @classdesc Represents a MetricOrderBy. + * @implements IMetricOrderBy + * @constructor + * @param {google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.MetricOrderBy + * @instance + */ + MetricOrderBy.prototype.metricName = ""; + + /** + * Creates a new MetricOrderBy instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.OrderBy.MetricOrderBy + * @static + * @param {google.analytics.data.v1beta.OrderBy.IMetricOrderBy=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.OrderBy.MetricOrderBy} MetricOrderBy instance + */ + MetricOrderBy.create = function create(properties) { + return new MetricOrderBy(properties); + }; + + /** + * Encodes the specified MetricOrderBy message. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.MetricOrderBy.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.OrderBy.MetricOrderBy + * @static + * @param {google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.MetricOrderBy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.OrderBy.MetricOrderBy + * @static + * @param {google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.MetricOrderBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.MetricOrderBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.MetricOrderBy + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.OrderBy.MetricOrderBy} MetricOrderBy + */ + MetricOrderBy.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.OrderBy.MetricOrderBy) + return object; + var message = new $root.google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.MetricOrderBy + * @static + * @param {google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.MetricOrderBy"; + }; + + return MetricOrderBy; + })(); + + OrderBy.DimensionOrderBy = (function() { + + /** + * Properties of a DimensionOrderBy. + * @memberof google.analytics.data.v1beta.OrderBy + * @interface IDimensionOrderBy + * @property {string|null} [dimensionName] DimensionOrderBy dimensionName + * @property {google.analytics.data.v1beta.OrderBy.DimensionOrderBy.OrderType|null} [orderType] DimensionOrderBy orderType + */ + + /** + * Constructs a new DimensionOrderBy. + * @memberof google.analytics.data.v1beta.OrderBy + * @classdesc Represents a DimensionOrderBy. + * @implements IDimensionOrderBy + * @constructor + * @param {google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.DimensionOrderBy + * @instance + */ + DimensionOrderBy.prototype.dimensionName = ""; + + /** + * DimensionOrderBy orderType. + * @member {google.analytics.data.v1beta.OrderBy.DimensionOrderBy.OrderType} orderType + * @memberof google.analytics.data.v1beta.OrderBy.DimensionOrderBy + * @instance + */ + DimensionOrderBy.prototype.orderType = 0; + + /** + * Creates a new DimensionOrderBy instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.OrderBy.DimensionOrderBy + * @static + * @param {google.analytics.data.v1beta.OrderBy.IDimensionOrderBy=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.OrderBy.DimensionOrderBy} DimensionOrderBy instance + */ + DimensionOrderBy.create = function create(properties) { + return new DimensionOrderBy(properties); + }; + + /** + * Encodes the specified DimensionOrderBy message. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.DimensionOrderBy.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.OrderBy.DimensionOrderBy + * @static + * @param {google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.DimensionOrderBy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.OrderBy.DimensionOrderBy + * @static + * @param {google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.DimensionOrderBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.DimensionOrderBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.DimensionOrderBy + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.OrderBy.DimensionOrderBy} DimensionOrderBy + */ + DimensionOrderBy.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.OrderBy.DimensionOrderBy) + return object; + var message = new $root.google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.DimensionOrderBy + * @static + * @param {google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.DimensionOrderBy.OrderType[message.orderType] === undefined ? message.orderType : $root.google.analytics.data.v1beta.OrderBy.DimensionOrderBy.OrderType[message.orderType] : message.orderType; + return object; + }; + + /** + * Converts this DimensionOrderBy to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.OrderBy.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.data.v1beta.OrderBy.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.data.v1beta.OrderBy.DimensionOrderBy"; + }; + + /** + * OrderType enum. + * @name google.analytics.data.v1beta.OrderBy.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; + })(); + + OrderBy.PivotOrderBy = (function() { + + /** + * Properties of a PivotOrderBy. + * @memberof google.analytics.data.v1beta.OrderBy + * @interface IPivotOrderBy + * @property {string|null} [metricName] PivotOrderBy metricName + * @property {Array.|null} [pivotSelections] PivotOrderBy pivotSelections + */ + + /** + * Constructs a new PivotOrderBy. + * @memberof google.analytics.data.v1beta.OrderBy + * @classdesc Represents a PivotOrderBy. + * @implements IPivotOrderBy + * @constructor + * @param {google.analytics.data.v1beta.OrderBy.IPivotOrderBy=} [properties] Properties to set + */ + function PivotOrderBy(properties) { + this.pivotSelections = []; + 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]]; + } + + /** + * PivotOrderBy metricName. + * @member {string} metricName + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy + * @instance + */ + PivotOrderBy.prototype.metricName = ""; + + /** + * PivotOrderBy pivotSelections. + * @member {Array.} pivotSelections + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy + * @instance + */ + PivotOrderBy.prototype.pivotSelections = $util.emptyArray; + + /** + * Creates a new PivotOrderBy instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy + * @static + * @param {google.analytics.data.v1beta.OrderBy.IPivotOrderBy=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.OrderBy.PivotOrderBy} PivotOrderBy instance + */ + PivotOrderBy.create = function create(properties) { + return new PivotOrderBy(properties); + }; + + /** + * Encodes the specified PivotOrderBy message. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.PivotOrderBy.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy + * @static + * @param {google.analytics.data.v1beta.OrderBy.IPivotOrderBy} message PivotOrderBy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PivotOrderBy.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); + if (message.pivotSelections != null && message.pivotSelections.length) + for (var i = 0; i < message.pivotSelections.length; ++i) + $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection.encode(message.pivotSelections[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PivotOrderBy message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.PivotOrderBy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy + * @static + * @param {google.analytics.data.v1beta.OrderBy.IPivotOrderBy} message PivotOrderBy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PivotOrderBy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PivotOrderBy message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.OrderBy.PivotOrderBy} PivotOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PivotOrderBy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metricName = reader.string(); + break; + } + case 2: { + if (!(message.pivotSelections && message.pivotSelections.length)) + message.pivotSelections = []; + message.pivotSelections.push($root.google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PivotOrderBy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.OrderBy.PivotOrderBy} PivotOrderBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PivotOrderBy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PivotOrderBy message. + * @function verify + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PivotOrderBy.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"; + if (message.pivotSelections != null && message.hasOwnProperty("pivotSelections")) { + if (!Array.isArray(message.pivotSelections)) + return "pivotSelections: array expected"; + for (var i = 0; i < message.pivotSelections.length; ++i) { + var error = $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection.verify(message.pivotSelections[i]); + if (error) + return "pivotSelections." + error; + } + } + return null; + }; + + /** + * Creates a PivotOrderBy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.OrderBy.PivotOrderBy} PivotOrderBy + */ + PivotOrderBy.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy) + return object; + var message = new $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy(); + if (object.metricName != null) + message.metricName = String(object.metricName); + if (object.pivotSelections) { + if (!Array.isArray(object.pivotSelections)) + throw TypeError(".google.analytics.data.v1beta.OrderBy.PivotOrderBy.pivotSelections: array expected"); + message.pivotSelections = []; + for (var i = 0; i < object.pivotSelections.length; ++i) { + if (typeof object.pivotSelections[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.OrderBy.PivotOrderBy.pivotSelections: object expected"); + message.pivotSelections[i] = $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection.fromObject(object.pivotSelections[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PivotOrderBy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy + * @static + * @param {google.analytics.data.v1beta.OrderBy.PivotOrderBy} message PivotOrderBy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PivotOrderBy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pivotSelections = []; + if (options.defaults) + object.metricName = ""; + if (message.metricName != null && message.hasOwnProperty("metricName")) + object.metricName = message.metricName; + if (message.pivotSelections && message.pivotSelections.length) { + object.pivotSelections = []; + for (var j = 0; j < message.pivotSelections.length; ++j) + object.pivotSelections[j] = $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection.toObject(message.pivotSelections[j], options); + } + return object; + }; + + /** + * Converts this PivotOrderBy to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy + * @instance + * @returns {Object.} JSON object + */ + PivotOrderBy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PivotOrderBy + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PivotOrderBy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.OrderBy.PivotOrderBy"; + }; + + PivotOrderBy.PivotSelection = (function() { + + /** + * Properties of a PivotSelection. + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy + * @interface IPivotSelection + * @property {string|null} [dimensionName] PivotSelection dimensionName + * @property {string|null} [dimensionValue] PivotSelection dimensionValue + */ + + /** + * Constructs a new PivotSelection. + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy + * @classdesc Represents a PivotSelection. + * @implements IPivotSelection + * @constructor + * @param {google.analytics.data.v1beta.OrderBy.PivotOrderBy.IPivotSelection=} [properties] Properties to set + */ + function PivotSelection(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]]; + } + + /** + * PivotSelection dimensionName. + * @member {string} dimensionName + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection + * @instance + */ + PivotSelection.prototype.dimensionName = ""; + + /** + * PivotSelection dimensionValue. + * @member {string} dimensionValue + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection + * @instance + */ + PivotSelection.prototype.dimensionValue = ""; + + /** + * Creates a new PivotSelection instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection + * @static + * @param {google.analytics.data.v1beta.OrderBy.PivotOrderBy.IPivotSelection=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection} PivotSelection instance + */ + PivotSelection.create = function create(properties) { + return new PivotSelection(properties); + }; + + /** + * Encodes the specified PivotSelection message. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection + * @static + * @param {google.analytics.data.v1beta.OrderBy.PivotOrderBy.IPivotSelection} message PivotSelection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PivotSelection.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.dimensionValue != null && Object.hasOwnProperty.call(message, "dimensionValue")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dimensionValue); + return writer; + }; + + /** + * Encodes the specified PivotSelection message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection + * @static + * @param {google.analytics.data.v1beta.OrderBy.PivotOrderBy.IPivotSelection} message PivotSelection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PivotSelection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PivotSelection message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection} PivotSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PivotSelection.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dimensionName = reader.string(); + break; + } + case 2: { + message.dimensionValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PivotSelection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection} PivotSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PivotSelection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PivotSelection message. + * @function verify + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PivotSelection.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.dimensionValue != null && message.hasOwnProperty("dimensionValue")) + if (!$util.isString(message.dimensionValue)) + return "dimensionValue: string expected"; + return null; + }; + + /** + * Creates a PivotSelection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection} PivotSelection + */ + PivotSelection.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection) + return object; + var message = new $root.google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection(); + if (object.dimensionName != null) + message.dimensionName = String(object.dimensionName); + if (object.dimensionValue != null) + message.dimensionValue = String(object.dimensionValue); + return message; + }; + + /** + * Creates a plain object from a PivotSelection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection + * @static + * @param {google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection} message PivotSelection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PivotSelection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dimensionName = ""; + object.dimensionValue = ""; + } + if (message.dimensionName != null && message.hasOwnProperty("dimensionName")) + object.dimensionName = message.dimensionName; + if (message.dimensionValue != null && message.hasOwnProperty("dimensionValue")) + object.dimensionValue = message.dimensionValue; + return object; + }; + + /** + * Converts this PivotSelection to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection + * @instance + * @returns {Object.} JSON object + */ + PivotSelection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PivotSelection + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PivotSelection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection"; + }; + + return PivotSelection; + })(); + + return PivotOrderBy; + })(); + + return OrderBy; + })(); + + v1beta.Pivot = (function() { + + /** + * Properties of a Pivot. + * @memberof google.analytics.data.v1beta + * @interface IPivot + * @property {Array.|null} [fieldNames] Pivot fieldNames + * @property {Array.|null} [orderBys] Pivot orderBys + * @property {number|Long|null} [offset] Pivot offset + * @property {number|Long|null} [limit] Pivot limit + * @property {Array.|null} [metricAggregations] Pivot metricAggregations + */ + + /** + * Constructs a new Pivot. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a Pivot. + * @implements IPivot + * @constructor + * @param {google.analytics.data.v1beta.IPivot=} [properties] Properties to set + */ + function Pivot(properties) { + this.fieldNames = []; + this.orderBys = []; + this.metricAggregations = []; + 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]]; + } + + /** + * Pivot fieldNames. + * @member {Array.} fieldNames + * @memberof google.analytics.data.v1beta.Pivot + * @instance + */ + Pivot.prototype.fieldNames = $util.emptyArray; + + /** + * Pivot orderBys. + * @member {Array.} orderBys + * @memberof google.analytics.data.v1beta.Pivot + * @instance + */ + Pivot.prototype.orderBys = $util.emptyArray; + + /** + * Pivot offset. + * @member {number|Long} offset + * @memberof google.analytics.data.v1beta.Pivot + * @instance + */ + Pivot.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Pivot limit. + * @member {number|Long} limit + * @memberof google.analytics.data.v1beta.Pivot + * @instance + */ + Pivot.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Pivot metricAggregations. + * @member {Array.} metricAggregations + * @memberof google.analytics.data.v1beta.Pivot + * @instance + */ + Pivot.prototype.metricAggregations = $util.emptyArray; + + /** + * Creates a new Pivot instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.Pivot + * @static + * @param {google.analytics.data.v1beta.IPivot=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.Pivot} Pivot instance + */ + Pivot.create = function create(properties) { + return new Pivot(properties); + }; + + /** + * Encodes the specified Pivot message. Does not implicitly {@link google.analytics.data.v1beta.Pivot.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.Pivot + * @static + * @param {google.analytics.data.v1beta.IPivot} message Pivot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pivot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldNames != null && message.fieldNames.length) + for (var i = 0; i < message.fieldNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldNames[i]); + if (message.orderBys != null && message.orderBys.length) + for (var i = 0; i < message.orderBys.length; ++i) + $root.google.analytics.data.v1beta.OrderBy.encode(message.orderBys[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.offset); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.limit); + if (message.metricAggregations != null && message.metricAggregations.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.metricAggregations.length; ++i) + writer.int32(message.metricAggregations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Pivot message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Pivot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.Pivot + * @static + * @param {google.analytics.data.v1beta.IPivot} message Pivot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pivot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Pivot message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.Pivot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.Pivot} Pivot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pivot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.Pivot(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.fieldNames && message.fieldNames.length)) + message.fieldNames = []; + message.fieldNames.push(reader.string()); + break; + } + case 2: { + if (!(message.orderBys && message.orderBys.length)) + message.orderBys = []; + message.orderBys.push($root.google.analytics.data.v1beta.OrderBy.decode(reader, reader.uint32())); + break; + } + case 3: { + message.offset = reader.int64(); + break; + } + case 4: { + message.limit = reader.int64(); + break; + } + case 5: { + if (!(message.metricAggregations && message.metricAggregations.length)) + message.metricAggregations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.metricAggregations.push(reader.int32()); + } else + message.metricAggregations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Pivot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.Pivot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.Pivot} Pivot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pivot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Pivot message. + * @function verify + * @memberof google.analytics.data.v1beta.Pivot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Pivot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldNames != null && message.hasOwnProperty("fieldNames")) { + if (!Array.isArray(message.fieldNames)) + return "fieldNames: array expected"; + for (var i = 0; i < message.fieldNames.length; ++i) + if (!$util.isString(message.fieldNames[i])) + return "fieldNames: 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.data.v1beta.OrderBy.verify(message.orderBys[i]); + if (error) + return "orderBys." + 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.metricAggregations != null && message.hasOwnProperty("metricAggregations")) { + if (!Array.isArray(message.metricAggregations)) + return "metricAggregations: array expected"; + for (var i = 0; i < message.metricAggregations.length; ++i) + switch (message.metricAggregations[i]) { + default: + return "metricAggregations: enum value[] expected"; + case 0: + case 1: + case 5: + case 6: + case 4: + break; + } + } + return null; + }; + + /** + * Creates a Pivot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.Pivot + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.Pivot} Pivot + */ + Pivot.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.Pivot) + return object; + var message = new $root.google.analytics.data.v1beta.Pivot(); + if (object.fieldNames) { + if (!Array.isArray(object.fieldNames)) + throw TypeError(".google.analytics.data.v1beta.Pivot.fieldNames: array expected"); + message.fieldNames = []; + for (var i = 0; i < object.fieldNames.length; ++i) + message.fieldNames[i] = String(object.fieldNames[i]); + } + if (object.orderBys) { + if (!Array.isArray(object.orderBys)) + throw TypeError(".google.analytics.data.v1beta.Pivot.orderBys: array expected"); + message.orderBys = []; + for (var i = 0; i < object.orderBys.length; ++i) { + if (typeof object.orderBys[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.Pivot.orderBys: object expected"); + message.orderBys[i] = $root.google.analytics.data.v1beta.OrderBy.fromObject(object.orderBys[i]); + } + } + 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.metricAggregations) { + if (!Array.isArray(object.metricAggregations)) + throw TypeError(".google.analytics.data.v1beta.Pivot.metricAggregations: array expected"); + message.metricAggregations = []; + for (var i = 0; i < object.metricAggregations.length; ++i) + switch (object.metricAggregations[i]) { + default: + if (typeof object.metricAggregations[i] === "number") { + message.metricAggregations[i] = object.metricAggregations[i]; + break; + } + case "METRIC_AGGREGATION_UNSPECIFIED": + case 0: + message.metricAggregations[i] = 0; + break; + case "TOTAL": + case 1: + message.metricAggregations[i] = 1; + break; + case "MINIMUM": + case 5: + message.metricAggregations[i] = 5; + break; + case "MAXIMUM": + case 6: + message.metricAggregations[i] = 6; + break; + case "COUNT": + case 4: + message.metricAggregations[i] = 4; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a Pivot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.Pivot + * @static + * @param {google.analytics.data.v1beta.Pivot} message Pivot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Pivot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fieldNames = []; + object.orderBys = []; + object.metricAggregations = []; + } + if (options.defaults) { + 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; + } + if (message.fieldNames && message.fieldNames.length) { + object.fieldNames = []; + for (var j = 0; j < message.fieldNames.length; ++j) + object.fieldNames[j] = message.fieldNames[j]; + } + if (message.orderBys && message.orderBys.length) { + object.orderBys = []; + for (var j = 0; j < message.orderBys.length; ++j) + object.orderBys[j] = $root.google.analytics.data.v1beta.OrderBy.toObject(message.orderBys[j], 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.metricAggregations && message.metricAggregations.length) { + object.metricAggregations = []; + for (var j = 0; j < message.metricAggregations.length; ++j) + object.metricAggregations[j] = options.enums === String ? $root.google.analytics.data.v1beta.MetricAggregation[message.metricAggregations[j]] === undefined ? message.metricAggregations[j] : $root.google.analytics.data.v1beta.MetricAggregation[message.metricAggregations[j]] : message.metricAggregations[j]; + } + return object; + }; + + /** + * Converts this Pivot to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.Pivot + * @instance + * @returns {Object.} JSON object + */ + Pivot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Pivot + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.Pivot + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Pivot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.Pivot"; + }; + + return Pivot; + })(); + + v1beta.CohortSpec = (function() { + + /** + * Properties of a CohortSpec. + * @memberof google.analytics.data.v1beta + * @interface ICohortSpec + * @property {Array.|null} [cohorts] CohortSpec cohorts + * @property {google.analytics.data.v1beta.ICohortsRange|null} [cohortsRange] CohortSpec cohortsRange + * @property {google.analytics.data.v1beta.ICohortReportSettings|null} [cohortReportSettings] CohortSpec cohortReportSettings + */ + + /** + * Constructs a new CohortSpec. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a CohortSpec. + * @implements ICohortSpec + * @constructor + * @param {google.analytics.data.v1beta.ICohortSpec=} [properties] Properties to set + */ + function CohortSpec(properties) { + this.cohorts = []; + 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]]; + } + + /** + * CohortSpec cohorts. + * @member {Array.} cohorts + * @memberof google.analytics.data.v1beta.CohortSpec + * @instance + */ + CohortSpec.prototype.cohorts = $util.emptyArray; + + /** + * CohortSpec cohortsRange. + * @member {google.analytics.data.v1beta.ICohortsRange|null|undefined} cohortsRange + * @memberof google.analytics.data.v1beta.CohortSpec + * @instance + */ + CohortSpec.prototype.cohortsRange = null; + + /** + * CohortSpec cohortReportSettings. + * @member {google.analytics.data.v1beta.ICohortReportSettings|null|undefined} cohortReportSettings + * @memberof google.analytics.data.v1beta.CohortSpec + * @instance + */ + CohortSpec.prototype.cohortReportSettings = null; + + /** + * Creates a new CohortSpec instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.CohortSpec + * @static + * @param {google.analytics.data.v1beta.ICohortSpec=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.CohortSpec} CohortSpec instance + */ + CohortSpec.create = function create(properties) { + return new CohortSpec(properties); + }; + + /** + * Encodes the specified CohortSpec message. Does not implicitly {@link google.analytics.data.v1beta.CohortSpec.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.CohortSpec + * @static + * @param {google.analytics.data.v1beta.ICohortSpec} message CohortSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CohortSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cohorts != null && message.cohorts.length) + for (var i = 0; i < message.cohorts.length; ++i) + $root.google.analytics.data.v1beta.Cohort.encode(message.cohorts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cohortsRange != null && Object.hasOwnProperty.call(message, "cohortsRange")) + $root.google.analytics.data.v1beta.CohortsRange.encode(message.cohortsRange, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cohortReportSettings != null && Object.hasOwnProperty.call(message, "cohortReportSettings")) + $root.google.analytics.data.v1beta.CohortReportSettings.encode(message.cohortReportSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CohortSpec message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.CohortSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.CohortSpec + * @static + * @param {google.analytics.data.v1beta.ICohortSpec} message CohortSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CohortSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CohortSpec message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.CohortSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.CohortSpec} CohortSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CohortSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.CohortSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.cohorts && message.cohorts.length)) + message.cohorts = []; + message.cohorts.push($root.google.analytics.data.v1beta.Cohort.decode(reader, reader.uint32())); + break; + } + case 2: { + message.cohortsRange = $root.google.analytics.data.v1beta.CohortsRange.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cohortReportSettings = $root.google.analytics.data.v1beta.CohortReportSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CohortSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.CohortSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.CohortSpec} CohortSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CohortSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CohortSpec message. + * @function verify + * @memberof google.analytics.data.v1beta.CohortSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CohortSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cohorts != null && message.hasOwnProperty("cohorts")) { + if (!Array.isArray(message.cohorts)) + return "cohorts: array expected"; + for (var i = 0; i < message.cohorts.length; ++i) { + var error = $root.google.analytics.data.v1beta.Cohort.verify(message.cohorts[i]); + if (error) + return "cohorts." + error; + } + } + if (message.cohortsRange != null && message.hasOwnProperty("cohortsRange")) { + var error = $root.google.analytics.data.v1beta.CohortsRange.verify(message.cohortsRange); + if (error) + return "cohortsRange." + error; + } + if (message.cohortReportSettings != null && message.hasOwnProperty("cohortReportSettings")) { + var error = $root.google.analytics.data.v1beta.CohortReportSettings.verify(message.cohortReportSettings); + if (error) + return "cohortReportSettings." + error; + } + return null; + }; + + /** + * Creates a CohortSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.CohortSpec + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.CohortSpec} CohortSpec + */ + CohortSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.CohortSpec) + return object; + var message = new $root.google.analytics.data.v1beta.CohortSpec(); + if (object.cohorts) { + if (!Array.isArray(object.cohorts)) + throw TypeError(".google.analytics.data.v1beta.CohortSpec.cohorts: array expected"); + message.cohorts = []; + for (var i = 0; i < object.cohorts.length; ++i) { + if (typeof object.cohorts[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.CohortSpec.cohorts: object expected"); + message.cohorts[i] = $root.google.analytics.data.v1beta.Cohort.fromObject(object.cohorts[i]); + } + } + if (object.cohortsRange != null) { + if (typeof object.cohortsRange !== "object") + throw TypeError(".google.analytics.data.v1beta.CohortSpec.cohortsRange: object expected"); + message.cohortsRange = $root.google.analytics.data.v1beta.CohortsRange.fromObject(object.cohortsRange); + } + if (object.cohortReportSettings != null) { + if (typeof object.cohortReportSettings !== "object") + throw TypeError(".google.analytics.data.v1beta.CohortSpec.cohortReportSettings: object expected"); + message.cohortReportSettings = $root.google.analytics.data.v1beta.CohortReportSettings.fromObject(object.cohortReportSettings); + } + return message; + }; + + /** + * Creates a plain object from a CohortSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.CohortSpec + * @static + * @param {google.analytics.data.v1beta.CohortSpec} message CohortSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CohortSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cohorts = []; + if (options.defaults) { + object.cohortsRange = null; + object.cohortReportSettings = null; + } + if (message.cohorts && message.cohorts.length) { + object.cohorts = []; + for (var j = 0; j < message.cohorts.length; ++j) + object.cohorts[j] = $root.google.analytics.data.v1beta.Cohort.toObject(message.cohorts[j], options); + } + if (message.cohortsRange != null && message.hasOwnProperty("cohortsRange")) + object.cohortsRange = $root.google.analytics.data.v1beta.CohortsRange.toObject(message.cohortsRange, options); + if (message.cohortReportSettings != null && message.hasOwnProperty("cohortReportSettings")) + object.cohortReportSettings = $root.google.analytics.data.v1beta.CohortReportSettings.toObject(message.cohortReportSettings, options); + return object; + }; + + /** + * Converts this CohortSpec to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.CohortSpec + * @instance + * @returns {Object.} JSON object + */ + CohortSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CohortSpec + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.CohortSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CohortSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.CohortSpec"; + }; + + return CohortSpec; + })(); + + v1beta.Cohort = (function() { + + /** + * Properties of a Cohort. + * @memberof google.analytics.data.v1beta + * @interface ICohort + * @property {string|null} [name] Cohort name + * @property {string|null} [dimension] Cohort dimension + * @property {google.analytics.data.v1beta.IDateRange|null} [dateRange] Cohort dateRange + */ + + /** + * Constructs a new Cohort. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a Cohort. + * @implements ICohort + * @constructor + * @param {google.analytics.data.v1beta.ICohort=} [properties] Properties to set + */ + function Cohort(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]]; + } + + /** + * Cohort name. + * @member {string} name + * @memberof google.analytics.data.v1beta.Cohort + * @instance + */ + Cohort.prototype.name = ""; + + /** + * Cohort dimension. + * @member {string} dimension + * @memberof google.analytics.data.v1beta.Cohort + * @instance + */ + Cohort.prototype.dimension = ""; + + /** + * Cohort dateRange. + * @member {google.analytics.data.v1beta.IDateRange|null|undefined} dateRange + * @memberof google.analytics.data.v1beta.Cohort + * @instance + */ + Cohort.prototype.dateRange = null; + + /** + * Creates a new Cohort instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.Cohort + * @static + * @param {google.analytics.data.v1beta.ICohort=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.Cohort} Cohort instance + */ + Cohort.create = function create(properties) { + return new Cohort(properties); + }; + + /** + * Encodes the specified Cohort message. Does not implicitly {@link google.analytics.data.v1beta.Cohort.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.Cohort + * @static + * @param {google.analytics.data.v1beta.ICohort} message Cohort message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cohort.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.dimension != null && Object.hasOwnProperty.call(message, "dimension")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dimension); + if (message.dateRange != null && Object.hasOwnProperty.call(message, "dateRange")) + $root.google.analytics.data.v1beta.DateRange.encode(message.dateRange, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Cohort message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Cohort.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.Cohort + * @static + * @param {google.analytics.data.v1beta.ICohort} message Cohort message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cohort.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cohort message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.Cohort + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.Cohort} Cohort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cohort.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.Cohort(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.dimension = reader.string(); + break; + } + case 3: { + message.dateRange = $root.google.analytics.data.v1beta.DateRange.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cohort message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.Cohort + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.Cohort} Cohort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cohort.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cohort message. + * @function verify + * @memberof google.analytics.data.v1beta.Cohort + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cohort.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.dimension != null && message.hasOwnProperty("dimension")) + if (!$util.isString(message.dimension)) + return "dimension: string expected"; + if (message.dateRange != null && message.hasOwnProperty("dateRange")) { + var error = $root.google.analytics.data.v1beta.DateRange.verify(message.dateRange); + if (error) + return "dateRange." + error; + } + return null; + }; + + /** + * Creates a Cohort message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.Cohort + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.Cohort} Cohort + */ + Cohort.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.Cohort) + return object; + var message = new $root.google.analytics.data.v1beta.Cohort(); + if (object.name != null) + message.name = String(object.name); + if (object.dimension != null) + message.dimension = String(object.dimension); + if (object.dateRange != null) { + if (typeof object.dateRange !== "object") + throw TypeError(".google.analytics.data.v1beta.Cohort.dateRange: object expected"); + message.dateRange = $root.google.analytics.data.v1beta.DateRange.fromObject(object.dateRange); + } + return message; + }; + + /** + * Creates a plain object from a Cohort message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.Cohort + * @static + * @param {google.analytics.data.v1beta.Cohort} message Cohort + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cohort.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.dimension = ""; + object.dateRange = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dimension != null && message.hasOwnProperty("dimension")) + object.dimension = message.dimension; + if (message.dateRange != null && message.hasOwnProperty("dateRange")) + object.dateRange = $root.google.analytics.data.v1beta.DateRange.toObject(message.dateRange, options); + return object; + }; + + /** + * Converts this Cohort to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.Cohort + * @instance + * @returns {Object.} JSON object + */ + Cohort.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cohort + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.Cohort + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cohort.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.Cohort"; + }; + + return Cohort; + })(); + + v1beta.CohortsRange = (function() { + + /** + * Properties of a CohortsRange. + * @memberof google.analytics.data.v1beta + * @interface ICohortsRange + * @property {google.analytics.data.v1beta.CohortsRange.Granularity|null} [granularity] CohortsRange granularity + * @property {number|null} [startOffset] CohortsRange startOffset + * @property {number|null} [endOffset] CohortsRange endOffset + */ + + /** + * Constructs a new CohortsRange. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a CohortsRange. + * @implements ICohortsRange + * @constructor + * @param {google.analytics.data.v1beta.ICohortsRange=} [properties] Properties to set + */ + function CohortsRange(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]]; + } + + /** + * CohortsRange granularity. + * @member {google.analytics.data.v1beta.CohortsRange.Granularity} granularity + * @memberof google.analytics.data.v1beta.CohortsRange + * @instance + */ + CohortsRange.prototype.granularity = 0; + + /** + * CohortsRange startOffset. + * @member {number} startOffset + * @memberof google.analytics.data.v1beta.CohortsRange + * @instance + */ + CohortsRange.prototype.startOffset = 0; + + /** + * CohortsRange endOffset. + * @member {number} endOffset + * @memberof google.analytics.data.v1beta.CohortsRange + * @instance + */ + CohortsRange.prototype.endOffset = 0; + + /** + * Creates a new CohortsRange instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.CohortsRange + * @static + * @param {google.analytics.data.v1beta.ICohortsRange=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.CohortsRange} CohortsRange instance + */ + CohortsRange.create = function create(properties) { + return new CohortsRange(properties); + }; + + /** + * Encodes the specified CohortsRange message. Does not implicitly {@link google.analytics.data.v1beta.CohortsRange.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.CohortsRange + * @static + * @param {google.analytics.data.v1beta.ICohortsRange} message CohortsRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CohortsRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.granularity != null && Object.hasOwnProperty.call(message, "granularity")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.granularity); + if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.startOffset); + if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.endOffset); + return writer; + }; + + /** + * Encodes the specified CohortsRange message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.CohortsRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.CohortsRange + * @static + * @param {google.analytics.data.v1beta.ICohortsRange} message CohortsRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CohortsRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CohortsRange message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.CohortsRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.CohortsRange} CohortsRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CohortsRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.CohortsRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.granularity = reader.int32(); + break; + } + case 2: { + message.startOffset = reader.int32(); + break; + } + case 3: { + message.endOffset = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CohortsRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.CohortsRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.CohortsRange} CohortsRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CohortsRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CohortsRange message. + * @function verify + * @memberof google.analytics.data.v1beta.CohortsRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CohortsRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.granularity != null && message.hasOwnProperty("granularity")) + switch (message.granularity) { + default: + return "granularity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + if (!$util.isInteger(message.startOffset)) + return "startOffset: integer expected"; + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + if (!$util.isInteger(message.endOffset)) + return "endOffset: integer expected"; + return null; + }; + + /** + * Creates a CohortsRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.CohortsRange + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.CohortsRange} CohortsRange + */ + CohortsRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.CohortsRange) + return object; + var message = new $root.google.analytics.data.v1beta.CohortsRange(); + switch (object.granularity) { + default: + if (typeof object.granularity === "number") { + message.granularity = object.granularity; + break; + } + break; + case "GRANULARITY_UNSPECIFIED": + case 0: + message.granularity = 0; + break; + case "DAILY": + case 1: + message.granularity = 1; + break; + case "WEEKLY": + case 2: + message.granularity = 2; + break; + case "MONTHLY": + case 3: + message.granularity = 3; + break; + } + if (object.startOffset != null) + message.startOffset = object.startOffset | 0; + if (object.endOffset != null) + message.endOffset = object.endOffset | 0; + return message; + }; + + /** + * Creates a plain object from a CohortsRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.CohortsRange + * @static + * @param {google.analytics.data.v1beta.CohortsRange} message CohortsRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CohortsRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.granularity = options.enums === String ? "GRANULARITY_UNSPECIFIED" : 0; + object.startOffset = 0; + object.endOffset = 0; + } + if (message.granularity != null && message.hasOwnProperty("granularity")) + object.granularity = options.enums === String ? $root.google.analytics.data.v1beta.CohortsRange.Granularity[message.granularity] === undefined ? message.granularity : $root.google.analytics.data.v1beta.CohortsRange.Granularity[message.granularity] : message.granularity; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + object.startOffset = message.startOffset; + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + object.endOffset = message.endOffset; + return object; + }; + + /** + * Converts this CohortsRange to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.CohortsRange + * @instance + * @returns {Object.} JSON object + */ + CohortsRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CohortsRange + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.CohortsRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CohortsRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.CohortsRange"; + }; + + /** + * Granularity enum. + * @name google.analytics.data.v1beta.CohortsRange.Granularity + * @enum {number} + * @property {number} GRANULARITY_UNSPECIFIED=0 GRANULARITY_UNSPECIFIED value + * @property {number} DAILY=1 DAILY value + * @property {number} WEEKLY=2 WEEKLY value + * @property {number} MONTHLY=3 MONTHLY value + */ + CohortsRange.Granularity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GRANULARITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "DAILY"] = 1; + values[valuesById[2] = "WEEKLY"] = 2; + values[valuesById[3] = "MONTHLY"] = 3; + return values; + })(); + + return CohortsRange; + })(); + + v1beta.CohortReportSettings = (function() { + + /** + * Properties of a CohortReportSettings. + * @memberof google.analytics.data.v1beta + * @interface ICohortReportSettings + * @property {boolean|null} [accumulate] CohortReportSettings accumulate + */ + + /** + * Constructs a new CohortReportSettings. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a CohortReportSettings. + * @implements ICohortReportSettings + * @constructor + * @param {google.analytics.data.v1beta.ICohortReportSettings=} [properties] Properties to set + */ + function CohortReportSettings(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]]; + } + + /** + * CohortReportSettings accumulate. + * @member {boolean} accumulate + * @memberof google.analytics.data.v1beta.CohortReportSettings + * @instance + */ + CohortReportSettings.prototype.accumulate = false; + + /** + * Creates a new CohortReportSettings instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.CohortReportSettings + * @static + * @param {google.analytics.data.v1beta.ICohortReportSettings=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.CohortReportSettings} CohortReportSettings instance + */ + CohortReportSettings.create = function create(properties) { + return new CohortReportSettings(properties); + }; + + /** + * Encodes the specified CohortReportSettings message. Does not implicitly {@link google.analytics.data.v1beta.CohortReportSettings.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.CohortReportSettings + * @static + * @param {google.analytics.data.v1beta.ICohortReportSettings} message CohortReportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CohortReportSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accumulate != null && Object.hasOwnProperty.call(message, "accumulate")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.accumulate); + return writer; + }; + + /** + * Encodes the specified CohortReportSettings message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.CohortReportSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.CohortReportSettings + * @static + * @param {google.analytics.data.v1beta.ICohortReportSettings} message CohortReportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CohortReportSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CohortReportSettings message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.CohortReportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.CohortReportSettings} CohortReportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CohortReportSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.CohortReportSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accumulate = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CohortReportSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.CohortReportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.CohortReportSettings} CohortReportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CohortReportSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CohortReportSettings message. + * @function verify + * @memberof google.analytics.data.v1beta.CohortReportSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CohortReportSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accumulate != null && message.hasOwnProperty("accumulate")) + if (typeof message.accumulate !== "boolean") + return "accumulate: boolean expected"; + return null; + }; + + /** + * Creates a CohortReportSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.CohortReportSettings + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.CohortReportSettings} CohortReportSettings + */ + CohortReportSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.CohortReportSettings) + return object; + var message = new $root.google.analytics.data.v1beta.CohortReportSettings(); + if (object.accumulate != null) + message.accumulate = Boolean(object.accumulate); + return message; + }; + + /** + * Creates a plain object from a CohortReportSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.CohortReportSettings + * @static + * @param {google.analytics.data.v1beta.CohortReportSettings} message CohortReportSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CohortReportSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.accumulate = false; + if (message.accumulate != null && message.hasOwnProperty("accumulate")) + object.accumulate = message.accumulate; + return object; + }; + + /** + * Converts this CohortReportSettings to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.CohortReportSettings + * @instance + * @returns {Object.} JSON object + */ + CohortReportSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CohortReportSettings + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.CohortReportSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CohortReportSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.CohortReportSettings"; + }; + + return CohortReportSettings; + })(); + + v1beta.ResponseMetaData = (function() { + + /** + * Properties of a ResponseMetaData. + * @memberof google.analytics.data.v1beta + * @interface IResponseMetaData + * @property {boolean|null} [dataLossFromOtherRow] ResponseMetaData dataLossFromOtherRow + * @property {google.analytics.data.v1beta.ResponseMetaData.ISchemaRestrictionResponse|null} [schemaRestrictionResponse] ResponseMetaData schemaRestrictionResponse + * @property {string|null} [currencyCode] ResponseMetaData currencyCode + * @property {string|null} [timeZone] ResponseMetaData timeZone + * @property {string|null} [emptyReason] ResponseMetaData emptyReason + * @property {boolean|null} [subjectToThresholding] ResponseMetaData subjectToThresholding + */ + + /** + * Constructs a new ResponseMetaData. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a ResponseMetaData. + * @implements IResponseMetaData + * @constructor + * @param {google.analytics.data.v1beta.IResponseMetaData=} [properties] Properties to set + */ + function ResponseMetaData(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]]; + } + + /** + * ResponseMetaData dataLossFromOtherRow. + * @member {boolean} dataLossFromOtherRow + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @instance + */ + ResponseMetaData.prototype.dataLossFromOtherRow = false; + + /** + * ResponseMetaData schemaRestrictionResponse. + * @member {google.analytics.data.v1beta.ResponseMetaData.ISchemaRestrictionResponse|null|undefined} schemaRestrictionResponse + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @instance + */ + ResponseMetaData.prototype.schemaRestrictionResponse = null; + + /** + * ResponseMetaData currencyCode. + * @member {string|null|undefined} currencyCode + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @instance + */ + ResponseMetaData.prototype.currencyCode = null; + + /** + * ResponseMetaData timeZone. + * @member {string|null|undefined} timeZone + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @instance + */ + ResponseMetaData.prototype.timeZone = null; + + /** + * ResponseMetaData emptyReason. + * @member {string|null|undefined} emptyReason + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @instance + */ + ResponseMetaData.prototype.emptyReason = null; + + /** + * ResponseMetaData subjectToThresholding. + * @member {boolean|null|undefined} subjectToThresholding + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @instance + */ + ResponseMetaData.prototype.subjectToThresholding = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResponseMetaData _schemaRestrictionResponse. + * @member {"schemaRestrictionResponse"|undefined} _schemaRestrictionResponse + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @instance + */ + Object.defineProperty(ResponseMetaData.prototype, "_schemaRestrictionResponse", { + get: $util.oneOfGetter($oneOfFields = ["schemaRestrictionResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResponseMetaData _currencyCode. + * @member {"currencyCode"|undefined} _currencyCode + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @instance + */ + Object.defineProperty(ResponseMetaData.prototype, "_currencyCode", { + get: $util.oneOfGetter($oneOfFields = ["currencyCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResponseMetaData _timeZone. + * @member {"timeZone"|undefined} _timeZone + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @instance + */ + Object.defineProperty(ResponseMetaData.prototype, "_timeZone", { + get: $util.oneOfGetter($oneOfFields = ["timeZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResponseMetaData _emptyReason. + * @member {"emptyReason"|undefined} _emptyReason + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @instance + */ + Object.defineProperty(ResponseMetaData.prototype, "_emptyReason", { + get: $util.oneOfGetter($oneOfFields = ["emptyReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResponseMetaData _subjectToThresholding. + * @member {"subjectToThresholding"|undefined} _subjectToThresholding + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @instance + */ + Object.defineProperty(ResponseMetaData.prototype, "_subjectToThresholding", { + get: $util.oneOfGetter($oneOfFields = ["subjectToThresholding"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResponseMetaData instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @static + * @param {google.analytics.data.v1beta.IResponseMetaData=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.ResponseMetaData} ResponseMetaData instance + */ + ResponseMetaData.create = function create(properties) { + return new ResponseMetaData(properties); + }; + + /** + * Encodes the specified ResponseMetaData message. Does not implicitly {@link google.analytics.data.v1beta.ResponseMetaData.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @static + * @param {google.analytics.data.v1beta.IResponseMetaData} message ResponseMetaData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMetaData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataLossFromOtherRow != null && Object.hasOwnProperty.call(message, "dataLossFromOtherRow")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.dataLossFromOtherRow); + if (message.schemaRestrictionResponse != null && Object.hasOwnProperty.call(message, "schemaRestrictionResponse")) + $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.encode(message.schemaRestrictionResponse, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.currencyCode); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.timeZone); + if (message.emptyReason != null && Object.hasOwnProperty.call(message, "emptyReason")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.emptyReason); + if (message.subjectToThresholding != null && Object.hasOwnProperty.call(message, "subjectToThresholding")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.subjectToThresholding); + return writer; + }; + + /** + * Encodes the specified ResponseMetaData message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.ResponseMetaData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @static + * @param {google.analytics.data.v1beta.IResponseMetaData} message ResponseMetaData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMetaData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseMetaData message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.ResponseMetaData} ResponseMetaData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMetaData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.ResponseMetaData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.dataLossFromOtherRow = reader.bool(); + break; + } + case 4: { + message.schemaRestrictionResponse = $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.decode(reader, reader.uint32()); + break; + } + case 5: { + message.currencyCode = reader.string(); + break; + } + case 6: { + message.timeZone = reader.string(); + break; + } + case 7: { + message.emptyReason = reader.string(); + break; + } + case 8: { + message.subjectToThresholding = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseMetaData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.ResponseMetaData} ResponseMetaData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMetaData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseMetaData message. + * @function verify + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseMetaData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataLossFromOtherRow != null && message.hasOwnProperty("dataLossFromOtherRow")) + if (typeof message.dataLossFromOtherRow !== "boolean") + return "dataLossFromOtherRow: boolean expected"; + if (message.schemaRestrictionResponse != null && message.hasOwnProperty("schemaRestrictionResponse")) { + properties._schemaRestrictionResponse = 1; + { + var error = $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.verify(message.schemaRestrictionResponse); + if (error) + return "schemaRestrictionResponse." + error; + } + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) { + properties._currencyCode = 1; + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + properties._timeZone = 1; + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + } + if (message.emptyReason != null && message.hasOwnProperty("emptyReason")) { + properties._emptyReason = 1; + if (!$util.isString(message.emptyReason)) + return "emptyReason: string expected"; + } + if (message.subjectToThresholding != null && message.hasOwnProperty("subjectToThresholding")) { + properties._subjectToThresholding = 1; + if (typeof message.subjectToThresholding !== "boolean") + return "subjectToThresholding: boolean expected"; + } + return null; + }; + + /** + * Creates a ResponseMetaData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.ResponseMetaData} ResponseMetaData + */ + ResponseMetaData.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.ResponseMetaData) + return object; + var message = new $root.google.analytics.data.v1beta.ResponseMetaData(); + if (object.dataLossFromOtherRow != null) + message.dataLossFromOtherRow = Boolean(object.dataLossFromOtherRow); + if (object.schemaRestrictionResponse != null) { + if (typeof object.schemaRestrictionResponse !== "object") + throw TypeError(".google.analytics.data.v1beta.ResponseMetaData.schemaRestrictionResponse: object expected"); + message.schemaRestrictionResponse = $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.fromObject(object.schemaRestrictionResponse); + } + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.emptyReason != null) + message.emptyReason = String(object.emptyReason); + if (object.subjectToThresholding != null) + message.subjectToThresholding = Boolean(object.subjectToThresholding); + return message; + }; + + /** + * Creates a plain object from a ResponseMetaData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @static + * @param {google.analytics.data.v1beta.ResponseMetaData} message ResponseMetaData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseMetaData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dataLossFromOtherRow = false; + if (message.dataLossFromOtherRow != null && message.hasOwnProperty("dataLossFromOtherRow")) + object.dataLossFromOtherRow = message.dataLossFromOtherRow; + if (message.schemaRestrictionResponse != null && message.hasOwnProperty("schemaRestrictionResponse")) { + object.schemaRestrictionResponse = $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.toObject(message.schemaRestrictionResponse, options); + if (options.oneofs) + object._schemaRestrictionResponse = "schemaRestrictionResponse"; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) { + object.currencyCode = message.currencyCode; + if (options.oneofs) + object._currencyCode = "currencyCode"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + object.timeZone = message.timeZone; + if (options.oneofs) + object._timeZone = "timeZone"; + } + if (message.emptyReason != null && message.hasOwnProperty("emptyReason")) { + object.emptyReason = message.emptyReason; + if (options.oneofs) + object._emptyReason = "emptyReason"; + } + if (message.subjectToThresholding != null && message.hasOwnProperty("subjectToThresholding")) { + object.subjectToThresholding = message.subjectToThresholding; + if (options.oneofs) + object._subjectToThresholding = "subjectToThresholding"; + } + return object; + }; + + /** + * Converts this ResponseMetaData to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @instance + * @returns {Object.} JSON object + */ + ResponseMetaData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResponseMetaData + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResponseMetaData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.ResponseMetaData"; + }; + + ResponseMetaData.SchemaRestrictionResponse = (function() { + + /** + * Properties of a SchemaRestrictionResponse. + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @interface ISchemaRestrictionResponse + * @property {Array.|null} [activeMetricRestrictions] SchemaRestrictionResponse activeMetricRestrictions + */ + + /** + * Constructs a new SchemaRestrictionResponse. + * @memberof google.analytics.data.v1beta.ResponseMetaData + * @classdesc Represents a SchemaRestrictionResponse. + * @implements ISchemaRestrictionResponse + * @constructor + * @param {google.analytics.data.v1beta.ResponseMetaData.ISchemaRestrictionResponse=} [properties] Properties to set + */ + function SchemaRestrictionResponse(properties) { + this.activeMetricRestrictions = []; + 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]]; + } + + /** + * SchemaRestrictionResponse activeMetricRestrictions. + * @member {Array.} activeMetricRestrictions + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse + * @instance + */ + SchemaRestrictionResponse.prototype.activeMetricRestrictions = $util.emptyArray; + + /** + * Creates a new SchemaRestrictionResponse instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse + * @static + * @param {google.analytics.data.v1beta.ResponseMetaData.ISchemaRestrictionResponse=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse} SchemaRestrictionResponse instance + */ + SchemaRestrictionResponse.create = function create(properties) { + return new SchemaRestrictionResponse(properties); + }; + + /** + * Encodes the specified SchemaRestrictionResponse message. Does not implicitly {@link google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse + * @static + * @param {google.analytics.data.v1beta.ResponseMetaData.ISchemaRestrictionResponse} message SchemaRestrictionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaRestrictionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.activeMetricRestrictions != null && message.activeMetricRestrictions.length) + for (var i = 0; i < message.activeMetricRestrictions.length; ++i) + $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction.encode(message.activeMetricRestrictions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SchemaRestrictionResponse message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse + * @static + * @param {google.analytics.data.v1beta.ResponseMetaData.ISchemaRestrictionResponse} message SchemaRestrictionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaRestrictionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchemaRestrictionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse} SchemaRestrictionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaRestrictionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.activeMetricRestrictions && message.activeMetricRestrictions.length)) + message.activeMetricRestrictions = []; + message.activeMetricRestrictions.push($root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchemaRestrictionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse} SchemaRestrictionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaRestrictionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchemaRestrictionResponse message. + * @function verify + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchemaRestrictionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.activeMetricRestrictions != null && message.hasOwnProperty("activeMetricRestrictions")) { + if (!Array.isArray(message.activeMetricRestrictions)) + return "activeMetricRestrictions: array expected"; + for (var i = 0; i < message.activeMetricRestrictions.length; ++i) { + var error = $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction.verify(message.activeMetricRestrictions[i]); + if (error) + return "activeMetricRestrictions." + error; + } + } + return null; + }; + + /** + * Creates a SchemaRestrictionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse} SchemaRestrictionResponse + */ + SchemaRestrictionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse) + return object; + var message = new $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse(); + if (object.activeMetricRestrictions) { + if (!Array.isArray(object.activeMetricRestrictions)) + throw TypeError(".google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.activeMetricRestrictions: array expected"); + message.activeMetricRestrictions = []; + for (var i = 0; i < object.activeMetricRestrictions.length; ++i) { + if (typeof object.activeMetricRestrictions[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.activeMetricRestrictions: object expected"); + message.activeMetricRestrictions[i] = $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction.fromObject(object.activeMetricRestrictions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SchemaRestrictionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse + * @static + * @param {google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse} message SchemaRestrictionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchemaRestrictionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.activeMetricRestrictions = []; + if (message.activeMetricRestrictions && message.activeMetricRestrictions.length) { + object.activeMetricRestrictions = []; + for (var j = 0; j < message.activeMetricRestrictions.length; ++j) + object.activeMetricRestrictions[j] = $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction.toObject(message.activeMetricRestrictions[j], options); + } + return object; + }; + + /** + * Converts this SchemaRestrictionResponse to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse + * @instance + * @returns {Object.} JSON object + */ + SchemaRestrictionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchemaRestrictionResponse + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchemaRestrictionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse"; + }; + + SchemaRestrictionResponse.ActiveMetricRestriction = (function() { + + /** + * Properties of an ActiveMetricRestriction. + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse + * @interface IActiveMetricRestriction + * @property {string|null} [metricName] ActiveMetricRestriction metricName + * @property {Array.|null} [restrictedMetricTypes] ActiveMetricRestriction restrictedMetricTypes + */ + + /** + * Constructs a new ActiveMetricRestriction. + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse + * @classdesc Represents an ActiveMetricRestriction. + * @implements IActiveMetricRestriction + * @constructor + * @param {google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.IActiveMetricRestriction=} [properties] Properties to set + */ + function ActiveMetricRestriction(properties) { + this.restrictedMetricTypes = []; + 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]]; + } + + /** + * ActiveMetricRestriction metricName. + * @member {string|null|undefined} metricName + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction + * @instance + */ + ActiveMetricRestriction.prototype.metricName = null; + + /** + * ActiveMetricRestriction restrictedMetricTypes. + * @member {Array.} restrictedMetricTypes + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction + * @instance + */ + ActiveMetricRestriction.prototype.restrictedMetricTypes = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ActiveMetricRestriction _metricName. + * @member {"metricName"|undefined} _metricName + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction + * @instance + */ + Object.defineProperty(ActiveMetricRestriction.prototype, "_metricName", { + get: $util.oneOfGetter($oneOfFields = ["metricName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ActiveMetricRestriction instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction + * @static + * @param {google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.IActiveMetricRestriction=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction} ActiveMetricRestriction instance + */ + ActiveMetricRestriction.create = function create(properties) { + return new ActiveMetricRestriction(properties); + }; + + /** + * Encodes the specified ActiveMetricRestriction message. Does not implicitly {@link google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction + * @static + * @param {google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.IActiveMetricRestriction} message ActiveMetricRestriction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActiveMetricRestriction.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); + if (message.restrictedMetricTypes != null && message.restrictedMetricTypes.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.restrictedMetricTypes.length; ++i) + writer.int32(message.restrictedMetricTypes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ActiveMetricRestriction message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction + * @static + * @param {google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.IActiveMetricRestriction} message ActiveMetricRestriction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActiveMetricRestriction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActiveMetricRestriction message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction} ActiveMetricRestriction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActiveMetricRestriction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metricName = reader.string(); + break; + } + case 2: { + if (!(message.restrictedMetricTypes && message.restrictedMetricTypes.length)) + message.restrictedMetricTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.restrictedMetricTypes.push(reader.int32()); + } else + message.restrictedMetricTypes.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActiveMetricRestriction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction} ActiveMetricRestriction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActiveMetricRestriction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActiveMetricRestriction message. + * @function verify + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActiveMetricRestriction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.metricName != null && message.hasOwnProperty("metricName")) { + properties._metricName = 1; + if (!$util.isString(message.metricName)) + return "metricName: string expected"; + } + if (message.restrictedMetricTypes != null && message.hasOwnProperty("restrictedMetricTypes")) { + if (!Array.isArray(message.restrictedMetricTypes)) + return "restrictedMetricTypes: array expected"; + for (var i = 0; i < message.restrictedMetricTypes.length; ++i) + switch (message.restrictedMetricTypes[i]) { + default: + return "restrictedMetricTypes: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates an ActiveMetricRestriction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction} ActiveMetricRestriction + */ + ActiveMetricRestriction.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction) + return object; + var message = new $root.google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction(); + if (object.metricName != null) + message.metricName = String(object.metricName); + if (object.restrictedMetricTypes) { + if (!Array.isArray(object.restrictedMetricTypes)) + throw TypeError(".google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction.restrictedMetricTypes: array expected"); + message.restrictedMetricTypes = []; + for (var i = 0; i < object.restrictedMetricTypes.length; ++i) + switch (object.restrictedMetricTypes[i]) { + default: + if (typeof object.restrictedMetricTypes[i] === "number") { + message.restrictedMetricTypes[i] = object.restrictedMetricTypes[i]; + break; + } + case "RESTRICTED_METRIC_TYPE_UNSPECIFIED": + case 0: + message.restrictedMetricTypes[i] = 0; + break; + case "COST_DATA": + case 1: + message.restrictedMetricTypes[i] = 1; + break; + case "REVENUE_DATA": + case 2: + message.restrictedMetricTypes[i] = 2; + break; + } + } + return message; + }; + + /** + * Creates a plain object from an ActiveMetricRestriction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction + * @static + * @param {google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction} message ActiveMetricRestriction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActiveMetricRestriction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.restrictedMetricTypes = []; + if (message.metricName != null && message.hasOwnProperty("metricName")) { + object.metricName = message.metricName; + if (options.oneofs) + object._metricName = "metricName"; + } + if (message.restrictedMetricTypes && message.restrictedMetricTypes.length) { + object.restrictedMetricTypes = []; + for (var j = 0; j < message.restrictedMetricTypes.length; ++j) + object.restrictedMetricTypes[j] = options.enums === String ? $root.google.analytics.data.v1beta.RestrictedMetricType[message.restrictedMetricTypes[j]] === undefined ? message.restrictedMetricTypes[j] : $root.google.analytics.data.v1beta.RestrictedMetricType[message.restrictedMetricTypes[j]] : message.restrictedMetricTypes[j]; + } + return object; + }; + + /** + * Converts this ActiveMetricRestriction to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction + * @instance + * @returns {Object.} JSON object + */ + ActiveMetricRestriction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActiveMetricRestriction + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActiveMetricRestriction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction"; + }; + + return ActiveMetricRestriction; + })(); + + return SchemaRestrictionResponse; + })(); + + return ResponseMetaData; + })(); + + v1beta.DimensionHeader = (function() { + + /** + * Properties of a DimensionHeader. + * @memberof google.analytics.data.v1beta + * @interface IDimensionHeader + * @property {string|null} [name] DimensionHeader name + */ + + /** + * Constructs a new DimensionHeader. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a DimensionHeader. + * @implements IDimensionHeader + * @constructor + * @param {google.analytics.data.v1beta.IDimensionHeader=} [properties] Properties to set + */ + function DimensionHeader(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]]; + } + + /** + * DimensionHeader name. + * @member {string} name + * @memberof google.analytics.data.v1beta.DimensionHeader + * @instance + */ + DimensionHeader.prototype.name = ""; + + /** + * Creates a new DimensionHeader instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.DimensionHeader + * @static + * @param {google.analytics.data.v1beta.IDimensionHeader=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.DimensionHeader} DimensionHeader instance + */ + DimensionHeader.create = function create(properties) { + return new DimensionHeader(properties); + }; + + /** + * Encodes the specified DimensionHeader message. Does not implicitly {@link google.analytics.data.v1beta.DimensionHeader.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.DimensionHeader + * @static + * @param {google.analytics.data.v1beta.IDimensionHeader} message DimensionHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DimensionHeader message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DimensionHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.DimensionHeader + * @static + * @param {google.analytics.data.v1beta.IDimensionHeader} message DimensionHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DimensionHeader message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.DimensionHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.DimensionHeader} DimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.DimensionHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DimensionHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.DimensionHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.DimensionHeader} DimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DimensionHeader message. + * @function verify + * @memberof google.analytics.data.v1beta.DimensionHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DimensionHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DimensionHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.DimensionHeader + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.DimensionHeader} DimensionHeader + */ + DimensionHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.DimensionHeader) + return object; + var message = new $root.google.analytics.data.v1beta.DimensionHeader(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DimensionHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.DimensionHeader + * @static + * @param {google.analytics.data.v1beta.DimensionHeader} message DimensionHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DimensionHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DimensionHeader to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.DimensionHeader + * @instance + * @returns {Object.} JSON object + */ + DimensionHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DimensionHeader + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.DimensionHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DimensionHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.DimensionHeader"; + }; + + return DimensionHeader; + })(); + + v1beta.MetricHeader = (function() { + + /** + * Properties of a MetricHeader. + * @memberof google.analytics.data.v1beta + * @interface IMetricHeader + * @property {string|null} [name] MetricHeader name + * @property {google.analytics.data.v1beta.MetricType|null} [type] MetricHeader type + */ + + /** + * Constructs a new MetricHeader. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a MetricHeader. + * @implements IMetricHeader + * @constructor + * @param {google.analytics.data.v1beta.IMetricHeader=} [properties] Properties to set + */ + function MetricHeader(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]]; + } + + /** + * MetricHeader name. + * @member {string} name + * @memberof google.analytics.data.v1beta.MetricHeader + * @instance + */ + MetricHeader.prototype.name = ""; + + /** + * MetricHeader type. + * @member {google.analytics.data.v1beta.MetricType} type + * @memberof google.analytics.data.v1beta.MetricHeader + * @instance + */ + MetricHeader.prototype.type = 0; + + /** + * Creates a new MetricHeader instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.MetricHeader + * @static + * @param {google.analytics.data.v1beta.IMetricHeader=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.MetricHeader} MetricHeader instance + */ + MetricHeader.create = function create(properties) { + return new MetricHeader(properties); + }; + + /** + * Encodes the specified MetricHeader message. Does not implicitly {@link google.analytics.data.v1beta.MetricHeader.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.MetricHeader + * @static + * @param {google.analytics.data.v1beta.IMetricHeader} message MetricHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + return writer; + }; + + /** + * Encodes the specified MetricHeader message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.MetricHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.MetricHeader + * @static + * @param {google.analytics.data.v1beta.IMetricHeader} message MetricHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricHeader message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.MetricHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.MetricHeader} MetricHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.MetricHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.MetricHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.MetricHeader} MetricHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricHeader message. + * @function verify + * @memberof google.analytics.data.v1beta.MetricHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + break; + } + return null; + }; + + /** + * Creates a MetricHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.MetricHeader + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.MetricHeader} MetricHeader + */ + MetricHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.MetricHeader) + return object; + var message = new $root.google.analytics.data.v1beta.MetricHeader(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "METRIC_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_INTEGER": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_SECONDS": + case 4: + message.type = 4; + break; + case "TYPE_MILLISECONDS": + case 5: + message.type = 5; + break; + case "TYPE_MINUTES": + case 6: + message.type = 6; + break; + case "TYPE_HOURS": + case 7: + message.type = 7; + break; + case "TYPE_STANDARD": + case 8: + message.type = 8; + break; + case "TYPE_CURRENCY": + case 9: + message.type = 9; + break; + case "TYPE_FEET": + case 10: + message.type = 10; + break; + case "TYPE_MILES": + case 11: + message.type = 11; + break; + case "TYPE_METERS": + case 12: + message.type = 12; + break; + case "TYPE_KILOMETERS": + case 13: + message.type = 13; + break; + } + return message; + }; + + /** + * Creates a plain object from a MetricHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.MetricHeader + * @static + * @param {google.analytics.data.v1beta.MetricHeader} message MetricHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "METRIC_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.analytics.data.v1beta.MetricType[message.type] === undefined ? message.type : $root.google.analytics.data.v1beta.MetricType[message.type] : message.type; + return object; + }; + + /** + * Converts this MetricHeader to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.MetricHeader + * @instance + * @returns {Object.} JSON object + */ + MetricHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricHeader + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.MetricHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.MetricHeader"; + }; + + return MetricHeader; + })(); + + v1beta.PivotHeader = (function() { + + /** + * Properties of a PivotHeader. + * @memberof google.analytics.data.v1beta + * @interface IPivotHeader + * @property {Array.|null} [pivotDimensionHeaders] PivotHeader pivotDimensionHeaders + * @property {number|null} [rowCount] PivotHeader rowCount + */ + + /** + * Constructs a new PivotHeader. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a PivotHeader. + * @implements IPivotHeader + * @constructor + * @param {google.analytics.data.v1beta.IPivotHeader=} [properties] Properties to set + */ + function PivotHeader(properties) { + this.pivotDimensionHeaders = []; + 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]]; + } + + /** + * PivotHeader pivotDimensionHeaders. + * @member {Array.} pivotDimensionHeaders + * @memberof google.analytics.data.v1beta.PivotHeader + * @instance + */ + PivotHeader.prototype.pivotDimensionHeaders = $util.emptyArray; + + /** + * PivotHeader rowCount. + * @member {number} rowCount + * @memberof google.analytics.data.v1beta.PivotHeader + * @instance + */ + PivotHeader.prototype.rowCount = 0; + + /** + * Creates a new PivotHeader instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.PivotHeader + * @static + * @param {google.analytics.data.v1beta.IPivotHeader=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.PivotHeader} PivotHeader instance + */ + PivotHeader.create = function create(properties) { + return new PivotHeader(properties); + }; + + /** + * Encodes the specified PivotHeader message. Does not implicitly {@link google.analytics.data.v1beta.PivotHeader.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.PivotHeader + * @static + * @param {google.analytics.data.v1beta.IPivotHeader} message PivotHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PivotHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pivotDimensionHeaders != null && message.pivotDimensionHeaders.length) + for (var i = 0; i < message.pivotDimensionHeaders.length; ++i) + $root.google.analytics.data.v1beta.PivotDimensionHeader.encode(message.pivotDimensionHeaders[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.rowCount); + return writer; + }; + + /** + * Encodes the specified PivotHeader message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.PivotHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.PivotHeader + * @static + * @param {google.analytics.data.v1beta.IPivotHeader} message PivotHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PivotHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PivotHeader message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.PivotHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.PivotHeader} PivotHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PivotHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.PivotHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.pivotDimensionHeaders && message.pivotDimensionHeaders.length)) + message.pivotDimensionHeaders = []; + message.pivotDimensionHeaders.push($root.google.analytics.data.v1beta.PivotDimensionHeader.decode(reader, reader.uint32())); + break; + } + case 2: { + message.rowCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PivotHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.PivotHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.PivotHeader} PivotHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PivotHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PivotHeader message. + * @function verify + * @memberof google.analytics.data.v1beta.PivotHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PivotHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pivotDimensionHeaders != null && message.hasOwnProperty("pivotDimensionHeaders")) { + if (!Array.isArray(message.pivotDimensionHeaders)) + return "pivotDimensionHeaders: array expected"; + for (var i = 0; i < message.pivotDimensionHeaders.length; ++i) { + var error = $root.google.analytics.data.v1beta.PivotDimensionHeader.verify(message.pivotDimensionHeaders[i]); + if (error) + return "pivotDimensionHeaders." + error; + } + } + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount)) + return "rowCount: integer expected"; + return null; + }; + + /** + * Creates a PivotHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.PivotHeader + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.PivotHeader} PivotHeader + */ + PivotHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.PivotHeader) + return object; + var message = new $root.google.analytics.data.v1beta.PivotHeader(); + if (object.pivotDimensionHeaders) { + if (!Array.isArray(object.pivotDimensionHeaders)) + throw TypeError(".google.analytics.data.v1beta.PivotHeader.pivotDimensionHeaders: array expected"); + message.pivotDimensionHeaders = []; + for (var i = 0; i < object.pivotDimensionHeaders.length; ++i) { + if (typeof object.pivotDimensionHeaders[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.PivotHeader.pivotDimensionHeaders: object expected"); + message.pivotDimensionHeaders[i] = $root.google.analytics.data.v1beta.PivotDimensionHeader.fromObject(object.pivotDimensionHeaders[i]); + } + } + if (object.rowCount != null) + message.rowCount = object.rowCount | 0; + return message; + }; + + /** + * Creates a plain object from a PivotHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.PivotHeader + * @static + * @param {google.analytics.data.v1beta.PivotHeader} message PivotHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PivotHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pivotDimensionHeaders = []; + if (options.defaults) + object.rowCount = 0; + if (message.pivotDimensionHeaders && message.pivotDimensionHeaders.length) { + object.pivotDimensionHeaders = []; + for (var j = 0; j < message.pivotDimensionHeaders.length; ++j) + object.pivotDimensionHeaders[j] = $root.google.analytics.data.v1beta.PivotDimensionHeader.toObject(message.pivotDimensionHeaders[j], options); + } + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + object.rowCount = message.rowCount; + return object; + }; + + /** + * Converts this PivotHeader to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.PivotHeader + * @instance + * @returns {Object.} JSON object + */ + PivotHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PivotHeader + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.PivotHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PivotHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.PivotHeader"; + }; + + return PivotHeader; + })(); + + v1beta.PivotDimensionHeader = (function() { + + /** + * Properties of a PivotDimensionHeader. + * @memberof google.analytics.data.v1beta + * @interface IPivotDimensionHeader + * @property {Array.|null} [dimensionValues] PivotDimensionHeader dimensionValues + */ + + /** + * Constructs a new PivotDimensionHeader. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a PivotDimensionHeader. + * @implements IPivotDimensionHeader + * @constructor + * @param {google.analytics.data.v1beta.IPivotDimensionHeader=} [properties] Properties to set + */ + function PivotDimensionHeader(properties) { + this.dimensionValues = []; + 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]]; + } + + /** + * PivotDimensionHeader dimensionValues. + * @member {Array.} dimensionValues + * @memberof google.analytics.data.v1beta.PivotDimensionHeader + * @instance + */ + PivotDimensionHeader.prototype.dimensionValues = $util.emptyArray; + + /** + * Creates a new PivotDimensionHeader instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.PivotDimensionHeader + * @static + * @param {google.analytics.data.v1beta.IPivotDimensionHeader=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.PivotDimensionHeader} PivotDimensionHeader instance + */ + PivotDimensionHeader.create = function create(properties) { + return new PivotDimensionHeader(properties); + }; + + /** + * Encodes the specified PivotDimensionHeader message. Does not implicitly {@link google.analytics.data.v1beta.PivotDimensionHeader.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.PivotDimensionHeader + * @static + * @param {google.analytics.data.v1beta.IPivotDimensionHeader} message PivotDimensionHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PivotDimensionHeader.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.data.v1beta.DimensionValue.encode(message.dimensionValues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PivotDimensionHeader message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.PivotDimensionHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.PivotDimensionHeader + * @static + * @param {google.analytics.data.v1beta.IPivotDimensionHeader} message PivotDimensionHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PivotDimensionHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PivotDimensionHeader message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.PivotDimensionHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.PivotDimensionHeader} PivotDimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PivotDimensionHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.PivotDimensionHeader(); + 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.data.v1beta.DimensionValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PivotDimensionHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.PivotDimensionHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.PivotDimensionHeader} PivotDimensionHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PivotDimensionHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PivotDimensionHeader message. + * @function verify + * @memberof google.analytics.data.v1beta.PivotDimensionHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PivotDimensionHeader.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.data.v1beta.DimensionValue.verify(message.dimensionValues[i]); + if (error) + return "dimensionValues." + error; + } + } + return null; + }; + + /** + * Creates a PivotDimensionHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.PivotDimensionHeader + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.PivotDimensionHeader} PivotDimensionHeader + */ + PivotDimensionHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.PivotDimensionHeader) + return object; + var message = new $root.google.analytics.data.v1beta.PivotDimensionHeader(); + if (object.dimensionValues) { + if (!Array.isArray(object.dimensionValues)) + throw TypeError(".google.analytics.data.v1beta.PivotDimensionHeader.dimensionValues: array expected"); + message.dimensionValues = []; + for (var i = 0; i < object.dimensionValues.length; ++i) { + if (typeof object.dimensionValues[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.PivotDimensionHeader.dimensionValues: object expected"); + message.dimensionValues[i] = $root.google.analytics.data.v1beta.DimensionValue.fromObject(object.dimensionValues[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PivotDimensionHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.PivotDimensionHeader + * @static + * @param {google.analytics.data.v1beta.PivotDimensionHeader} message PivotDimensionHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PivotDimensionHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dimensionValues = []; + if (message.dimensionValues && message.dimensionValues.length) { + object.dimensionValues = []; + for (var j = 0; j < message.dimensionValues.length; ++j) + object.dimensionValues[j] = $root.google.analytics.data.v1beta.DimensionValue.toObject(message.dimensionValues[j], options); + } + return object; + }; + + /** + * Converts this PivotDimensionHeader to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.PivotDimensionHeader + * @instance + * @returns {Object.} JSON object + */ + PivotDimensionHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PivotDimensionHeader + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.PivotDimensionHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PivotDimensionHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.PivotDimensionHeader"; + }; + + return PivotDimensionHeader; + })(); + + v1beta.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.analytics.data.v1beta + * @interface IRow + * @property {Array.|null} [dimensionValues] Row dimensionValues + * @property {Array.|null} [metricValues] Row metricValues + */ + + /** + * Constructs a new Row. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.analytics.data.v1beta.IRow=} [properties] Properties to set + */ + function Row(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]]; + } + + /** + * Row dimensionValues. + * @member {Array.} dimensionValues + * @memberof google.analytics.data.v1beta.Row + * @instance + */ + Row.prototype.dimensionValues = $util.emptyArray; + + /** + * Row metricValues. + * @member {Array.} metricValues + * @memberof google.analytics.data.v1beta.Row + * @instance + */ + Row.prototype.metricValues = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.Row + * @static + * @param {google.analytics.data.v1beta.IRow=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.analytics.data.v1beta.Row.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.Row + * @static + * @param {google.analytics.data.v1beta.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.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.data.v1beta.DimensionValue.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.data.v1beta.MetricValue.encode(message.metricValues[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.Row + * @static + * @param {google.analytics.data.v1beta.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.Row(); + 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.data.v1beta.DimensionValue.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.metricValues && message.metricValues.length)) + message.metricValues = []; + message.metricValues.push($root.google.analytics.data.v1beta.MetricValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.analytics.data.v1beta.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.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.data.v1beta.DimensionValue.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.data.v1beta.MetricValue.verify(message.metricValues[i]); + if (error) + return "metricValues." + error; + } + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.Row + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.Row) + return object; + var message = new $root.google.analytics.data.v1beta.Row(); + if (object.dimensionValues) { + if (!Array.isArray(object.dimensionValues)) + throw TypeError(".google.analytics.data.v1beta.Row.dimensionValues: array expected"); + message.dimensionValues = []; + for (var i = 0; i < object.dimensionValues.length; ++i) { + if (typeof object.dimensionValues[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.Row.dimensionValues: object expected"); + message.dimensionValues[i] = $root.google.analytics.data.v1beta.DimensionValue.fromObject(object.dimensionValues[i]); + } + } + if (object.metricValues) { + if (!Array.isArray(object.metricValues)) + throw TypeError(".google.analytics.data.v1beta.Row.metricValues: array expected"); + message.metricValues = []; + for (var i = 0; i < object.metricValues.length; ++i) { + if (typeof object.metricValues[i] !== "object") + throw TypeError(".google.analytics.data.v1beta.Row.metricValues: object expected"); + message.metricValues[i] = $root.google.analytics.data.v1beta.MetricValue.fromObject(object.metricValues[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.Row + * @static + * @param {google.analytics.data.v1beta.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.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.data.v1beta.DimensionValue.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.data.v1beta.MetricValue.toObject(message.metricValues[j], options); + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Row + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.Row + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.Row"; + }; + + return Row; + })(); + + v1beta.DimensionValue = (function() { + + /** + * Properties of a DimensionValue. + * @memberof google.analytics.data.v1beta + * @interface IDimensionValue + * @property {string|null} [value] DimensionValue value + */ + + /** + * Constructs a new DimensionValue. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a DimensionValue. + * @implements IDimensionValue + * @constructor + * @param {google.analytics.data.v1beta.IDimensionValue=} [properties] Properties to set + */ + function DimensionValue(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]]; + } + + /** + * DimensionValue value. + * @member {string|null|undefined} value + * @memberof google.analytics.data.v1beta.DimensionValue + * @instance + */ + DimensionValue.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DimensionValue oneValue. + * @member {"value"|undefined} oneValue + * @memberof google.analytics.data.v1beta.DimensionValue + * @instance + */ + Object.defineProperty(DimensionValue.prototype, "oneValue", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DimensionValue instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.DimensionValue + * @static + * @param {google.analytics.data.v1beta.IDimensionValue=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.DimensionValue} DimensionValue instance + */ + DimensionValue.create = function create(properties) { + return new DimensionValue(properties); + }; + + /** + * Encodes the specified DimensionValue message. Does not implicitly {@link google.analytics.data.v1beta.DimensionValue.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.DimensionValue + * @static + * @param {google.analytics.data.v1beta.IDimensionValue} message DimensionValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionValue.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 DimensionValue message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DimensionValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.DimensionValue + * @static + * @param {google.analytics.data.v1beta.IDimensionValue} message DimensionValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DimensionValue message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.DimensionValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.DimensionValue} DimensionValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.DimensionValue(); + 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 a DimensionValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.DimensionValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.DimensionValue} DimensionValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DimensionValue message. + * @function verify + * @memberof google.analytics.data.v1beta.DimensionValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DimensionValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties.oneValue = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + return null; + }; + + /** + * Creates a DimensionValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.DimensionValue + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.DimensionValue} DimensionValue + */ + DimensionValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.DimensionValue) + return object; + var message = new $root.google.analytics.data.v1beta.DimensionValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a DimensionValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.DimensionValue + * @static + * @param {google.analytics.data.v1beta.DimensionValue} message DimensionValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DimensionValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object.oneValue = "value"; + } + return object; + }; + + /** + * Converts this DimensionValue to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.DimensionValue + * @instance + * @returns {Object.} JSON object + */ + DimensionValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DimensionValue + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.DimensionValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DimensionValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.DimensionValue"; + }; + + return DimensionValue; + })(); + + v1beta.MetricValue = (function() { + + /** + * Properties of a MetricValue. + * @memberof google.analytics.data.v1beta + * @interface IMetricValue + * @property {string|null} [value] MetricValue value + */ + + /** + * Constructs a new MetricValue. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a MetricValue. + * @implements IMetricValue + * @constructor + * @param {google.analytics.data.v1beta.IMetricValue=} [properties] Properties to set + */ + function MetricValue(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]]; + } + + /** + * MetricValue value. + * @member {string|null|undefined} value + * @memberof google.analytics.data.v1beta.MetricValue + * @instance + */ + MetricValue.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MetricValue oneValue. + * @member {"value"|undefined} oneValue + * @memberof google.analytics.data.v1beta.MetricValue + * @instance + */ + Object.defineProperty(MetricValue.prototype, "oneValue", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MetricValue instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.MetricValue + * @static + * @param {google.analytics.data.v1beta.IMetricValue=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.MetricValue} MetricValue instance + */ + MetricValue.create = function create(properties) { + return new MetricValue(properties); + }; + + /** + * Encodes the specified MetricValue message. Does not implicitly {@link google.analytics.data.v1beta.MetricValue.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.MetricValue + * @static + * @param {google.analytics.data.v1beta.IMetricValue} message MetricValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.value); + return writer; + }; + + /** + * Encodes the specified MetricValue message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.MetricValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.MetricValue + * @static + * @param {google.analytics.data.v1beta.IMetricValue} message MetricValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricValue message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.MetricValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.MetricValue} MetricValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.MetricValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.MetricValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.MetricValue} MetricValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricValue message. + * @function verify + * @memberof google.analytics.data.v1beta.MetricValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties.oneValue = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + return null; + }; + + /** + * Creates a MetricValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.MetricValue + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.MetricValue} MetricValue + */ + MetricValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.MetricValue) + return object; + var message = new $root.google.analytics.data.v1beta.MetricValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a MetricValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.MetricValue + * @static + * @param {google.analytics.data.v1beta.MetricValue} message MetricValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object.oneValue = "value"; + } + return object; + }; + + /** + * Converts this MetricValue to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.MetricValue + * @instance + * @returns {Object.} JSON object + */ + MetricValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricValue + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.MetricValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.MetricValue"; + }; + + return MetricValue; + })(); + + v1beta.NumericValue = (function() { + + /** + * Properties of a NumericValue. + * @memberof google.analytics.data.v1beta + * @interface INumericValue + * @property {number|Long|null} [int64Value] NumericValue int64Value + * @property {number|null} [doubleValue] NumericValue doubleValue + */ + + /** + * Constructs a new NumericValue. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a NumericValue. + * @implements INumericValue + * @constructor + * @param {google.analytics.data.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.data.v1beta.NumericValue + * @instance + */ + NumericValue.prototype.int64Value = null; + + /** + * NumericValue doubleValue. + * @member {number|null|undefined} doubleValue + * @memberof google.analytics.data.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.data.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.data.v1beta.NumericValue + * @static + * @param {google.analytics.data.v1beta.INumericValue=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.NumericValue} NumericValue instance + */ + NumericValue.create = function create(properties) { + return new NumericValue(properties); + }; + + /** + * Encodes the specified NumericValue message. Does not implicitly {@link google.analytics.data.v1beta.NumericValue.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.NumericValue + * @static + * @param {google.analytics.data.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.data.v1beta.NumericValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.NumericValue + * @static + * @param {google.analytics.data.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.data.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.data.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.data.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.data.v1beta.NumericValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.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.data.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.data.v1beta.NumericValue + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.NumericValue} NumericValue + */ + NumericValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.NumericValue) + return object; + var message = new $root.google.analytics.data.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.data.v1beta.NumericValue + * @static + * @param {google.analytics.data.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.data.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.data.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.data.v1beta.NumericValue"; + }; + + return NumericValue; + })(); + + v1beta.PropertyQuota = (function() { + + /** + * Properties of a PropertyQuota. + * @memberof google.analytics.data.v1beta + * @interface IPropertyQuota + * @property {google.analytics.data.v1beta.IQuotaStatus|null} [tokensPerDay] PropertyQuota tokensPerDay + * @property {google.analytics.data.v1beta.IQuotaStatus|null} [tokensPerHour] PropertyQuota tokensPerHour + * @property {google.analytics.data.v1beta.IQuotaStatus|null} [concurrentRequests] PropertyQuota concurrentRequests + * @property {google.analytics.data.v1beta.IQuotaStatus|null} [serverErrorsPerProjectPerHour] PropertyQuota serverErrorsPerProjectPerHour + * @property {google.analytics.data.v1beta.IQuotaStatus|null} [potentiallyThresholdedRequestsPerHour] PropertyQuota potentiallyThresholdedRequestsPerHour + * @property {google.analytics.data.v1beta.IQuotaStatus|null} [tokensPerProjectPerHour] PropertyQuota tokensPerProjectPerHour + */ + + /** + * Constructs a new PropertyQuota. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a PropertyQuota. + * @implements IPropertyQuota + * @constructor + * @param {google.analytics.data.v1beta.IPropertyQuota=} [properties] Properties to set + */ + function PropertyQuota(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]]; + } + + /** + * PropertyQuota tokensPerDay. + * @member {google.analytics.data.v1beta.IQuotaStatus|null|undefined} tokensPerDay + * @memberof google.analytics.data.v1beta.PropertyQuota + * @instance + */ + PropertyQuota.prototype.tokensPerDay = null; + + /** + * PropertyQuota tokensPerHour. + * @member {google.analytics.data.v1beta.IQuotaStatus|null|undefined} tokensPerHour + * @memberof google.analytics.data.v1beta.PropertyQuota + * @instance + */ + PropertyQuota.prototype.tokensPerHour = null; + + /** + * PropertyQuota concurrentRequests. + * @member {google.analytics.data.v1beta.IQuotaStatus|null|undefined} concurrentRequests + * @memberof google.analytics.data.v1beta.PropertyQuota + * @instance + */ + PropertyQuota.prototype.concurrentRequests = null; + + /** + * PropertyQuota serverErrorsPerProjectPerHour. + * @member {google.analytics.data.v1beta.IQuotaStatus|null|undefined} serverErrorsPerProjectPerHour + * @memberof google.analytics.data.v1beta.PropertyQuota + * @instance + */ + PropertyQuota.prototype.serverErrorsPerProjectPerHour = null; + + /** + * PropertyQuota potentiallyThresholdedRequestsPerHour. + * @member {google.analytics.data.v1beta.IQuotaStatus|null|undefined} potentiallyThresholdedRequestsPerHour + * @memberof google.analytics.data.v1beta.PropertyQuota + * @instance + */ + PropertyQuota.prototype.potentiallyThresholdedRequestsPerHour = null; + + /** + * PropertyQuota tokensPerProjectPerHour. + * @member {google.analytics.data.v1beta.IQuotaStatus|null|undefined} tokensPerProjectPerHour + * @memberof google.analytics.data.v1beta.PropertyQuota + * @instance + */ + PropertyQuota.prototype.tokensPerProjectPerHour = null; + + /** + * Creates a new PropertyQuota instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.PropertyQuota + * @static + * @param {google.analytics.data.v1beta.IPropertyQuota=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.PropertyQuota} PropertyQuota instance + */ + PropertyQuota.create = function create(properties) { + return new PropertyQuota(properties); + }; + + /** + * Encodes the specified PropertyQuota message. Does not implicitly {@link google.analytics.data.v1beta.PropertyQuota.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.PropertyQuota + * @static + * @param {google.analytics.data.v1beta.IPropertyQuota} message PropertyQuota message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyQuota.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokensPerDay != null && Object.hasOwnProperty.call(message, "tokensPerDay")) + $root.google.analytics.data.v1beta.QuotaStatus.encode(message.tokensPerDay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tokensPerHour != null && Object.hasOwnProperty.call(message, "tokensPerHour")) + $root.google.analytics.data.v1beta.QuotaStatus.encode(message.tokensPerHour, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.concurrentRequests != null && Object.hasOwnProperty.call(message, "concurrentRequests")) + $root.google.analytics.data.v1beta.QuotaStatus.encode(message.concurrentRequests, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serverErrorsPerProjectPerHour != null && Object.hasOwnProperty.call(message, "serverErrorsPerProjectPerHour")) + $root.google.analytics.data.v1beta.QuotaStatus.encode(message.serverErrorsPerProjectPerHour, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.potentiallyThresholdedRequestsPerHour != null && Object.hasOwnProperty.call(message, "potentiallyThresholdedRequestsPerHour")) + $root.google.analytics.data.v1beta.QuotaStatus.encode(message.potentiallyThresholdedRequestsPerHour, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.tokensPerProjectPerHour != null && Object.hasOwnProperty.call(message, "tokensPerProjectPerHour")) + $root.google.analytics.data.v1beta.QuotaStatus.encode(message.tokensPerProjectPerHour, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PropertyQuota message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.PropertyQuota.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.PropertyQuota + * @static + * @param {google.analytics.data.v1beta.IPropertyQuota} message PropertyQuota message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyQuota.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PropertyQuota message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.PropertyQuota + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.PropertyQuota} PropertyQuota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyQuota.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.PropertyQuota(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tokensPerDay = $root.google.analytics.data.v1beta.QuotaStatus.decode(reader, reader.uint32()); + break; + } + case 2: { + message.tokensPerHour = $root.google.analytics.data.v1beta.QuotaStatus.decode(reader, reader.uint32()); + break; + } + case 3: { + message.concurrentRequests = $root.google.analytics.data.v1beta.QuotaStatus.decode(reader, reader.uint32()); + break; + } + case 4: { + message.serverErrorsPerProjectPerHour = $root.google.analytics.data.v1beta.QuotaStatus.decode(reader, reader.uint32()); + break; + } + case 5: { + message.potentiallyThresholdedRequestsPerHour = $root.google.analytics.data.v1beta.QuotaStatus.decode(reader, reader.uint32()); + break; + } + case 6: { + message.tokensPerProjectPerHour = $root.google.analytics.data.v1beta.QuotaStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PropertyQuota message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.PropertyQuota + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.PropertyQuota} PropertyQuota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyQuota.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PropertyQuota message. + * @function verify + * @memberof google.analytics.data.v1beta.PropertyQuota + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PropertyQuota.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.data.v1beta.QuotaStatus.verify(message.tokensPerDay); + if (error) + return "tokensPerDay." + error; + } + if (message.tokensPerHour != null && message.hasOwnProperty("tokensPerHour")) { + var error = $root.google.analytics.data.v1beta.QuotaStatus.verify(message.tokensPerHour); + if (error) + return "tokensPerHour." + error; + } + if (message.concurrentRequests != null && message.hasOwnProperty("concurrentRequests")) { + var error = $root.google.analytics.data.v1beta.QuotaStatus.verify(message.concurrentRequests); + if (error) + return "concurrentRequests." + error; + } + if (message.serverErrorsPerProjectPerHour != null && message.hasOwnProperty("serverErrorsPerProjectPerHour")) { + var error = $root.google.analytics.data.v1beta.QuotaStatus.verify(message.serverErrorsPerProjectPerHour); + if (error) + return "serverErrorsPerProjectPerHour." + error; + } + if (message.potentiallyThresholdedRequestsPerHour != null && message.hasOwnProperty("potentiallyThresholdedRequestsPerHour")) { + var error = $root.google.analytics.data.v1beta.QuotaStatus.verify(message.potentiallyThresholdedRequestsPerHour); + if (error) + return "potentiallyThresholdedRequestsPerHour." + error; + } + if (message.tokensPerProjectPerHour != null && message.hasOwnProperty("tokensPerProjectPerHour")) { + var error = $root.google.analytics.data.v1beta.QuotaStatus.verify(message.tokensPerProjectPerHour); + if (error) + return "tokensPerProjectPerHour." + error; + } + return null; + }; + + /** + * Creates a PropertyQuota message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.PropertyQuota + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.PropertyQuota} PropertyQuota + */ + PropertyQuota.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.PropertyQuota) + return object; + var message = new $root.google.analytics.data.v1beta.PropertyQuota(); + if (object.tokensPerDay != null) { + if (typeof object.tokensPerDay !== "object") + throw TypeError(".google.analytics.data.v1beta.PropertyQuota.tokensPerDay: object expected"); + message.tokensPerDay = $root.google.analytics.data.v1beta.QuotaStatus.fromObject(object.tokensPerDay); + } + if (object.tokensPerHour != null) { + if (typeof object.tokensPerHour !== "object") + throw TypeError(".google.analytics.data.v1beta.PropertyQuota.tokensPerHour: object expected"); + message.tokensPerHour = $root.google.analytics.data.v1beta.QuotaStatus.fromObject(object.tokensPerHour); + } + if (object.concurrentRequests != null) { + if (typeof object.concurrentRequests !== "object") + throw TypeError(".google.analytics.data.v1beta.PropertyQuota.concurrentRequests: object expected"); + message.concurrentRequests = $root.google.analytics.data.v1beta.QuotaStatus.fromObject(object.concurrentRequests); + } + if (object.serverErrorsPerProjectPerHour != null) { + if (typeof object.serverErrorsPerProjectPerHour !== "object") + throw TypeError(".google.analytics.data.v1beta.PropertyQuota.serverErrorsPerProjectPerHour: object expected"); + message.serverErrorsPerProjectPerHour = $root.google.analytics.data.v1beta.QuotaStatus.fromObject(object.serverErrorsPerProjectPerHour); + } + if (object.potentiallyThresholdedRequestsPerHour != null) { + if (typeof object.potentiallyThresholdedRequestsPerHour !== "object") + throw TypeError(".google.analytics.data.v1beta.PropertyQuota.potentiallyThresholdedRequestsPerHour: object expected"); + message.potentiallyThresholdedRequestsPerHour = $root.google.analytics.data.v1beta.QuotaStatus.fromObject(object.potentiallyThresholdedRequestsPerHour); + } + if (object.tokensPerProjectPerHour != null) { + if (typeof object.tokensPerProjectPerHour !== "object") + throw TypeError(".google.analytics.data.v1beta.PropertyQuota.tokensPerProjectPerHour: object expected"); + message.tokensPerProjectPerHour = $root.google.analytics.data.v1beta.QuotaStatus.fromObject(object.tokensPerProjectPerHour); + } + return message; + }; + + /** + * Creates a plain object from a PropertyQuota message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.PropertyQuota + * @static + * @param {google.analytics.data.v1beta.PropertyQuota} message PropertyQuota + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PropertyQuota.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.potentiallyThresholdedRequestsPerHour = null; + object.tokensPerProjectPerHour = null; + } + if (message.tokensPerDay != null && message.hasOwnProperty("tokensPerDay")) + object.tokensPerDay = $root.google.analytics.data.v1beta.QuotaStatus.toObject(message.tokensPerDay, options); + if (message.tokensPerHour != null && message.hasOwnProperty("tokensPerHour")) + object.tokensPerHour = $root.google.analytics.data.v1beta.QuotaStatus.toObject(message.tokensPerHour, options); + if (message.concurrentRequests != null && message.hasOwnProperty("concurrentRequests")) + object.concurrentRequests = $root.google.analytics.data.v1beta.QuotaStatus.toObject(message.concurrentRequests, options); + if (message.serverErrorsPerProjectPerHour != null && message.hasOwnProperty("serverErrorsPerProjectPerHour")) + object.serverErrorsPerProjectPerHour = $root.google.analytics.data.v1beta.QuotaStatus.toObject(message.serverErrorsPerProjectPerHour, options); + if (message.potentiallyThresholdedRequestsPerHour != null && message.hasOwnProperty("potentiallyThresholdedRequestsPerHour")) + object.potentiallyThresholdedRequestsPerHour = $root.google.analytics.data.v1beta.QuotaStatus.toObject(message.potentiallyThresholdedRequestsPerHour, options); + if (message.tokensPerProjectPerHour != null && message.hasOwnProperty("tokensPerProjectPerHour")) + object.tokensPerProjectPerHour = $root.google.analytics.data.v1beta.QuotaStatus.toObject(message.tokensPerProjectPerHour, options); + return object; + }; + + /** + * Converts this PropertyQuota to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.PropertyQuota + * @instance + * @returns {Object.} JSON object + */ + PropertyQuota.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PropertyQuota + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.PropertyQuota + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PropertyQuota.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.PropertyQuota"; + }; + + return PropertyQuota; + })(); + + v1beta.QuotaStatus = (function() { + + /** + * Properties of a QuotaStatus. + * @memberof google.analytics.data.v1beta + * @interface IQuotaStatus + * @property {number|null} [consumed] QuotaStatus consumed + * @property {number|null} [remaining] QuotaStatus remaining + */ + + /** + * Constructs a new QuotaStatus. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a QuotaStatus. + * @implements IQuotaStatus + * @constructor + * @param {google.analytics.data.v1beta.IQuotaStatus=} [properties] Properties to set + */ + function QuotaStatus(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]]; + } + + /** + * QuotaStatus consumed. + * @member {number} consumed + * @memberof google.analytics.data.v1beta.QuotaStatus + * @instance + */ + QuotaStatus.prototype.consumed = 0; + + /** + * QuotaStatus remaining. + * @member {number} remaining + * @memberof google.analytics.data.v1beta.QuotaStatus + * @instance + */ + QuotaStatus.prototype.remaining = 0; + + /** + * Creates a new QuotaStatus instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.QuotaStatus + * @static + * @param {google.analytics.data.v1beta.IQuotaStatus=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.QuotaStatus} QuotaStatus instance + */ + QuotaStatus.create = function create(properties) { + return new QuotaStatus(properties); + }; + + /** + * Encodes the specified QuotaStatus message. Does not implicitly {@link google.analytics.data.v1beta.QuotaStatus.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.QuotaStatus + * @static + * @param {google.analytics.data.v1beta.IQuotaStatus} message QuotaStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaStatus.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 QuotaStatus message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.QuotaStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.QuotaStatus + * @static + * @param {google.analytics.data.v1beta.IQuotaStatus} message QuotaStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuotaStatus message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.QuotaStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.QuotaStatus} QuotaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.QuotaStatus(); + 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 a QuotaStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.QuotaStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.QuotaStatus} QuotaStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuotaStatus message. + * @function verify + * @memberof google.analytics.data.v1beta.QuotaStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuotaStatus.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 a QuotaStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.QuotaStatus + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.QuotaStatus} QuotaStatus + */ + QuotaStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.QuotaStatus) + return object; + var message = new $root.google.analytics.data.v1beta.QuotaStatus(); + 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 a QuotaStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.QuotaStatus + * @static + * @param {google.analytics.data.v1beta.QuotaStatus} message QuotaStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuotaStatus.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 QuotaStatus to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.QuotaStatus + * @instance + * @returns {Object.} JSON object + */ + QuotaStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuotaStatus + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.QuotaStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuotaStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.QuotaStatus"; + }; + + return QuotaStatus; + })(); + + v1beta.DimensionMetadata = (function() { + + /** + * Properties of a DimensionMetadata. + * @memberof google.analytics.data.v1beta + * @interface IDimensionMetadata + * @property {string|null} [apiName] DimensionMetadata apiName + * @property {string|null} [uiName] DimensionMetadata uiName + * @property {string|null} [description] DimensionMetadata description + * @property {Array.|null} [deprecatedApiNames] DimensionMetadata deprecatedApiNames + * @property {boolean|null} [customDefinition] DimensionMetadata customDefinition + * @property {string|null} [category] DimensionMetadata category + */ + + /** + * Constructs a new DimensionMetadata. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a DimensionMetadata. + * @implements IDimensionMetadata + * @constructor + * @param {google.analytics.data.v1beta.IDimensionMetadata=} [properties] Properties to set + */ + function DimensionMetadata(properties) { + this.deprecatedApiNames = []; + 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]]; + } + + /** + * DimensionMetadata apiName. + * @member {string} apiName + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @instance + */ + DimensionMetadata.prototype.apiName = ""; + + /** + * DimensionMetadata uiName. + * @member {string} uiName + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @instance + */ + DimensionMetadata.prototype.uiName = ""; + + /** + * DimensionMetadata description. + * @member {string} description + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @instance + */ + DimensionMetadata.prototype.description = ""; + + /** + * DimensionMetadata deprecatedApiNames. + * @member {Array.} deprecatedApiNames + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @instance + */ + DimensionMetadata.prototype.deprecatedApiNames = $util.emptyArray; + + /** + * DimensionMetadata customDefinition. + * @member {boolean} customDefinition + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @instance + */ + DimensionMetadata.prototype.customDefinition = false; + + /** + * DimensionMetadata category. + * @member {string} category + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @instance + */ + DimensionMetadata.prototype.category = ""; + + /** + * Creates a new DimensionMetadata instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @static + * @param {google.analytics.data.v1beta.IDimensionMetadata=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.DimensionMetadata} DimensionMetadata instance + */ + DimensionMetadata.create = function create(properties) { + return new DimensionMetadata(properties); + }; + + /** + * Encodes the specified DimensionMetadata message. Does not implicitly {@link google.analytics.data.v1beta.DimensionMetadata.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @static + * @param {google.analytics.data.v1beta.IDimensionMetadata} message DimensionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiName != null && Object.hasOwnProperty.call(message, "apiName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.apiName); + if (message.uiName != null && Object.hasOwnProperty.call(message, "uiName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uiName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.deprecatedApiNames != null && message.deprecatedApiNames.length) + for (var i = 0; i < message.deprecatedApiNames.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.deprecatedApiNames[i]); + if (message.customDefinition != null && Object.hasOwnProperty.call(message, "customDefinition")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.customDefinition); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.category); + return writer; + }; + + /** + * Encodes the specified DimensionMetadata message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DimensionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @static + * @param {google.analytics.data.v1beta.IDimensionMetadata} message DimensionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DimensionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.DimensionMetadata} DimensionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.DimensionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.apiName = reader.string(); + break; + } + case 2: { + message.uiName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + if (!(message.deprecatedApiNames && message.deprecatedApiNames.length)) + message.deprecatedApiNames = []; + message.deprecatedApiNames.push(reader.string()); + break; + } + case 5: { + message.customDefinition = reader.bool(); + break; + } + case 7: { + message.category = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DimensionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.DimensionMetadata} DimensionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DimensionMetadata message. + * @function verify + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DimensionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiName != null && message.hasOwnProperty("apiName")) + if (!$util.isString(message.apiName)) + return "apiName: string expected"; + if (message.uiName != null && message.hasOwnProperty("uiName")) + if (!$util.isString(message.uiName)) + return "uiName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.deprecatedApiNames != null && message.hasOwnProperty("deprecatedApiNames")) { + if (!Array.isArray(message.deprecatedApiNames)) + return "deprecatedApiNames: array expected"; + for (var i = 0; i < message.deprecatedApiNames.length; ++i) + if (!$util.isString(message.deprecatedApiNames[i])) + return "deprecatedApiNames: string[] expected"; + } + if (message.customDefinition != null && message.hasOwnProperty("customDefinition")) + if (typeof message.customDefinition !== "boolean") + return "customDefinition: boolean expected"; + if (message.category != null && message.hasOwnProperty("category")) + if (!$util.isString(message.category)) + return "category: string expected"; + return null; + }; + + /** + * Creates a DimensionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.DimensionMetadata} DimensionMetadata + */ + DimensionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.DimensionMetadata) + return object; + var message = new $root.google.analytics.data.v1beta.DimensionMetadata(); + if (object.apiName != null) + message.apiName = String(object.apiName); + if (object.uiName != null) + message.uiName = String(object.uiName); + if (object.description != null) + message.description = String(object.description); + if (object.deprecatedApiNames) { + if (!Array.isArray(object.deprecatedApiNames)) + throw TypeError(".google.analytics.data.v1beta.DimensionMetadata.deprecatedApiNames: array expected"); + message.deprecatedApiNames = []; + for (var i = 0; i < object.deprecatedApiNames.length; ++i) + message.deprecatedApiNames[i] = String(object.deprecatedApiNames[i]); + } + if (object.customDefinition != null) + message.customDefinition = Boolean(object.customDefinition); + if (object.category != null) + message.category = String(object.category); + return message; + }; + + /** + * Creates a plain object from a DimensionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @static + * @param {google.analytics.data.v1beta.DimensionMetadata} message DimensionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DimensionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.deprecatedApiNames = []; + if (options.defaults) { + object.apiName = ""; + object.uiName = ""; + object.description = ""; + object.customDefinition = false; + object.category = ""; + } + if (message.apiName != null && message.hasOwnProperty("apiName")) + object.apiName = message.apiName; + if (message.uiName != null && message.hasOwnProperty("uiName")) + object.uiName = message.uiName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.deprecatedApiNames && message.deprecatedApiNames.length) { + object.deprecatedApiNames = []; + for (var j = 0; j < message.deprecatedApiNames.length; ++j) + object.deprecatedApiNames[j] = message.deprecatedApiNames[j]; + } + if (message.customDefinition != null && message.hasOwnProperty("customDefinition")) + object.customDefinition = message.customDefinition; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + return object; + }; + + /** + * Converts this DimensionMetadata to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @instance + * @returns {Object.} JSON object + */ + DimensionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DimensionMetadata + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.DimensionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DimensionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.DimensionMetadata"; + }; + + return DimensionMetadata; + })(); + + v1beta.MetricMetadata = (function() { + + /** + * Properties of a MetricMetadata. + * @memberof google.analytics.data.v1beta + * @interface IMetricMetadata + * @property {string|null} [apiName] MetricMetadata apiName + * @property {string|null} [uiName] MetricMetadata uiName + * @property {string|null} [description] MetricMetadata description + * @property {Array.|null} [deprecatedApiNames] MetricMetadata deprecatedApiNames + * @property {google.analytics.data.v1beta.MetricType|null} [type] MetricMetadata type + * @property {string|null} [expression] MetricMetadata expression + * @property {boolean|null} [customDefinition] MetricMetadata customDefinition + * @property {Array.|null} [blockedReasons] MetricMetadata blockedReasons + * @property {string|null} [category] MetricMetadata category + */ + + /** + * Constructs a new MetricMetadata. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a MetricMetadata. + * @implements IMetricMetadata + * @constructor + * @param {google.analytics.data.v1beta.IMetricMetadata=} [properties] Properties to set + */ + function MetricMetadata(properties) { + this.deprecatedApiNames = []; + this.blockedReasons = []; + 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]]; + } + + /** + * MetricMetadata apiName. + * @member {string} apiName + * @memberof google.analytics.data.v1beta.MetricMetadata + * @instance + */ + MetricMetadata.prototype.apiName = ""; + + /** + * MetricMetadata uiName. + * @member {string} uiName + * @memberof google.analytics.data.v1beta.MetricMetadata + * @instance + */ + MetricMetadata.prototype.uiName = ""; + + /** + * MetricMetadata description. + * @member {string} description + * @memberof google.analytics.data.v1beta.MetricMetadata + * @instance + */ + MetricMetadata.prototype.description = ""; + + /** + * MetricMetadata deprecatedApiNames. + * @member {Array.} deprecatedApiNames + * @memberof google.analytics.data.v1beta.MetricMetadata + * @instance + */ + MetricMetadata.prototype.deprecatedApiNames = $util.emptyArray; + + /** + * MetricMetadata type. + * @member {google.analytics.data.v1beta.MetricType} type + * @memberof google.analytics.data.v1beta.MetricMetadata + * @instance + */ + MetricMetadata.prototype.type = 0; + + /** + * MetricMetadata expression. + * @member {string} expression + * @memberof google.analytics.data.v1beta.MetricMetadata + * @instance + */ + MetricMetadata.prototype.expression = ""; + + /** + * MetricMetadata customDefinition. + * @member {boolean} customDefinition + * @memberof google.analytics.data.v1beta.MetricMetadata + * @instance + */ + MetricMetadata.prototype.customDefinition = false; + + /** + * MetricMetadata blockedReasons. + * @member {Array.} blockedReasons + * @memberof google.analytics.data.v1beta.MetricMetadata + * @instance + */ + MetricMetadata.prototype.blockedReasons = $util.emptyArray; + + /** + * MetricMetadata category. + * @member {string} category + * @memberof google.analytics.data.v1beta.MetricMetadata + * @instance + */ + MetricMetadata.prototype.category = ""; + + /** + * Creates a new MetricMetadata instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.MetricMetadata + * @static + * @param {google.analytics.data.v1beta.IMetricMetadata=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.MetricMetadata} MetricMetadata instance + */ + MetricMetadata.create = function create(properties) { + return new MetricMetadata(properties); + }; + + /** + * Encodes the specified MetricMetadata message. Does not implicitly {@link google.analytics.data.v1beta.MetricMetadata.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.MetricMetadata + * @static + * @param {google.analytics.data.v1beta.IMetricMetadata} message MetricMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiName != null && Object.hasOwnProperty.call(message, "apiName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.apiName); + if (message.uiName != null && Object.hasOwnProperty.call(message, "uiName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uiName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.deprecatedApiNames != null && message.deprecatedApiNames.length) + for (var i = 0; i < message.deprecatedApiNames.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.deprecatedApiNames[i]); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.expression); + if (message.customDefinition != null && Object.hasOwnProperty.call(message, "customDefinition")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.customDefinition); + if (message.blockedReasons != null && message.blockedReasons.length) { + writer.uint32(/* id 8, wireType 2 =*/66).fork(); + for (var i = 0; i < message.blockedReasons.length; ++i) + writer.int32(message.blockedReasons[i]); + writer.ldelim(); + } + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.category); + return writer; + }; + + /** + * Encodes the specified MetricMetadata message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.MetricMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.MetricMetadata + * @static + * @param {google.analytics.data.v1beta.IMetricMetadata} message MetricMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.MetricMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.MetricMetadata} MetricMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.MetricMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.apiName = reader.string(); + break; + } + case 2: { + message.uiName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + if (!(message.deprecatedApiNames && message.deprecatedApiNames.length)) + message.deprecatedApiNames = []; + message.deprecatedApiNames.push(reader.string()); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.expression = reader.string(); + break; + } + case 7: { + message.customDefinition = reader.bool(); + break; + } + case 8: { + if (!(message.blockedReasons && message.blockedReasons.length)) + message.blockedReasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.blockedReasons.push(reader.int32()); + } else + message.blockedReasons.push(reader.int32()); + break; + } + case 10: { + message.category = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.MetricMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.MetricMetadata} MetricMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricMetadata message. + * @function verify + * @memberof google.analytics.data.v1beta.MetricMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiName != null && message.hasOwnProperty("apiName")) + if (!$util.isString(message.apiName)) + return "apiName: string expected"; + if (message.uiName != null && message.hasOwnProperty("uiName")) + if (!$util.isString(message.uiName)) + return "uiName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.deprecatedApiNames != null && message.hasOwnProperty("deprecatedApiNames")) { + if (!Array.isArray(message.deprecatedApiNames)) + return "deprecatedApiNames: array expected"; + for (var i = 0; i < message.deprecatedApiNames.length; ++i) + if (!$util.isString(message.deprecatedApiNames[i])) + return "deprecatedApiNames: string[] expected"; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + break; + } + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.customDefinition != null && message.hasOwnProperty("customDefinition")) + if (typeof message.customDefinition !== "boolean") + return "customDefinition: boolean expected"; + if (message.blockedReasons != null && message.hasOwnProperty("blockedReasons")) { + if (!Array.isArray(message.blockedReasons)) + return "blockedReasons: array expected"; + for (var i = 0; i < message.blockedReasons.length; ++i) + switch (message.blockedReasons[i]) { + default: + return "blockedReasons: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.category != null && message.hasOwnProperty("category")) + if (!$util.isString(message.category)) + return "category: string expected"; + return null; + }; + + /** + * Creates a MetricMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.MetricMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.MetricMetadata} MetricMetadata + */ + MetricMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.MetricMetadata) + return object; + var message = new $root.google.analytics.data.v1beta.MetricMetadata(); + if (object.apiName != null) + message.apiName = String(object.apiName); + if (object.uiName != null) + message.uiName = String(object.uiName); + if (object.description != null) + message.description = String(object.description); + if (object.deprecatedApiNames) { + if (!Array.isArray(object.deprecatedApiNames)) + throw TypeError(".google.analytics.data.v1beta.MetricMetadata.deprecatedApiNames: array expected"); + message.deprecatedApiNames = []; + for (var i = 0; i < object.deprecatedApiNames.length; ++i) + message.deprecatedApiNames[i] = String(object.deprecatedApiNames[i]); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "METRIC_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_INTEGER": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_SECONDS": + case 4: + message.type = 4; + break; + case "TYPE_MILLISECONDS": + case 5: + message.type = 5; + break; + case "TYPE_MINUTES": + case 6: + message.type = 6; + break; + case "TYPE_HOURS": + case 7: + message.type = 7; + break; + case "TYPE_STANDARD": + case 8: + message.type = 8; + break; + case "TYPE_CURRENCY": + case 9: + message.type = 9; + break; + case "TYPE_FEET": + case 10: + message.type = 10; + break; + case "TYPE_MILES": + case 11: + message.type = 11; + break; + case "TYPE_METERS": + case 12: + message.type = 12; + break; + case "TYPE_KILOMETERS": + case 13: + message.type = 13; + break; + } + if (object.expression != null) + message.expression = String(object.expression); + if (object.customDefinition != null) + message.customDefinition = Boolean(object.customDefinition); + if (object.blockedReasons) { + if (!Array.isArray(object.blockedReasons)) + throw TypeError(".google.analytics.data.v1beta.MetricMetadata.blockedReasons: array expected"); + message.blockedReasons = []; + for (var i = 0; i < object.blockedReasons.length; ++i) + switch (object.blockedReasons[i]) { + default: + if (typeof object.blockedReasons[i] === "number") { + message.blockedReasons[i] = object.blockedReasons[i]; + break; + } + case "BLOCKED_REASON_UNSPECIFIED": + case 0: + message.blockedReasons[i] = 0; + break; + case "NO_REVENUE_METRICS": + case 1: + message.blockedReasons[i] = 1; + break; + case "NO_COST_METRICS": + case 2: + message.blockedReasons[i] = 2; + break; + } + } + if (object.category != null) + message.category = String(object.category); + return message; + }; + + /** + * Creates a plain object from a MetricMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.MetricMetadata + * @static + * @param {google.analytics.data.v1beta.MetricMetadata} message MetricMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.deprecatedApiNames = []; + object.blockedReasons = []; + } + if (options.defaults) { + object.apiName = ""; + object.uiName = ""; + object.description = ""; + object.type = options.enums === String ? "METRIC_TYPE_UNSPECIFIED" : 0; + object.expression = ""; + object.customDefinition = false; + object.category = ""; + } + if (message.apiName != null && message.hasOwnProperty("apiName")) + object.apiName = message.apiName; + if (message.uiName != null && message.hasOwnProperty("uiName")) + object.uiName = message.uiName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.deprecatedApiNames && message.deprecatedApiNames.length) { + object.deprecatedApiNames = []; + for (var j = 0; j < message.deprecatedApiNames.length; ++j) + object.deprecatedApiNames[j] = message.deprecatedApiNames[j]; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.analytics.data.v1beta.MetricType[message.type] === undefined ? message.type : $root.google.analytics.data.v1beta.MetricType[message.type] : message.type; + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.customDefinition != null && message.hasOwnProperty("customDefinition")) + object.customDefinition = message.customDefinition; + if (message.blockedReasons && message.blockedReasons.length) { + object.blockedReasons = []; + for (var j = 0; j < message.blockedReasons.length; ++j) + object.blockedReasons[j] = options.enums === String ? $root.google.analytics.data.v1beta.MetricMetadata.BlockedReason[message.blockedReasons[j]] === undefined ? message.blockedReasons[j] : $root.google.analytics.data.v1beta.MetricMetadata.BlockedReason[message.blockedReasons[j]] : message.blockedReasons[j]; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + return object; + }; + + /** + * Converts this MetricMetadata to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.MetricMetadata + * @instance + * @returns {Object.} JSON object + */ + MetricMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricMetadata + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.MetricMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.MetricMetadata"; + }; + + /** + * BlockedReason enum. + * @name google.analytics.data.v1beta.MetricMetadata.BlockedReason + * @enum {number} + * @property {number} BLOCKED_REASON_UNSPECIFIED=0 BLOCKED_REASON_UNSPECIFIED value + * @property {number} NO_REVENUE_METRICS=1 NO_REVENUE_METRICS value + * @property {number} NO_COST_METRICS=2 NO_COST_METRICS value + */ + MetricMetadata.BlockedReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BLOCKED_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_REVENUE_METRICS"] = 1; + values[valuesById[2] = "NO_COST_METRICS"] = 2; + return values; + })(); + + return MetricMetadata; + })(); + + v1beta.DimensionCompatibility = (function() { + + /** + * Properties of a DimensionCompatibility. + * @memberof google.analytics.data.v1beta + * @interface IDimensionCompatibility + * @property {google.analytics.data.v1beta.IDimensionMetadata|null} [dimensionMetadata] DimensionCompatibility dimensionMetadata + * @property {google.analytics.data.v1beta.Compatibility|null} [compatibility] DimensionCompatibility compatibility + */ + + /** + * Constructs a new DimensionCompatibility. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a DimensionCompatibility. + * @implements IDimensionCompatibility + * @constructor + * @param {google.analytics.data.v1beta.IDimensionCompatibility=} [properties] Properties to set + */ + function DimensionCompatibility(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]]; + } + + /** + * DimensionCompatibility dimensionMetadata. + * @member {google.analytics.data.v1beta.IDimensionMetadata|null|undefined} dimensionMetadata + * @memberof google.analytics.data.v1beta.DimensionCompatibility + * @instance + */ + DimensionCompatibility.prototype.dimensionMetadata = null; + + /** + * DimensionCompatibility compatibility. + * @member {google.analytics.data.v1beta.Compatibility|null|undefined} compatibility + * @memberof google.analytics.data.v1beta.DimensionCompatibility + * @instance + */ + DimensionCompatibility.prototype.compatibility = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DimensionCompatibility _dimensionMetadata. + * @member {"dimensionMetadata"|undefined} _dimensionMetadata + * @memberof google.analytics.data.v1beta.DimensionCompatibility + * @instance + */ + Object.defineProperty(DimensionCompatibility.prototype, "_dimensionMetadata", { + get: $util.oneOfGetter($oneOfFields = ["dimensionMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DimensionCompatibility _compatibility. + * @member {"compatibility"|undefined} _compatibility + * @memberof google.analytics.data.v1beta.DimensionCompatibility + * @instance + */ + Object.defineProperty(DimensionCompatibility.prototype, "_compatibility", { + get: $util.oneOfGetter($oneOfFields = ["compatibility"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DimensionCompatibility instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.DimensionCompatibility + * @static + * @param {google.analytics.data.v1beta.IDimensionCompatibility=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.DimensionCompatibility} DimensionCompatibility instance + */ + DimensionCompatibility.create = function create(properties) { + return new DimensionCompatibility(properties); + }; + + /** + * Encodes the specified DimensionCompatibility message. Does not implicitly {@link google.analytics.data.v1beta.DimensionCompatibility.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.DimensionCompatibility + * @static + * @param {google.analytics.data.v1beta.IDimensionCompatibility} message DimensionCompatibility message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionCompatibility.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dimensionMetadata != null && Object.hasOwnProperty.call(message, "dimensionMetadata")) + $root.google.analytics.data.v1beta.DimensionMetadata.encode(message.dimensionMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.compatibility != null && Object.hasOwnProperty.call(message, "compatibility")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.compatibility); + return writer; + }; + + /** + * Encodes the specified DimensionCompatibility message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.DimensionCompatibility.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.DimensionCompatibility + * @static + * @param {google.analytics.data.v1beta.IDimensionCompatibility} message DimensionCompatibility message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionCompatibility.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DimensionCompatibility message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.DimensionCompatibility + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.DimensionCompatibility} DimensionCompatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionCompatibility.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.DimensionCompatibility(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dimensionMetadata = $root.google.analytics.data.v1beta.DimensionMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.compatibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DimensionCompatibility message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.DimensionCompatibility + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.DimensionCompatibility} DimensionCompatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionCompatibility.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DimensionCompatibility message. + * @function verify + * @memberof google.analytics.data.v1beta.DimensionCompatibility + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DimensionCompatibility.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dimensionMetadata != null && message.hasOwnProperty("dimensionMetadata")) { + properties._dimensionMetadata = 1; + { + var error = $root.google.analytics.data.v1beta.DimensionMetadata.verify(message.dimensionMetadata); + if (error) + return "dimensionMetadata." + error; + } + } + if (message.compatibility != null && message.hasOwnProperty("compatibility")) { + properties._compatibility = 1; + switch (message.compatibility) { + default: + return "compatibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a DimensionCompatibility message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.DimensionCompatibility + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.DimensionCompatibility} DimensionCompatibility + */ + DimensionCompatibility.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.DimensionCompatibility) + return object; + var message = new $root.google.analytics.data.v1beta.DimensionCompatibility(); + if (object.dimensionMetadata != null) { + if (typeof object.dimensionMetadata !== "object") + throw TypeError(".google.analytics.data.v1beta.DimensionCompatibility.dimensionMetadata: object expected"); + message.dimensionMetadata = $root.google.analytics.data.v1beta.DimensionMetadata.fromObject(object.dimensionMetadata); + } + switch (object.compatibility) { + default: + if (typeof object.compatibility === "number") { + message.compatibility = object.compatibility; + break; + } + break; + case "COMPATIBILITY_UNSPECIFIED": + case 0: + message.compatibility = 0; + break; + case "COMPATIBLE": + case 1: + message.compatibility = 1; + break; + case "INCOMPATIBLE": + case 2: + message.compatibility = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DimensionCompatibility message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.DimensionCompatibility + * @static + * @param {google.analytics.data.v1beta.DimensionCompatibility} message DimensionCompatibility + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DimensionCompatibility.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.dimensionMetadata != null && message.hasOwnProperty("dimensionMetadata")) { + object.dimensionMetadata = $root.google.analytics.data.v1beta.DimensionMetadata.toObject(message.dimensionMetadata, options); + if (options.oneofs) + object._dimensionMetadata = "dimensionMetadata"; + } + if (message.compatibility != null && message.hasOwnProperty("compatibility")) { + object.compatibility = options.enums === String ? $root.google.analytics.data.v1beta.Compatibility[message.compatibility] === undefined ? message.compatibility : $root.google.analytics.data.v1beta.Compatibility[message.compatibility] : message.compatibility; + if (options.oneofs) + object._compatibility = "compatibility"; + } + return object; + }; + + /** + * Converts this DimensionCompatibility to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.DimensionCompatibility + * @instance + * @returns {Object.} JSON object + */ + DimensionCompatibility.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DimensionCompatibility + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.DimensionCompatibility + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DimensionCompatibility.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.DimensionCompatibility"; + }; + + return DimensionCompatibility; + })(); + + v1beta.MetricCompatibility = (function() { + + /** + * Properties of a MetricCompatibility. + * @memberof google.analytics.data.v1beta + * @interface IMetricCompatibility + * @property {google.analytics.data.v1beta.IMetricMetadata|null} [metricMetadata] MetricCompatibility metricMetadata + * @property {google.analytics.data.v1beta.Compatibility|null} [compatibility] MetricCompatibility compatibility + */ + + /** + * Constructs a new MetricCompatibility. + * @memberof google.analytics.data.v1beta + * @classdesc Represents a MetricCompatibility. + * @implements IMetricCompatibility + * @constructor + * @param {google.analytics.data.v1beta.IMetricCompatibility=} [properties] Properties to set + */ + function MetricCompatibility(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]]; + } + + /** + * MetricCompatibility metricMetadata. + * @member {google.analytics.data.v1beta.IMetricMetadata|null|undefined} metricMetadata + * @memberof google.analytics.data.v1beta.MetricCompatibility + * @instance + */ + MetricCompatibility.prototype.metricMetadata = null; + + /** + * MetricCompatibility compatibility. + * @member {google.analytics.data.v1beta.Compatibility|null|undefined} compatibility + * @memberof google.analytics.data.v1beta.MetricCompatibility + * @instance + */ + MetricCompatibility.prototype.compatibility = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MetricCompatibility _metricMetadata. + * @member {"metricMetadata"|undefined} _metricMetadata + * @memberof google.analytics.data.v1beta.MetricCompatibility + * @instance + */ + Object.defineProperty(MetricCompatibility.prototype, "_metricMetadata", { + get: $util.oneOfGetter($oneOfFields = ["metricMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MetricCompatibility _compatibility. + * @member {"compatibility"|undefined} _compatibility + * @memberof google.analytics.data.v1beta.MetricCompatibility + * @instance + */ + Object.defineProperty(MetricCompatibility.prototype, "_compatibility", { + get: $util.oneOfGetter($oneOfFields = ["compatibility"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MetricCompatibility instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.MetricCompatibility + * @static + * @param {google.analytics.data.v1beta.IMetricCompatibility=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.MetricCompatibility} MetricCompatibility instance + */ + MetricCompatibility.create = function create(properties) { + return new MetricCompatibility(properties); + }; + + /** + * Encodes the specified MetricCompatibility message. Does not implicitly {@link google.analytics.data.v1beta.MetricCompatibility.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.MetricCompatibility + * @static + * @param {google.analytics.data.v1beta.IMetricCompatibility} message MetricCompatibility message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricCompatibility.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricMetadata != null && Object.hasOwnProperty.call(message, "metricMetadata")) + $root.google.analytics.data.v1beta.MetricMetadata.encode(message.metricMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.compatibility != null && Object.hasOwnProperty.call(message, "compatibility")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.compatibility); + return writer; + }; + + /** + * Encodes the specified MetricCompatibility message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.MetricCompatibility.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.MetricCompatibility + * @static + * @param {google.analytics.data.v1beta.IMetricCompatibility} message MetricCompatibility message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricCompatibility.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricCompatibility message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.MetricCompatibility + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.MetricCompatibility} MetricCompatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricCompatibility.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.data.v1beta.MetricCompatibility(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metricMetadata = $root.google.analytics.data.v1beta.MetricMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.compatibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricCompatibility message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.MetricCompatibility + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.MetricCompatibility} MetricCompatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricCompatibility.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricCompatibility message. + * @function verify + * @memberof google.analytics.data.v1beta.MetricCompatibility + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricCompatibility.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.metricMetadata != null && message.hasOwnProperty("metricMetadata")) { + properties._metricMetadata = 1; + { + var error = $root.google.analytics.data.v1beta.MetricMetadata.verify(message.metricMetadata); + if (error) + return "metricMetadata." + error; + } + } + if (message.compatibility != null && message.hasOwnProperty("compatibility")) { + properties._compatibility = 1; + switch (message.compatibility) { + default: + return "compatibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a MetricCompatibility message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.MetricCompatibility + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.MetricCompatibility} MetricCompatibility + */ + MetricCompatibility.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.MetricCompatibility) + return object; + var message = new $root.google.analytics.data.v1beta.MetricCompatibility(); + if (object.metricMetadata != null) { + if (typeof object.metricMetadata !== "object") + throw TypeError(".google.analytics.data.v1beta.MetricCompatibility.metricMetadata: object expected"); + message.metricMetadata = $root.google.analytics.data.v1beta.MetricMetadata.fromObject(object.metricMetadata); + } + switch (object.compatibility) { + default: + if (typeof object.compatibility === "number") { + message.compatibility = object.compatibility; + break; + } + break; + case "COMPATIBILITY_UNSPECIFIED": + case 0: + message.compatibility = 0; + break; + case "COMPATIBLE": + case 1: + message.compatibility = 1; + break; + case "INCOMPATIBLE": + case 2: + message.compatibility = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a MetricCompatibility message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.MetricCompatibility + * @static + * @param {google.analytics.data.v1beta.MetricCompatibility} message MetricCompatibility + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricCompatibility.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.metricMetadata != null && message.hasOwnProperty("metricMetadata")) { + object.metricMetadata = $root.google.analytics.data.v1beta.MetricMetadata.toObject(message.metricMetadata, options); + if (options.oneofs) + object._metricMetadata = "metricMetadata"; + } + if (message.compatibility != null && message.hasOwnProperty("compatibility")) { + object.compatibility = options.enums === String ? $root.google.analytics.data.v1beta.Compatibility[message.compatibility] === undefined ? message.compatibility : $root.google.analytics.data.v1beta.Compatibility[message.compatibility] : message.compatibility; + if (options.oneofs) + object._compatibility = "compatibility"; + } + return object; + }; + + /** + * Converts this MetricCompatibility to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.MetricCompatibility + * @instance + * @returns {Object.} JSON object + */ + MetricCompatibility.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricCompatibility + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.MetricCompatibility + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricCompatibility.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.MetricCompatibility"; + }; + + return MetricCompatibility; + })(); + + /** + * MetricAggregation enum. + * @name google.analytics.data.v1beta.MetricAggregation + * @enum {number} + * @property {number} METRIC_AGGREGATION_UNSPECIFIED=0 METRIC_AGGREGATION_UNSPECIFIED value + * @property {number} TOTAL=1 TOTAL value + * @property {number} MINIMUM=5 MINIMUM value + * @property {number} MAXIMUM=6 MAXIMUM value + * @property {number} COUNT=4 COUNT value + */ + v1beta.MetricAggregation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METRIC_AGGREGATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOTAL"] = 1; + values[valuesById[5] = "MINIMUM"] = 5; + values[valuesById[6] = "MAXIMUM"] = 6; + values[valuesById[4] = "COUNT"] = 4; + return values; + })(); + + /** + * MetricType enum. + * @name google.analytics.data.v1beta.MetricType + * @enum {number} + * @property {number} METRIC_TYPE_UNSPECIFIED=0 METRIC_TYPE_UNSPECIFIED value + * @property {number} TYPE_INTEGER=1 TYPE_INTEGER value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_SECONDS=4 TYPE_SECONDS value + * @property {number} TYPE_MILLISECONDS=5 TYPE_MILLISECONDS value + * @property {number} TYPE_MINUTES=6 TYPE_MINUTES value + * @property {number} TYPE_HOURS=7 TYPE_HOURS value + * @property {number} TYPE_STANDARD=8 TYPE_STANDARD value + * @property {number} TYPE_CURRENCY=9 TYPE_CURRENCY value + * @property {number} TYPE_FEET=10 TYPE_FEET value + * @property {number} TYPE_MILES=11 TYPE_MILES value + * @property {number} TYPE_METERS=12 TYPE_METERS value + * @property {number} TYPE_KILOMETERS=13 TYPE_KILOMETERS value + */ + v1beta.MetricType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METRIC_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TYPE_INTEGER"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[4] = "TYPE_SECONDS"] = 4; + values[valuesById[5] = "TYPE_MILLISECONDS"] = 5; + values[valuesById[6] = "TYPE_MINUTES"] = 6; + values[valuesById[7] = "TYPE_HOURS"] = 7; + values[valuesById[8] = "TYPE_STANDARD"] = 8; + values[valuesById[9] = "TYPE_CURRENCY"] = 9; + values[valuesById[10] = "TYPE_FEET"] = 10; + values[valuesById[11] = "TYPE_MILES"] = 11; + values[valuesById[12] = "TYPE_METERS"] = 12; + values[valuesById[13] = "TYPE_KILOMETERS"] = 13; + return values; + })(); + + /** + * RestrictedMetricType enum. + * @name google.analytics.data.v1beta.RestrictedMetricType + * @enum {number} + * @property {number} RESTRICTED_METRIC_TYPE_UNSPECIFIED=0 RESTRICTED_METRIC_TYPE_UNSPECIFIED value + * @property {number} COST_DATA=1 COST_DATA value + * @property {number} REVENUE_DATA=2 REVENUE_DATA value + */ + v1beta.RestrictedMetricType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESTRICTED_METRIC_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COST_DATA"] = 1; + values[valuesById[2] = "REVENUE_DATA"] = 2; + return values; + })(); + + /** + * Compatibility enum. + * @name google.analytics.data.v1beta.Compatibility + * @enum {number} + * @property {number} COMPATIBILITY_UNSPECIFIED=0 COMPATIBILITY_UNSPECIFIED value + * @property {number} COMPATIBLE=1 COMPATIBLE value + * @property {number} INCOMPATIBLE=2 INCOMPATIBLE value + */ + v1beta.Compatibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPATIBILITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPATIBLE"] = 1; + values[valuesById[2] = "INCOMPATIBLE"] = 2; + return values; + })(); + + return v1beta; + })(); + + return data; + })(); + + return analytics; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + 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]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.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.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + 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]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.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.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(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]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.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.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + 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]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.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.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(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]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.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.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-analytics-data/protos/protos.json b/packages/google-analytics-data/protos/protos.json new file mode 100644 index 00000000000..f4b1bbd2310 --- /dev/null +++ b/packages/google-analytics-data/protos/protos.json @@ -0,0 +1,3902 @@ +{ + "nested": { + "google": { + "nested": { + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + } + } + }, + "analytics": { + "nested": { + "data": { + "nested": { + "v1alpha": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/analytics/data/v1alpha;data", + "java_multiple_files": true, + "java_outer_classname": "ReportingApiProto", + "java_package": "com.google.analytics.data.v1alpha" + }, + "nested": { + "AlphaAnalyticsData": { + "options": { + "(google.api.default_host)": "analyticsdata.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/analytics,https://www.googleapis.com/auth/analytics.readonly" + }, + "methods": { + "RunFunnelReport": { + "requestType": "RunFunnelReportRequest", + "responseType": "RunFunnelReportResponse", + "options": { + "(google.api.http).post": "/v1alpha/{property=properties/*}:runFunnelReport", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{property=properties/*}:runFunnelReport", + "body": "*" + } + } + ] + } + } + }, + "RunFunnelReportRequest": { + "fields": { + "property": { + "type": "string", + "id": 1 + }, + "dateRanges": { + "rule": "repeated", + "type": "DateRange", + "id": 2 + }, + "funnel": { + "type": "Funnel", + "id": 3 + }, + "funnelBreakdown": { + "type": "FunnelBreakdown", + "id": 4 + }, + "funnelNextAction": { + "type": "FunnelNextAction", + "id": 5 + }, + "funnelVisualizationType": { + "type": "FunnelVisualizationType", + "id": 6 + }, + "segments": { + "rule": "repeated", + "type": "Segment", + "id": 7 + }, + "limit": { + "type": "int64", + "id": 9 + }, + "dimensionFilter": { + "type": "FilterExpression", + "id": 10 + }, + "returnPropertyQuota": { + "type": "bool", + "id": 12 + } + }, + "nested": { + "FunnelVisualizationType": { + "values": { + "FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED": 0, + "STANDARD_FUNNEL": 1, + "TRENDED_FUNNEL": 2 + } + } + } + }, + "RunFunnelReportResponse": { + "fields": { + "funnelTable": { + "type": "FunnelSubReport", + "id": 1 + }, + "funnelVisualization": { + "type": "FunnelSubReport", + "id": 2 + }, + "propertyQuota": { + "type": "PropertyQuota", + "id": 3 + }, + "kind": { + "type": "string", + "id": 4 + } + } + }, + "DateRange": { + "fields": { + "startDate": { + "type": "string", + "id": 1 + }, + "endDate": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + } + } + }, + "Dimension": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "dimensionExpression": { + "type": "DimensionExpression", + "id": 2 + } + } + }, + "DimensionExpression": { + "oneofs": { + "oneExpression": { + "oneof": [ + "lowerCase", + "upperCase", + "concatenate" + ] + } + }, + "fields": { + "lowerCase": { + "type": "CaseExpression", + "id": 4 + }, + "upperCase": { + "type": "CaseExpression", + "id": 5 + }, + "concatenate": { + "type": "ConcatenateExpression", + "id": 6 + } + }, + "nested": { + "CaseExpression": { + "fields": { + "dimensionName": { + "type": "string", + "id": 1 + } + } + }, + "ConcatenateExpression": { + "fields": { + "dimensionNames": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "delimiter": { + "type": "string", + "id": 2 + } + } + } + } + }, + "FilterExpression": { + "oneofs": { + "expr": { + "oneof": [ + "andGroup", + "orGroup", + "notExpression", + "filter" + ] + } + }, + "fields": { + "andGroup": { + "type": "FilterExpressionList", + "id": 1 + }, + "orGroup": { + "type": "FilterExpressionList", + "id": 2 + }, + "notExpression": { + "type": "FilterExpression", + "id": 3 + }, + "filter": { + "type": "Filter", + "id": 4 + } + } + }, + "FilterExpressionList": { + "fields": { + "expressions": { + "rule": "repeated", + "type": "FilterExpression", + "id": 1 + } + } + }, + "Filter": { + "oneofs": { + "oneFilter": { + "oneof": [ + "stringFilter", + "inListFilter", + "numericFilter", + "betweenFilter" + ] + } + }, + "fields": { + "fieldName": { + "type": "string", + "id": 1 + }, + "stringFilter": { + "type": "StringFilter", + "id": 2 + }, + "inListFilter": { + "type": "InListFilter", + "id": 3 + }, + "numericFilter": { + "type": "NumericFilter", + "id": 4 + }, + "betweenFilter": { + "type": "BetweenFilter", + "id": 5 + } + } + }, + "StringFilter": { + "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 + } + } + } + }, + "InListFilter": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "caseSensitive": { + "type": "bool", + "id": 2 + } + } + }, + "NumericFilter": { + "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 + } + } + } + }, + "BetweenFilter": { + "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 + } + } + }, + "DimensionHeader": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "MetricHeader": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "MetricType", + "id": 2 + } + } + }, + "Row": { + "fields": { + "dimensionValues": { + "rule": "repeated", + "type": "DimensionValue", + "id": 1 + }, + "metricValues": { + "rule": "repeated", + "type": "MetricValue", + "id": 2 + } + } + }, + "DimensionValue": { + "oneofs": { + "oneValue": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "MetricValue": { + "oneofs": { + "oneValue": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "value": { + "type": "string", + "id": 4 + } + } + }, + "PropertyQuota": { + "fields": { + "tokensPerDay": { + "type": "QuotaStatus", + "id": 1 + }, + "tokensPerHour": { + "type": "QuotaStatus", + "id": 2 + }, + "concurrentRequests": { + "type": "QuotaStatus", + "id": 3 + }, + "serverErrorsPerProjectPerHour": { + "type": "QuotaStatus", + "id": 4 + }, + "potentiallyThresholdedRequestsPerHour": { + "type": "QuotaStatus", + "id": 5 + } + } + }, + "QuotaStatus": { + "fields": { + "consumed": { + "type": "int32", + "id": 1 + }, + "remaining": { + "type": "int32", + "id": 2 + } + } + }, + "FunnelBreakdown": { + "oneofs": { + "_limit": { + "oneof": [ + "limit" + ] + } + }, + "fields": { + "breakdownDimension": { + "type": "Dimension", + "id": 1 + }, + "limit": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "FunnelNextAction": { + "oneofs": { + "_limit": { + "oneof": [ + "limit" + ] + } + }, + "fields": { + "nextActionDimension": { + "type": "Dimension", + "id": 1 + }, + "limit": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "Funnel": { + "fields": { + "isOpenFunnel": { + "type": "bool", + "id": 1 + }, + "steps": { + "rule": "repeated", + "type": "FunnelStep", + "id": 2 + } + } + }, + "FunnelStep": { + "oneofs": { + "_withinDurationFromPriorStep": { + "oneof": [ + "withinDurationFromPriorStep" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "isDirectlyFollowedBy": { + "type": "bool", + "id": 2 + }, + "withinDurationFromPriorStep": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "filterExpression": { + "type": "FunnelFilterExpression", + "id": 4 + } + } + }, + "FunnelSubReport": { + "fields": { + "dimensionHeaders": { + "rule": "repeated", + "type": "DimensionHeader", + "id": 1 + }, + "metricHeaders": { + "rule": "repeated", + "type": "MetricHeader", + "id": 2 + }, + "rows": { + "rule": "repeated", + "type": "Row", + "id": 3 + }, + "metadata": { + "type": "FunnelResponseMetadata", + "id": 4 + } + } + }, + "UserSegment": { + "fields": { + "userInclusionCriteria": { + "type": "UserSegmentCriteria", + "id": 1 + }, + "exclusion": { + "type": "UserSegmentExclusion", + "id": 2 + } + } + }, + "UserSegmentCriteria": { + "fields": { + "andConditionGroups": { + "rule": "repeated", + "type": "UserSegmentConditionGroup", + "id": 1 + }, + "andSequenceGroups": { + "rule": "repeated", + "type": "UserSegmentSequenceGroup", + "id": 2 + } + } + }, + "UserCriteriaScoping": { + "values": { + "USER_CRITERIA_SCOPING_UNSPECIFIED": 0, + "USER_CRITERIA_WITHIN_SAME_EVENT": 1, + "USER_CRITERIA_WITHIN_SAME_SESSION": 2, + "USER_CRITERIA_ACROSS_ALL_SESSIONS": 3 + } + }, + "UserSegmentConditionGroup": { + "fields": { + "conditionScoping": { + "type": "UserCriteriaScoping", + "id": 1 + }, + "segmentFilterExpression": { + "type": "SegmentFilterExpression", + "id": 2 + } + } + }, + "UserSegmentSequenceGroup": { + "fields": { + "sequenceScoping": { + "type": "UserCriteriaScoping", + "id": 1 + }, + "sequenceMaximumDuration": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "userSequenceSteps": { + "rule": "repeated", + "type": "UserSequenceStep", + "id": 3 + } + } + }, + "UserSequenceStep": { + "fields": { + "isDirectlyFollowedBy": { + "type": "bool", + "id": 1 + }, + "stepScoping": { + "type": "UserCriteriaScoping", + "id": 2 + }, + "segmentFilterExpression": { + "type": "SegmentFilterExpression", + "id": 3 + } + } + }, + "UserSegmentExclusion": { + "fields": { + "userExclusionDuration": { + "type": "UserExclusionDuration", + "id": 1 + }, + "userExclusionCriteria": { + "type": "UserSegmentCriteria", + "id": 2 + } + } + }, + "UserExclusionDuration": { + "values": { + "USER_EXCLUSION_DURATION_UNSPECIFIED": 0, + "USER_EXCLUSION_TEMPORARY": 1, + "USER_EXCLUSION_PERMANENT": 2 + } + }, + "SessionSegment": { + "fields": { + "sessionInclusionCriteria": { + "type": "SessionSegmentCriteria", + "id": 1 + }, + "exclusion": { + "type": "SessionSegmentExclusion", + "id": 2 + } + } + }, + "SessionSegmentCriteria": { + "fields": { + "andConditionGroups": { + "rule": "repeated", + "type": "SessionSegmentConditionGroup", + "id": 1 + } + } + }, + "SessionCriteriaScoping": { + "values": { + "SESSION_CRITERIA_SCOPING_UNSPECIFIED": 0, + "SESSION_CRITERIA_WITHIN_SAME_EVENT": 1, + "SESSION_CRITERIA_WITHIN_SAME_SESSION": 2 + } + }, + "SessionSegmentConditionGroup": { + "fields": { + "conditionScoping": { + "type": "SessionCriteriaScoping", + "id": 1 + }, + "segmentFilterExpression": { + "type": "SegmentFilterExpression", + "id": 2 + } + } + }, + "SessionSegmentExclusion": { + "fields": { + "sessionExclusionDuration": { + "type": "SessionExclusionDuration", + "id": 1 + }, + "sessionExclusionCriteria": { + "type": "SessionSegmentCriteria", + "id": 2 + } + } + }, + "SessionExclusionDuration": { + "values": { + "SESSION_EXCLUSION_DURATION_UNSPECIFIED": 0, + "SESSION_EXCLUSION_TEMPORARY": 1, + "SESSION_EXCLUSION_PERMANENT": 2 + } + }, + "EventSegment": { + "fields": { + "eventInclusionCriteria": { + "type": "EventSegmentCriteria", + "id": 1 + }, + "exclusion": { + "type": "EventSegmentExclusion", + "id": 2 + } + } + }, + "EventSegmentCriteria": { + "fields": { + "andConditionGroups": { + "rule": "repeated", + "type": "EventSegmentConditionGroup", + "id": 1 + } + } + }, + "EventCriteriaScoping": { + "values": { + "EVENT_CRITERIA_SCOPING_UNSPECIFIED": 0, + "EVENT_CRITERIA_WITHIN_SAME_EVENT": 1 + } + }, + "EventSegmentConditionGroup": { + "fields": { + "conditionScoping": { + "type": "EventCriteriaScoping", + "id": 1 + }, + "segmentFilterExpression": { + "type": "SegmentFilterExpression", + "id": 2 + } + } + }, + "EventSegmentExclusion": { + "fields": { + "eventExclusionDuration": { + "type": "EventExclusionDuration", + "id": 1 + }, + "eventExclusionCriteria": { + "type": "EventSegmentCriteria", + "id": 2 + } + } + }, + "EventExclusionDuration": { + "values": { + "EVENT_EXCLUSION_DURATION_UNSPECIFIED": 0, + "EVENT_EXCLUSION_PERMANENT": 1 + } + }, + "Segment": { + "oneofs": { + "oneSegmentScope": { + "oneof": [ + "userSegment", + "sessionSegment", + "eventSegment" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "userSegment": { + "type": "UserSegment", + "id": 2 + }, + "sessionSegment": { + "type": "SessionSegment", + "id": 3 + }, + "eventSegment": { + "type": "EventSegment", + "id": 4 + } + } + }, + "SegmentFilterExpression": { + "oneofs": { + "expr": { + "oneof": [ + "andGroup", + "orGroup", + "notExpression", + "segmentFilter", + "segmentEventFilter" + ] + } + }, + "fields": { + "andGroup": { + "type": "SegmentFilterExpressionList", + "id": 1 + }, + "orGroup": { + "type": "SegmentFilterExpressionList", + "id": 2 + }, + "notExpression": { + "type": "SegmentFilterExpression", + "id": 3 + }, + "segmentFilter": { + "type": "SegmentFilter", + "id": 4 + }, + "segmentEventFilter": { + "type": "SegmentEventFilter", + "id": 5 + } + } + }, + "SegmentFilterExpressionList": { + "fields": { + "expressions": { + "rule": "repeated", + "type": "SegmentFilterExpression", + "id": 1 + } + } + }, + "SegmentFilter": { + "oneofs": { + "oneFilter": { + "oneof": [ + "stringFilter", + "inListFilter", + "numericFilter", + "betweenFilter" + ] + } + }, + "fields": { + "fieldName": { + "type": "string", + "id": 1 + }, + "stringFilter": { + "type": "StringFilter", + "id": 4 + }, + "inListFilter": { + "type": "InListFilter", + "id": 5 + }, + "numericFilter": { + "type": "NumericFilter", + "id": 6 + }, + "betweenFilter": { + "type": "BetweenFilter", + "id": 7 + }, + "filterScoping": { + "type": "SegmentFilterScoping", + "id": 8 + } + } + }, + "SegmentFilterScoping": { + "oneofs": { + "_atAnyPointInTime": { + "oneof": [ + "atAnyPointInTime" + ] + } + }, + "fields": { + "atAnyPointInTime": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "SegmentEventFilter": { + "oneofs": { + "_eventName": { + "oneof": [ + "eventName" + ] + }, + "_segmentParameterFilterExpression": { + "oneof": [ + "segmentParameterFilterExpression" + ] + } + }, + "fields": { + "eventName": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "segmentParameterFilterExpression": { + "type": "SegmentParameterFilterExpression", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "SegmentParameterFilterExpression": { + "oneofs": { + "expr": { + "oneof": [ + "andGroup", + "orGroup", + "notExpression", + "segmentParameterFilter" + ] + } + }, + "fields": { + "andGroup": { + "type": "SegmentParameterFilterExpressionList", + "id": 1 + }, + "orGroup": { + "type": "SegmentParameterFilterExpressionList", + "id": 2 + }, + "notExpression": { + "type": "SegmentParameterFilterExpression", + "id": 3 + }, + "segmentParameterFilter": { + "type": "SegmentParameterFilter", + "id": 4 + } + } + }, + "SegmentParameterFilterExpressionList": { + "fields": { + "expressions": { + "rule": "repeated", + "type": "SegmentParameterFilterExpression", + "id": 1 + } + } + }, + "SegmentParameterFilter": { + "oneofs": { + "oneParameter": { + "oneof": [ + "eventParameterName", + "itemParameterName" + ] + }, + "oneFilter": { + "oneof": [ + "stringFilter", + "inListFilter", + "numericFilter", + "betweenFilter" + ] + } + }, + "fields": { + "eventParameterName": { + "type": "string", + "id": 1 + }, + "itemParameterName": { + "type": "string", + "id": 2 + }, + "stringFilter": { + "type": "StringFilter", + "id": 4 + }, + "inListFilter": { + "type": "InListFilter", + "id": 5 + }, + "numericFilter": { + "type": "NumericFilter", + "id": 6 + }, + "betweenFilter": { + "type": "BetweenFilter", + "id": 7 + }, + "filterScoping": { + "type": "SegmentParameterFilterScoping", + "id": 8 + } + } + }, + "SegmentParameterFilterScoping": { + "oneofs": { + "_inAnyNDayPeriod": { + "oneof": [ + "inAnyNDayPeriod" + ] + } + }, + "fields": { + "inAnyNDayPeriod": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "FunnelFilterExpression": { + "oneofs": { + "expr": { + "oneof": [ + "andGroup", + "orGroup", + "notExpression", + "funnelFieldFilter", + "funnelEventFilter" + ] + } + }, + "fields": { + "andGroup": { + "type": "FunnelFilterExpressionList", + "id": 1 + }, + "orGroup": { + "type": "FunnelFilterExpressionList", + "id": 2 + }, + "notExpression": { + "type": "FunnelFilterExpression", + "id": 3 + }, + "funnelFieldFilter": { + "type": "FunnelFieldFilter", + "id": 4 + }, + "funnelEventFilter": { + "type": "FunnelEventFilter", + "id": 5 + } + } + }, + "FunnelFilterExpressionList": { + "fields": { + "expressions": { + "rule": "repeated", + "type": "FunnelFilterExpression", + "id": 1 + } + } + }, + "FunnelFieldFilter": { + "oneofs": { + "oneFilter": { + "oneof": [ + "stringFilter", + "inListFilter", + "numericFilter", + "betweenFilter" + ] + } + }, + "fields": { + "fieldName": { + "type": "string", + "id": 1 + }, + "stringFilter": { + "type": "StringFilter", + "id": 4 + }, + "inListFilter": { + "type": "InListFilter", + "id": 5 + }, + "numericFilter": { + "type": "NumericFilter", + "id": 6 + }, + "betweenFilter": { + "type": "BetweenFilter", + "id": 7 + } + } + }, + "FunnelEventFilter": { + "oneofs": { + "_eventName": { + "oneof": [ + "eventName" + ] + }, + "_funnelParameterFilterExpression": { + "oneof": [ + "funnelParameterFilterExpression" + ] + } + }, + "fields": { + "eventName": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "funnelParameterFilterExpression": { + "type": "FunnelParameterFilterExpression", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "FunnelParameterFilterExpression": { + "oneofs": { + "expr": { + "oneof": [ + "andGroup", + "orGroup", + "notExpression", + "funnelParameterFilter" + ] + } + }, + "fields": { + "andGroup": { + "type": "FunnelParameterFilterExpressionList", + "id": 1 + }, + "orGroup": { + "type": "FunnelParameterFilterExpressionList", + "id": 2 + }, + "notExpression": { + "type": "FunnelParameterFilterExpression", + "id": 3 + }, + "funnelParameterFilter": { + "type": "FunnelParameterFilter", + "id": 4 + } + } + }, + "FunnelParameterFilterExpressionList": { + "fields": { + "expressions": { + "rule": "repeated", + "type": "FunnelParameterFilterExpression", + "id": 1 + } + } + }, + "FunnelParameterFilter": { + "oneofs": { + "oneParameter": { + "oneof": [ + "eventParameterName", + "itemParameterName" + ] + }, + "oneFilter": { + "oneof": [ + "stringFilter", + "inListFilter", + "numericFilter", + "betweenFilter" + ] + } + }, + "fields": { + "eventParameterName": { + "type": "string", + "id": 1 + }, + "itemParameterName": { + "type": "string", + "id": 2 + }, + "stringFilter": { + "type": "StringFilter", + "id": 4 + }, + "inListFilter": { + "type": "InListFilter", + "id": 5 + }, + "numericFilter": { + "type": "NumericFilter", + "id": 6 + }, + "betweenFilter": { + "type": "BetweenFilter", + "id": 7 + } + } + }, + "FunnelResponseMetadata": { + "fields": { + "samplingMetadatas": { + "rule": "repeated", + "type": "SamplingMetadata", + "id": 1 + } + } + }, + "SamplingMetadata": { + "fields": { + "samplesReadCount": { + "type": "int64", + "id": 1 + }, + "samplingSpaceSize": { + "type": "int64", + "id": 2 + } + } + }, + "MetricType": { + "values": { + "METRIC_TYPE_UNSPECIFIED": 0, + "TYPE_INTEGER": 1, + "TYPE_FLOAT": 2, + "TYPE_SECONDS": 4, + "TYPE_MILLISECONDS": 5, + "TYPE_MINUTES": 6, + "TYPE_HOURS": 7, + "TYPE_STANDARD": 8, + "TYPE_CURRENCY": 9, + "TYPE_FEET": 10, + "TYPE_MILES": 11, + "TYPE_METERS": 12, + "TYPE_KILOMETERS": 13 + } + } + } + }, + "v1beta": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/analytics/data/v1beta;data", + "java_multiple_files": true, + "java_outer_classname": "ReportingApiProto", + "java_package": "com.google.analytics.data.v1beta" + }, + "nested": { + "BetaAnalyticsData": { + "options": { + "(google.api.default_host)": "analyticsdata.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/analytics,https://www.googleapis.com/auth/analytics.readonly" + }, + "methods": { + "RunReport": { + "requestType": "RunReportRequest", + "responseType": "RunReportResponse", + "options": { + "(google.api.http).post": "/v1beta/{property=properties/*}:runReport", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{property=properties/*}:runReport", + "body": "*" + } + } + ] + }, + "RunPivotReport": { + "requestType": "RunPivotReportRequest", + "responseType": "RunPivotReportResponse", + "options": { + "(google.api.http).post": "/v1beta/{property=properties/*}:runPivotReport", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{property=properties/*}:runPivotReport", + "body": "*" + } + } + ] + }, + "BatchRunReports": { + "requestType": "BatchRunReportsRequest", + "responseType": "BatchRunReportsResponse", + "options": { + "(google.api.http).post": "/v1beta/{property=properties/*}:batchRunReports", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{property=properties/*}:batchRunReports", + "body": "*" + } + } + ] + }, + "BatchRunPivotReports": { + "requestType": "BatchRunPivotReportsRequest", + "responseType": "BatchRunPivotReportsResponse", + "options": { + "(google.api.http).post": "/v1beta/{property=properties/*}:batchRunPivotReports", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{property=properties/*}:batchRunPivotReports", + "body": "*" + } + } + ] + }, + "GetMetadata": { + "requestType": "GetMetadataRequest", + "responseType": "Metadata", + "options": { + "(google.api.http).get": "/v1beta/{name=properties/*/metadata}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=properties/*/metadata}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RunRealtimeReport": { + "requestType": "RunRealtimeReportRequest", + "responseType": "RunRealtimeReportResponse", + "options": { + "(google.api.http).post": "/v1beta/{property=properties/*}:runRealtimeReport", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{property=properties/*}:runRealtimeReport", + "body": "*" + } + } + ] + }, + "CheckCompatibility": { + "requestType": "CheckCompatibilityRequest", + "responseType": "CheckCompatibilityResponse", + "options": { + "(google.api.http).post": "/v1beta/{property=properties/*}:checkCompatibility", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{property=properties/*}:checkCompatibility", + "body": "*" + } + } + ] + } + } + }, + "CheckCompatibilityRequest": { + "fields": { + "property": { + "type": "string", + "id": 1 + }, + "dimensions": { + "rule": "repeated", + "type": "Dimension", + "id": 2 + }, + "metrics": { + "rule": "repeated", + "type": "Metric", + "id": 3 + }, + "dimensionFilter": { + "type": "FilterExpression", + "id": 4 + }, + "metricFilter": { + "type": "FilterExpression", + "id": 5 + }, + "compatibilityFilter": { + "type": "Compatibility", + "id": 6 + } + } + }, + "CheckCompatibilityResponse": { + "fields": { + "dimensionCompatibilities": { + "rule": "repeated", + "type": "DimensionCompatibility", + "id": 1 + }, + "metricCompatibilities": { + "rule": "repeated", + "type": "MetricCompatibility", + "id": 2 + } + } + }, + "Metadata": { + "options": { + "(google.api.resource).type": "analyticsdata.googleapis.com/Metadata", + "(google.api.resource).pattern": "properties/{property}/metadata" + }, + "fields": { + "name": { + "type": "string", + "id": 3 + }, + "dimensions": { + "rule": "repeated", + "type": "DimensionMetadata", + "id": 1 + }, + "metrics": { + "rule": "repeated", + "type": "MetricMetadata", + "id": 2 + } + } + }, + "RunReportRequest": { + "fields": { + "property": { + "type": "string", + "id": 1 + }, + "dimensions": { + "rule": "repeated", + "type": "Dimension", + "id": 2 + }, + "metrics": { + "rule": "repeated", + "type": "Metric", + "id": 3 + }, + "dateRanges": { + "rule": "repeated", + "type": "DateRange", + "id": 4 + }, + "dimensionFilter": { + "type": "FilterExpression", + "id": 5 + }, + "metricFilter": { + "type": "FilterExpression", + "id": 6 + }, + "offset": { + "type": "int64", + "id": 7 + }, + "limit": { + "type": "int64", + "id": 8 + }, + "metricAggregations": { + "rule": "repeated", + "type": "MetricAggregation", + "id": 9 + }, + "orderBys": { + "rule": "repeated", + "type": "OrderBy", + "id": 10 + }, + "currencyCode": { + "type": "string", + "id": 11 + }, + "cohortSpec": { + "type": "CohortSpec", + "id": 12 + }, + "keepEmptyRows": { + "type": "bool", + "id": 13 + }, + "returnPropertyQuota": { + "type": "bool", + "id": 14 + } + } + }, + "RunReportResponse": { + "fields": { + "dimensionHeaders": { + "rule": "repeated", + "type": "DimensionHeader", + "id": 1 + }, + "metricHeaders": { + "rule": "repeated", + "type": "MetricHeader", + "id": 2 + }, + "rows": { + "rule": "repeated", + "type": "Row", + "id": 3 + }, + "totals": { + "rule": "repeated", + "type": "Row", + "id": 4 + }, + "maximums": { + "rule": "repeated", + "type": "Row", + "id": 5 + }, + "minimums": { + "rule": "repeated", + "type": "Row", + "id": 6 + }, + "rowCount": { + "type": "int32", + "id": 7 + }, + "metadata": { + "type": "ResponseMetaData", + "id": 8 + }, + "propertyQuota": { + "type": "PropertyQuota", + "id": 9 + }, + "kind": { + "type": "string", + "id": 10 + } + } + }, + "RunPivotReportRequest": { + "fields": { + "property": { + "type": "string", + "id": 1 + }, + "dimensions": { + "rule": "repeated", + "type": "Dimension", + "id": 2 + }, + "metrics": { + "rule": "repeated", + "type": "Metric", + "id": 3 + }, + "dateRanges": { + "rule": "repeated", + "type": "DateRange", + "id": 4 + }, + "pivots": { + "rule": "repeated", + "type": "Pivot", + "id": 5 + }, + "dimensionFilter": { + "type": "FilterExpression", + "id": 6 + }, + "metricFilter": { + "type": "FilterExpression", + "id": 7 + }, + "currencyCode": { + "type": "string", + "id": 8 + }, + "cohortSpec": { + "type": "CohortSpec", + "id": 9 + }, + "keepEmptyRows": { + "type": "bool", + "id": 10 + }, + "returnPropertyQuota": { + "type": "bool", + "id": 11 + } + } + }, + "RunPivotReportResponse": { + "fields": { + "pivotHeaders": { + "rule": "repeated", + "type": "PivotHeader", + "id": 1 + }, + "dimensionHeaders": { + "rule": "repeated", + "type": "DimensionHeader", + "id": 2 + }, + "metricHeaders": { + "rule": "repeated", + "type": "MetricHeader", + "id": 3 + }, + "rows": { + "rule": "repeated", + "type": "Row", + "id": 4 + }, + "aggregates": { + "rule": "repeated", + "type": "Row", + "id": 5 + }, + "metadata": { + "type": "ResponseMetaData", + "id": 6 + }, + "propertyQuota": { + "type": "PropertyQuota", + "id": 7 + }, + "kind": { + "type": "string", + "id": 8 + } + } + }, + "BatchRunReportsRequest": { + "fields": { + "property": { + "type": "string", + "id": 1 + }, + "requests": { + "rule": "repeated", + "type": "RunReportRequest", + "id": 2 + } + } + }, + "BatchRunReportsResponse": { + "fields": { + "reports": { + "rule": "repeated", + "type": "RunReportResponse", + "id": 1 + }, + "kind": { + "type": "string", + "id": 2 + } + } + }, + "BatchRunPivotReportsRequest": { + "fields": { + "property": { + "type": "string", + "id": 1 + }, + "requests": { + "rule": "repeated", + "type": "RunPivotReportRequest", + "id": 2 + } + } + }, + "BatchRunPivotReportsResponse": { + "fields": { + "pivotReports": { + "rule": "repeated", + "type": "RunPivotReportResponse", + "id": 1 + }, + "kind": { + "type": "string", + "id": 2 + } + } + }, + "GetMetadataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "analyticsdata.googleapis.com/Metadata" + } + } + } + }, + "RunRealtimeReportRequest": { + "fields": { + "property": { + "type": "string", + "id": 1 + }, + "dimensions": { + "rule": "repeated", + "type": "Dimension", + "id": 2 + }, + "metrics": { + "rule": "repeated", + "type": "Metric", + "id": 3 + }, + "dimensionFilter": { + "type": "FilterExpression", + "id": 4 + }, + "metricFilter": { + "type": "FilterExpression", + "id": 5 + }, + "limit": { + "type": "int64", + "id": 6 + }, + "metricAggregations": { + "rule": "repeated", + "type": "MetricAggregation", + "id": 7 + }, + "orderBys": { + "rule": "repeated", + "type": "OrderBy", + "id": 8 + }, + "returnPropertyQuota": { + "type": "bool", + "id": 9 + }, + "minuteRanges": { + "rule": "repeated", + "type": "MinuteRange", + "id": 10 + } + } + }, + "RunRealtimeReportResponse": { + "fields": { + "dimensionHeaders": { + "rule": "repeated", + "type": "DimensionHeader", + "id": 1 + }, + "metricHeaders": { + "rule": "repeated", + "type": "MetricHeader", + "id": 2 + }, + "rows": { + "rule": "repeated", + "type": "Row", + "id": 3 + }, + "totals": { + "rule": "repeated", + "type": "Row", + "id": 4 + }, + "maximums": { + "rule": "repeated", + "type": "Row", + "id": 5 + }, + "minimums": { + "rule": "repeated", + "type": "Row", + "id": 6 + }, + "rowCount": { + "type": "int32", + "id": 7 + }, + "propertyQuota": { + "type": "PropertyQuota", + "id": 8 + }, + "kind": { + "type": "string", + "id": 9 + } + } + }, + "DateRange": { + "fields": { + "startDate": { + "type": "string", + "id": 1 + }, + "endDate": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + } + } + }, + "MinuteRange": { + "oneofs": { + "_startMinutesAgo": { + "oneof": [ + "startMinutesAgo" + ] + }, + "_endMinutesAgo": { + "oneof": [ + "endMinutesAgo" + ] + } + }, + "fields": { + "startMinutesAgo": { + "type": "int32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "endMinutesAgo": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3 + } + } + }, + "Dimension": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "dimensionExpression": { + "type": "DimensionExpression", + "id": 2 + } + } + }, + "DimensionExpression": { + "oneofs": { + "oneExpression": { + "oneof": [ + "lowerCase", + "upperCase", + "concatenate" + ] + } + }, + "fields": { + "lowerCase": { + "type": "CaseExpression", + "id": 4 + }, + "upperCase": { + "type": "CaseExpression", + "id": 5 + }, + "concatenate": { + "type": "ConcatenateExpression", + "id": 6 + } + }, + "nested": { + "CaseExpression": { + "fields": { + "dimensionName": { + "type": "string", + "id": 1 + } + } + }, + "ConcatenateExpression": { + "fields": { + "dimensionNames": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "delimiter": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Metric": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "expression": { + "type": "string", + "id": 2 + }, + "invisible": { + "type": "bool", + "id": 3 + } + } + }, + "FilterExpression": { + "oneofs": { + "expr": { + "oneof": [ + "andGroup", + "orGroup", + "notExpression", + "filter" + ] + } + }, + "fields": { + "andGroup": { + "type": "FilterExpressionList", + "id": 1 + }, + "orGroup": { + "type": "FilterExpressionList", + "id": 2 + }, + "notExpression": { + "type": "FilterExpression", + "id": 3 + }, + "filter": { + "type": "Filter", + "id": 4 + } + } + }, + "FilterExpressionList": { + "fields": { + "expressions": { + "rule": "repeated", + "type": "FilterExpression", + "id": 1 + } + } + }, + "Filter": { + "oneofs": { + "oneFilter": { + "oneof": [ + "stringFilter", + "inListFilter", + "numericFilter", + "betweenFilter" + ] + } + }, + "fields": { + "fieldName": { + "type": "string", + "id": 1 + }, + "stringFilter": { + "type": "StringFilter", + "id": 3 + }, + "inListFilter": { + "type": "InListFilter", + "id": 4 + }, + "numericFilter": { + "type": "NumericFilter", + "id": 5 + }, + "betweenFilter": { + "type": "BetweenFilter", + "id": 6 + } + }, + "nested": { + "StringFilter": { + "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 + } + } + } + }, + "InListFilter": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "caseSensitive": { + "type": "bool", + "id": 2 + } + } + }, + "NumericFilter": { + "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 + } + } + } + }, + "BetweenFilter": { + "fields": { + "fromValue": { + "type": "NumericValue", + "id": 1 + }, + "toValue": { + "type": "NumericValue", + "id": 2 + } + } + } + } + }, + "OrderBy": { + "oneofs": { + "oneOrderBy": { + "oneof": [ + "metric", + "dimension", + "pivot" + ] + } + }, + "fields": { + "metric": { + "type": "MetricOrderBy", + "id": 1 + }, + "dimension": { + "type": "DimensionOrderBy", + "id": 2 + }, + "pivot": { + "type": "PivotOrderBy", + "id": 3 + }, + "desc": { + "type": "bool", + "id": 4 + } + }, + "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 + } + } + } + }, + "PivotOrderBy": { + "fields": { + "metricName": { + "type": "string", + "id": 1 + }, + "pivotSelections": { + "rule": "repeated", + "type": "PivotSelection", + "id": 2 + } + }, + "nested": { + "PivotSelection": { + "fields": { + "dimensionName": { + "type": "string", + "id": 1 + }, + "dimensionValue": { + "type": "string", + "id": 2 + } + } + } + } + } + } + }, + "Pivot": { + "fields": { + "fieldNames": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "orderBys": { + "rule": "repeated", + "type": "OrderBy", + "id": 2 + }, + "offset": { + "type": "int64", + "id": 3 + }, + "limit": { + "type": "int64", + "id": 4 + }, + "metricAggregations": { + "rule": "repeated", + "type": "MetricAggregation", + "id": 5 + } + } + }, + "CohortSpec": { + "fields": { + "cohorts": { + "rule": "repeated", + "type": "Cohort", + "id": 1 + }, + "cohortsRange": { + "type": "CohortsRange", + "id": 2 + }, + "cohortReportSettings": { + "type": "CohortReportSettings", + "id": 3 + } + } + }, + "Cohort": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "dimension": { + "type": "string", + "id": 2 + }, + "dateRange": { + "type": "DateRange", + "id": 3 + } + } + }, + "CohortsRange": { + "fields": { + "granularity": { + "type": "Granularity", + "id": 1 + }, + "startOffset": { + "type": "int32", + "id": 2 + }, + "endOffset": { + "type": "int32", + "id": 3 + } + }, + "nested": { + "Granularity": { + "values": { + "GRANULARITY_UNSPECIFIED": 0, + "DAILY": 1, + "WEEKLY": 2, + "MONTHLY": 3 + } + } + } + }, + "CohortReportSettings": { + "fields": { + "accumulate": { + "type": "bool", + "id": 1 + } + } + }, + "ResponseMetaData": { + "oneofs": { + "_schemaRestrictionResponse": { + "oneof": [ + "schemaRestrictionResponse" + ] + }, + "_currencyCode": { + "oneof": [ + "currencyCode" + ] + }, + "_timeZone": { + "oneof": [ + "timeZone" + ] + }, + "_emptyReason": { + "oneof": [ + "emptyReason" + ] + }, + "_subjectToThresholding": { + "oneof": [ + "subjectToThresholding" + ] + } + }, + "fields": { + "dataLossFromOtherRow": { + "type": "bool", + "id": 3 + }, + "schemaRestrictionResponse": { + "type": "SchemaRestrictionResponse", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "currencyCode": { + "type": "string", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "timeZone": { + "type": "string", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "emptyReason": { + "type": "string", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "subjectToThresholding": { + "type": "bool", + "id": 8, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "SchemaRestrictionResponse": { + "fields": { + "activeMetricRestrictions": { + "rule": "repeated", + "type": "ActiveMetricRestriction", + "id": 1 + } + }, + "nested": { + "ActiveMetricRestriction": { + "oneofs": { + "_metricName": { + "oneof": [ + "metricName" + ] + } + }, + "fields": { + "metricName": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "restrictedMetricTypes": { + "rule": "repeated", + "type": "RestrictedMetricType", + "id": 2 + } + } + } + } + } + } + }, + "DimensionHeader": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "MetricHeader": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "MetricType", + "id": 2 + } + } + }, + "PivotHeader": { + "fields": { + "pivotDimensionHeaders": { + "rule": "repeated", + "type": "PivotDimensionHeader", + "id": 1 + }, + "rowCount": { + "type": "int32", + "id": 2 + } + } + }, + "PivotDimensionHeader": { + "fields": { + "dimensionValues": { + "rule": "repeated", + "type": "DimensionValue", + "id": 1 + } + } + }, + "Row": { + "fields": { + "dimensionValues": { + "rule": "repeated", + "type": "DimensionValue", + "id": 1 + }, + "metricValues": { + "rule": "repeated", + "type": "MetricValue", + "id": 2 + } + } + }, + "DimensionValue": { + "oneofs": { + "oneValue": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "MetricValue": { + "oneofs": { + "oneValue": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "value": { + "type": "string", + "id": 4 + } + } + }, + "NumericValue": { + "oneofs": { + "oneValue": { + "oneof": [ + "int64Value", + "doubleValue" + ] + } + }, + "fields": { + "int64Value": { + "type": "int64", + "id": 1 + }, + "doubleValue": { + "type": "double", + "id": 2 + } + } + }, + "PropertyQuota": { + "fields": { + "tokensPerDay": { + "type": "QuotaStatus", + "id": 1 + }, + "tokensPerHour": { + "type": "QuotaStatus", + "id": 2 + }, + "concurrentRequests": { + "type": "QuotaStatus", + "id": 3 + }, + "serverErrorsPerProjectPerHour": { + "type": "QuotaStatus", + "id": 4 + }, + "potentiallyThresholdedRequestsPerHour": { + "type": "QuotaStatus", + "id": 5 + }, + "tokensPerProjectPerHour": { + "type": "QuotaStatus", + "id": 6 + } + } + }, + "QuotaStatus": { + "fields": { + "consumed": { + "type": "int32", + "id": 1 + }, + "remaining": { + "type": "int32", + "id": 2 + } + } + }, + "DimensionMetadata": { + "fields": { + "apiName": { + "type": "string", + "id": 1 + }, + "uiName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "deprecatedApiNames": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "customDefinition": { + "type": "bool", + "id": 5 + }, + "category": { + "type": "string", + "id": 7 + } + } + }, + "MetricMetadata": { + "fields": { + "apiName": { + "type": "string", + "id": 1 + }, + "uiName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "deprecatedApiNames": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "type": { + "type": "MetricType", + "id": 5 + }, + "expression": { + "type": "string", + "id": 6 + }, + "customDefinition": { + "type": "bool", + "id": 7 + }, + "blockedReasons": { + "rule": "repeated", + "type": "BlockedReason", + "id": 8 + }, + "category": { + "type": "string", + "id": 10 + } + }, + "nested": { + "BlockedReason": { + "values": { + "BLOCKED_REASON_UNSPECIFIED": 0, + "NO_REVENUE_METRICS": 1, + "NO_COST_METRICS": 2 + } + } + } + }, + "DimensionCompatibility": { + "oneofs": { + "_dimensionMetadata": { + "oneof": [ + "dimensionMetadata" + ] + }, + "_compatibility": { + "oneof": [ + "compatibility" + ] + } + }, + "fields": { + "dimensionMetadata": { + "type": "DimensionMetadata", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "compatibility": { + "type": "Compatibility", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "MetricCompatibility": { + "oneofs": { + "_metricMetadata": { + "oneof": [ + "metricMetadata" + ] + }, + "_compatibility": { + "oneof": [ + "compatibility" + ] + } + }, + "fields": { + "metricMetadata": { + "type": "MetricMetadata", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "compatibility": { + "type": "Compatibility", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "MetricAggregation": { + "values": { + "METRIC_AGGREGATION_UNSPECIFIED": 0, + "TOTAL": 1, + "MINIMUM": 5, + "MAXIMUM": 6, + "COUNT": 4 + } + }, + "MetricType": { + "values": { + "METRIC_TYPE_UNSPECIFIED": 0, + "TYPE_INTEGER": 1, + "TYPE_FLOAT": 2, + "TYPE_SECONDS": 4, + "TYPE_MILLISECONDS": 5, + "TYPE_MINUTES": 6, + "TYPE_HOURS": 7, + "TYPE_STANDARD": 8, + "TYPE_CURRENCY": 9, + "TYPE_FEET": 10, + "TYPE_MILES": 11, + "TYPE_METERS": 12, + "TYPE_KILOMETERS": 13 + } + }, + "RestrictedMetricType": { + "values": { + "RESTRICTED_METRIC_TYPE_UNSPECIFIED": 0, + "COST_DATA": 1, + "REVENUE_DATA": 2 + } + }, + "Compatibility": { + "values": { + "COMPATIBILITY_UNSPECIFIED": 0, + "COMPATIBLE": 1, + "INCOMPATIBLE": 2 + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-analytics-data/samples/README.md b/packages/google-analytics-data/samples/README.md new file mode 100644 index 00000000000..297748a7b7b --- /dev/null +++ b/packages/google-analytics-data/samples/README.md @@ -0,0 +1,482 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Analytics Data: Node.js Samples](https://github.com/googleapis/nodejs-analytics-data) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Get Common Metadata](#get-common-metadata) + * [Get Metadata By Property Id](#get-metadata-by-property-id) + * [Quickstart](#quickstart) + * [Quickstart_json_credentials](#quickstart_json_credentials) + * [Quickstart_oauth2](#quickstart_oauth2) + * [Run Batch Report](#run-batch-report) + * [Run Pivot Report](#run-pivot-report) + * [Run Realtime Report](#run-realtime-report) + * [Run Realtime Report With Multiple Dimensions](#run-realtime-report-with-multiple-dimensions) + * [Run Realtime Report With Multiple Metrics](#run-realtime-report-with-multiple-metrics) + * [Run Report](#run-report) + * [Run Report With Aggregations](#run-report-with-aggregations) + * [Run Report With Cohorts](#run-report-with-cohorts) + * [Run Report With Date Ranges](#run-report-with-date-ranges) + * [Run Report With Dimension And Metric Filters](#run-report-with-dimension-and-metric-filters) + * [Run Report With Dimension Exclude Filter](#run-report-with-dimension-exclude-filter) + * [Run Report With Dimension Filter](#run-report-with-dimension-filter) + * [Run Report With Dimension In List Filter](#run-report-with-dimension-in-list-filter) + * [Run Report With Multiple Dimension Filters](#run-report-with-multiple-dimension-filters) + * [Run Report With Multiple Dimensions](#run-report-with-multiple-dimensions) + * [Run Report With Multiple Metrics](#run-report-with-multiple-metrics) + * [Run Report With Named Date Ranges](#run-report-with-named-date-ranges) + * [Run Report With Ordering](#run-report-with-ordering) + * [Run Report With Pagination](#run-report-with-pagination) + * [Run Report With Property Quota](#run-report-with-property-quota) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-analytics-data#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Get Common Metadata + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/getCommonMetadata.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/getCommonMetadata.js,samples/README.md) + +__Usage:__ + + +`node samples/getCommonMetadata.js` + + +----- + + + + +### Get Metadata By Property Id + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/getMetadataByPropertyId.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/getMetadataByPropertyId.js,samples/README.md) + +__Usage:__ + + +`node samples/getMetadataByPropertyId.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart.js` + + +----- + + + + +### Quickstart_json_credentials + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/quickstart_json_credentials.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/quickstart_json_credentials.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart_json_credentials.js` + + +----- + + + + +### Quickstart_oauth2 + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/quickstart_oauth2.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/quickstart_oauth2.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart_oauth2.js` + + +----- + + + + +### Run Batch Report + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runBatchReport.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runBatchReport.js,samples/README.md) + +__Usage:__ + + +`node samples/runBatchReport.js` + + +----- + + + + +### Run Pivot Report + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runPivotReport.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runPivotReport.js,samples/README.md) + +__Usage:__ + + +`node samples/runPivotReport.js` + + +----- + + + + +### Run Realtime Report + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runRealtimeReport.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runRealtimeReport.js,samples/README.md) + +__Usage:__ + + +`node samples/runRealtimeReport.js` + + +----- + + + + +### Run Realtime Report With Multiple Dimensions + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runRealtimeReportWithMultipleDimensions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runRealtimeReportWithMultipleDimensions.js,samples/README.md) + +__Usage:__ + + +`node samples/runRealtimeReportWithMultipleDimensions.js` + + +----- + + + + +### Run Realtime Report With Multiple Metrics + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runRealtimeReportWithMultipleMetrics.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runRealtimeReportWithMultipleMetrics.js,samples/README.md) + +__Usage:__ + + +`node samples/runRealtimeReportWithMultipleMetrics.js` + + +----- + + + + +### Run Report + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReport.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReport.js,samples/README.md) + +__Usage:__ + + +`node samples/runReport.js` + + +----- + + + + +### Run Report With Aggregations + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithAggregations.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithAggregations.js,samples/README.md) + +__Usage:__ + + +`node samples/runReportWithAggregations.js` + + +----- + + + + +### Run Report With Cohorts + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithCohorts.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithCohorts.js,samples/README.md) + +__Usage:__ + + +`node samples/runReportWithCohorts.js` + + +----- + + + + +### Run Report With Date Ranges + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithDateRanges.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithDateRanges.js,samples/README.md) + +__Usage:__ + + +`node samples/runReportWithDateRanges.js` + + +----- + + + + +### Run Report With Dimension And Metric Filters + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithDimensionAndMetricFilters.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithDimensionAndMetricFilters.js,samples/README.md) + +__Usage:__ + + +`node samples/runReportWithDimensionAndMetricFilters.js` + + +----- + + + + +### Run Report With Dimension Exclude Filter + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithDimensionExcludeFilter.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithDimensionExcludeFilter.js,samples/README.md) + +__Usage:__ + + +`node samples/runReportWithDimensionExcludeFilter.js` + + +----- + + + + +### Run Report With Dimension Filter + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithDimensionFilter.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithDimensionFilter.js,samples/README.md) + +__Usage:__ + + +`node samples/runReportWithDimensionFilter.js` + + +----- + + + + +### Run Report With Dimension In List Filter + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithDimensionInListFilter.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithDimensionInListFilter.js,samples/README.md) + +__Usage:__ + + +`node samples/runReportWithDimensionInListFilter.js` + + +----- + + + + +### Run Report With Multiple Dimension Filters + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithMultipleDimensionFilters.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithMultipleDimensionFilters.js,samples/README.md) + +__Usage:__ + + +`node samples/runReportWithMultipleDimensionFilters.js` + + +----- + + + + +### Run Report With Multiple Dimensions + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithMultipleDimensions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithMultipleDimensions.js,samples/README.md) + +__Usage:__ + + +`node samples/runReportWithMultipleDimensions.js` + + +----- + + + + +### Run Report With Multiple Metrics + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithMultipleMetrics.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithMultipleMetrics.js,samples/README.md) + +__Usage:__ + + +`node samples/runReportWithMultipleMetrics.js` + + +----- + + + + +### Run Report With Named Date Ranges + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithNamedDateRanges.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithNamedDateRanges.js,samples/README.md) + +__Usage:__ + + +`node samples/runReportWithNamedDateRanges.js` + + +----- + + + + +### Run Report With Ordering + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithOrdering.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithOrdering.js,samples/README.md) + +__Usage:__ + + +`node samples/runReportWithOrdering.js` + + +----- + + + + +### Run Report With Pagination + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithPagination.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithPagination.js,samples/README.md) + +__Usage:__ + + +`node samples/runReportWithPagination.js` + + +----- + + + + +### Run Report With Property Quota + +View the [source code](https://github.com/googleapis/nodejs-analytics-data/blob/main/samples/runReportWithPropertyQuota.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/runReportWithPropertyQuota.js,samples/README.md) + +__Usage:__ + + +`node samples/runReportWithPropertyQuota.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-analytics-data&page=editor&open_in_editor=samples/README.md +[product-docs]: https://developers.google.com/analytics/trusted-testing/analytics-data diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js new file mode 100644 index 00000000000..8e6c3211a61 --- /dev/null +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js @@ -0,0 +1,131 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see where to + * find your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Within a batch request, this property should either be unspecified or + * consistent with the batch-level property. + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * Date ranges of data to read. If multiple date ranges are requested, each + * response row will contain a zero based date range index. If two date + * ranges overlap, the event data for the overlapping days is included in the + * response rows for both date ranges. + */ + // const dateRanges = 1234 + /** + * The configuration of this request's funnel. This funnel configuration is + * required. + */ + // const funnel = {} + /** + * If specified, this breakdown adds a dimension to the funnel table sub + * report response. This breakdown dimension expands each funnel step to the + * unique values of the breakdown dimension. For example, a breakdown by the + * `deviceCategory` dimension will create rows for `mobile`, `tablet`, + * `desktop`, and the total. + */ + // const funnelBreakdown = {} + /** + * If specified, next action adds a dimension to the funnel visualization sub + * report response. This next action dimension expands each funnel step to the + * unique values of the next action. For example a next action of the + * `eventName` dimension will create rows for several events (i.e. + * `session_start` & `click`) and the total. + * Next action only supports `eventName` and most Page / Screen dimensions + * like `pageTitle` and `pagePath`. + */ + // const funnelNextAction = {} + /** + * The funnel visualization type controls the dimensions present in the funnel + * visualization sub report response. If not specified, `STANDARD_FUNNEL` is + * used. + */ + // const funnelVisualizationType = {} + /** + * The configurations of segments. Segments are subsets of a property's data. + * In a funnel report with segments, the funnel is evaluated in each segment. + * Each segment specified in this request + * produces a separate row in the response; in the response, each segment + * identified by its name. + * The segments parameter is optional. Requests are limited to 4 segments. + */ + // const segments = 1234 + /** + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. + */ + // const limit = 1234 + /** + * Dimension filters allow you to ask for only specific dimension values in + * the report. To learn more, see Creating a Report: Dimension + * Filters (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + */ + // const dimensionFilter = {} + /** + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in PropertyQuota (#PropertyQuota). + */ + // const returnPropertyQuota = true + + // Imports the Data library + const {AlphaAnalyticsDataClient} = require('@google-cloud/data').v1alpha; + + // Instantiates a client + const dataClient = new AlphaAnalyticsDataClient(); + + async function callRunFunnelReport() { + // Construct request + const request = { + }; + + // Run request + const response = await dataClient.runFunnelReport(request); + console.log(response); + } + + callRunFunnelReport(); + // [END analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-analytics-data/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json b/packages/google-analytics-data/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json new file mode 100644 index 00000000000..62ff08d4cb8 --- /dev/null +++ b/packages/google-analytics-data/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json @@ -0,0 +1,91 @@ +{ + "clientLibrary": { + "name": "nodejs-data", + "version": "3.1.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.analytics.data.v1alpha", + "version": "v1alpha" + } + ] + }, + "snippets": [ + { + "regionTag": "analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async", + "title": "AlphaAnalyticsData runFunnelReport Sample", + "origin": "API_DEFINITION", + "description": " Returns a customized funnel report of your Google Analytics event data. The data returned from the API is as a table with columns for the requested dimensions and metrics. Funnel exploration lets you visualize the steps your users take to complete a task and quickly see how well they are succeeding or failing at each step. For example, how do prospects become shoppers and then become buyers? How do one time buyers become repeat buyers? With this information, you can improve inefficient or abandoned customer journeys. To learn more, see [GA4 Funnel Explorations](https://support.google.com/analytics/answer/9327974).", + "canonical": true, + "file": "alpha_analytics_data.run_funnel_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 123, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunFunnelReport", + "fullName": "google.analytics.data.v1alpha.AlphaAnalyticsData.RunFunnelReport", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "date_ranges", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "funnel", + "type": ".google.analytics.data.v1alpha.Funnel" + }, + { + "name": "funnel_breakdown", + "type": ".google.analytics.data.v1alpha.FunnelBreakdown" + }, + { + "name": "funnel_next_action", + "type": ".google.analytics.data.v1alpha.FunnelNextAction" + }, + { + "name": "funnel_visualization_type", + "type": ".google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType" + }, + { + "name": "segments", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "limit", + "type": "TYPE_INT64" + }, + { + "name": "dimension_filter", + "type": ".google.analytics.data.v1alpha.FilterExpression" + }, + { + "name": "return_property_quota", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.analytics.data.v1alpha.RunFunnelReportResponse", + "client": { + "shortName": "AlphaAnalyticsDataClient", + "fullName": "google.analytics.data.v1alpha.AlphaAnalyticsDataClient" + }, + "method": { + "shortName": "RunFunnelReport", + "fullName": "google.analytics.data.v1alpha.AlphaAnalyticsData.RunFunnelReport", + "service": { + "shortName": "AlphaAnalyticsData", + "fullName": "google.analytics.data.v1alpha.AlphaAnalyticsData" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js new file mode 100644 index 00000000000..95e7c729c72 --- /dev/null +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js @@ -0,0 +1,72 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunPivotReports_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see where to + * find your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * This property must be specified for the batch. The property within + * RunPivotReportRequest may either be unspecified or consistent with this + * property. + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * Individual requests. Each request has a separate pivot report response. + * Each batch request is allowed up to 5 requests. + */ + // const requests = 1234 + + // Imports the Data library + const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; + + // Instantiates a client + const dataClient = new BetaAnalyticsDataClient(); + + async function callBatchRunPivotReports() { + // Construct request + const request = { + }; + + // Run request + const response = await dataClient.batchRunPivotReports(request); + console.log(response); + } + + callBatchRunPivotReports(); + // [END analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunPivotReports_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js new file mode 100644 index 00000000000..7d36a526394 --- /dev/null +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js @@ -0,0 +1,72 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunReports_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see where to + * find your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * This property must be specified for the batch. The property within + * RunReportRequest may either be unspecified or consistent with this + * property. + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * Individual requests. Each request has a separate report response. Each + * batch request is allowed up to 5 requests. + */ + // const requests = 1234 + + // Imports the Data library + const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; + + // Instantiates a client + const dataClient = new BetaAnalyticsDataClient(); + + async function callBatchRunReports() { + // Construct request + const request = { + }; + + // Run request + const response = await dataClient.batchRunReports(request); + console.log(response); + } + + callBatchRunReports(); + // [END analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunReports_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.check_compatibility.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.check_compatibility.js new file mode 100644 index 00000000000..e68ac01938a --- /dev/null +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.check_compatibility.js @@ -0,0 +1,93 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START analyticsdata_v1beta_generated_BetaAnalyticsData_CheckCompatibility_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A Google Analytics GA4 property identifier whose events are tracked. To + * learn more, see where to find your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * `property` should be the same value as in your `runReport` request. + * Example: properties/1234 + * Set the Property ID to 0 for compatibility checking on dimensions and + * metrics common to all properties. In this special mode, this method will + * not return custom dimensions and metrics. + */ + // const property = 'abc123' + /** + * The dimensions in this report. `dimensions` should be the same value as in + * your `runReport` request. + */ + // const dimensions = 1234 + /** + * The metrics in this report. `metrics` should be the same value as in your + * `runReport` request. + */ + // const metrics = 1234 + /** + * The filter clause of dimensions. `dimensionFilter` should be the same value + * as in your `runReport` request. + */ + // const dimensionFilter = {} + /** + * The filter clause of metrics. `metricFilter` should be the same value as in + * your `runReport` request + */ + // const metricFilter = {} + /** + * Filters the dimensions and metrics in the response to just this + * compatibility. Commonly used as `”compatibilityFilter”: “COMPATIBLE”` + * to only return compatible dimensions & metrics. + */ + // const compatibilityFilter = {} + + // Imports the Data library + const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; + + // Instantiates a client + const dataClient = new BetaAnalyticsDataClient(); + + async function callCheckCompatibility() { + // Construct request + const request = { + }; + + // Run request + const response = await dataClient.checkCompatibility(request); + console.log(response); + } + + callCheckCompatibility(); + // [END analyticsdata_v1beta_generated_BetaAnalyticsData_CheckCompatibility_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_metadata.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_metadata.js new file mode 100644 index 00000000000..df02f8f541d --- /dev/null +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_metadata.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START analyticsdata_v1beta_generated_BetaAnalyticsData_GetMetadata_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 metadata to retrieve. This name field is + * specified in the URL path and not URL parameters. Property is a numeric + * Google Analytics GA4 Property identifier. To learn more, see where to find + * your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Example: properties/1234/metadata + * Set the Property ID to 0 for dimensions and metrics common to all + * properties. In this special mode, this method will not return custom + * dimensions and metrics. + */ + // const name = 'abc123' + + // Imports the Data library + const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; + + // Instantiates a client + const dataClient = new BetaAnalyticsDataClient(); + + async function callGetMetadata() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataClient.getMetadata(request); + console.log(response); + } + + callGetMetadata(); + // [END analyticsdata_v1beta_generated_BetaAnalyticsData_GetMetadata_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js new file mode 100644 index 00000000000..b7e44c346db --- /dev/null +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js @@ -0,0 +1,124 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START analyticsdata_v1beta_generated_BetaAnalyticsData_RunPivotReport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see where to + * find your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Within a batch request, this property should either be unspecified or + * consistent with the batch-level property. + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * The dimensions requested. All defined dimensions must be used by one of the + * following: dimension_expression, dimension_filter, pivots, order_bys. + */ + // const dimensions = 1234 + /** + * The metrics requested, at least one metric needs to be specified. All + * defined metrics must be used by one of the following: metric_expression, + * metric_filter, order_bys. + */ + // const metrics = 1234 + /** + * The date range to retrieve event data for the report. If multiple date + * ranges are specified, event data from each date range is used in the + * report. A special dimension with field name "dateRange" can be included in + * a Pivot's field names; if included, the report compares between date + * ranges. In a cohort request, this `dateRanges` must be unspecified. + */ + // const dateRanges = 1234 + /** + * Describes the visual format of the report's dimensions in columns or rows. + * The union of the fieldNames (dimension names) in all pivots must be a + * subset of dimension names defined in Dimensions. No two pivots can share a + * dimension. A dimension is only visible if it appears in a pivot. + */ + // const pivots = 1234 + /** + * The filter clause of dimensions. Dimensions must be requested to be used in + * this filter. Metrics cannot be used in this filter. + */ + // const dimensionFilter = {} + /** + * The filter clause of metrics. Applied at post aggregation phase, similar to + * SQL having-clause. Metrics must be requested to be used in this filter. + * Dimensions cannot be used in this filter. + */ + // const metricFilter = {} + /** + * A currency code in ISO4217 format, such as "AED", "USD", "JPY". + * If the field is empty, the report uses the property's default currency. + */ + // const currencyCode = 'abc123' + /** + * Cohort group associated with this request. If there is a cohort group + * in the request the 'cohort' dimension must be present. + */ + // const cohortSpec = {} + /** + * If false or unspecified, each row with all metrics equal to 0 will not be + * returned. If true, these rows will be returned if they are not separately + * removed by a filter. + */ + // const keepEmptyRows = true + /** + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in PropertyQuota (#PropertyQuota). + */ + // const returnPropertyQuota = true + + // Imports the Data library + const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; + + // Instantiates a client + const dataClient = new BetaAnalyticsDataClient(); + + async function callRunPivotReport() { + // Construct request + const request = { + }; + + // Run request + const response = await dataClient.runPivotReport(request); + console.log(response); + } + + callRunPivotReport(); + // [END analyticsdata_v1beta_generated_BetaAnalyticsData_RunPivotReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js new file mode 100644 index 00000000000..a855f91a596 --- /dev/null +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js @@ -0,0 +1,114 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START analyticsdata_v1beta_generated_BetaAnalyticsData_RunRealtimeReport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see where to + * find your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * The dimensions requested and displayed. + */ + // const dimensions = 1234 + /** + * The metrics requested and displayed. + */ + // const metrics = 1234 + /** + * The filter clause of dimensions. Metrics cannot be used in this filter. + */ + // const dimensionFilter = {} + /** + * The filter clause of metrics. Applied at post aggregation phase, similar to + * SQL having-clause. Dimensions cannot be used in this filter. + */ + // const metricFilter = {} + /** + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. For instance, there are + * fewer than 300 possible values for the dimension `country`, so when + * reporting on only `country`, you can't get more than 300 rows, even if you + * set `limit` to a higher value. + */ + // const limit = 1234 + /** + * Aggregation of metrics. Aggregated metric values will be shown in rows + * where the dimension_values are set to "RESERVED_(MetricAggregation)". + */ + // const metricAggregations = 1234 + /** + * Specifies how rows are ordered in the response. + */ + // const orderBys = 1234 + /** + * Toggles whether to return the current state of this Analytics Property's + * Realtime quota. Quota is returned in PropertyQuota (#PropertyQuota). + */ + // const returnPropertyQuota = true + /** + * The minute ranges of event data to read. If unspecified, one minute range + * for the last 30 minutes will be used. If multiple minute ranges are + * requested, each response row will contain a zero based minute range index. + * If two minute ranges overlap, the event data for the overlapping minutes is + * included in the response rows for both minute ranges. + */ + // const minuteRanges = 1234 + + // Imports the Data library + const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; + + // Instantiates a client + const dataClient = new BetaAnalyticsDataClient(); + + async function callRunRealtimeReport() { + // Construct request + const request = { + }; + + // Run request + const response = await dataClient.runRealtimeReport(request); + console.log(response); + } + + callRunRealtimeReport(); + // [END analyticsdata_v1beta_generated_BetaAnalyticsData_RunRealtimeReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_report.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_report.js new file mode 100644 index 00000000000..552cc0593d2 --- /dev/null +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_report.js @@ -0,0 +1,147 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START analyticsdata_v1beta_generated_BetaAnalyticsData_RunReport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see where to + * find your Property + * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Within a batch request, this property should either be unspecified or + * consistent with the batch-level property. + * Example: properties/1234 + */ + // const property = 'abc123' + /** + * The dimensions requested and displayed. + */ + // const dimensions = 1234 + /** + * The metrics requested and displayed. + */ + // const metrics = 1234 + /** + * Date ranges of data to read. If multiple date ranges are requested, each + * response row will contain a zero based date range index. If two date + * ranges overlap, the event data for the overlapping days is included in the + * response rows for both date ranges. In a cohort request, this `dateRanges` + * must be unspecified. + */ + // const dateRanges = 1234 + /** + * Dimension filters allow you to ask for only specific dimension values in + * the report. To learn more, see Fundamentals of Dimension + * Filters (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + */ + // const dimensionFilter = {} + /** + * The filter clause of metrics. Applied 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. + * When paging, the first request does not specify offset; or equivalently, + * sets offset to 0; the first request returns the first `limit` of rows. The + * second request sets offset to the `limit` of the first request; the second + * request returns the second `limit` of rows. + * To learn more about this pagination parameter, see + * Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + */ + // const offset = 1234 + /** + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. For instance, there are + * fewer than 300 possible values for the dimension `country`, so when + * reporting on only `country`, you can't get more than 300 rows, even if you + * set `limit` to a higher value. + * To learn more about this pagination parameter, see + * Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + */ + // const limit = 1234 + /** + * Aggregation of metrics. Aggregated metric values will be shown in rows + * where the dimension_values are set to "RESERVED_(MetricAggregation)". + */ + // const metricAggregations = 1234 + /** + * Specifies how rows are ordered in the response. + */ + // const orderBys = 1234 + /** + * A currency code in ISO4217 format, such as "AED", "USD", "JPY". + * If the field is empty, the report uses the property's default currency. + */ + // const currencyCode = 'abc123' + /** + * Cohort group associated with this request. If there is a cohort group + * in the request the 'cohort' dimension must be present. + */ + // const cohortSpec = {} + /** + * If false or unspecified, each row with all metrics equal to 0 will not be + * returned. If true, these rows will be returned if they are not separately + * removed by a filter. + */ + // const keepEmptyRows = true + /** + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in PropertyQuota (#PropertyQuota). + */ + // const returnPropertyQuota = true + + // Imports the Data library + const {BetaAnalyticsDataClient} = require('@google-analytics/data').v1beta; + + // Instantiates a client + const dataClient = new BetaAnalyticsDataClient(); + + async function callRunReport() { + // Construct request + const request = { + }; + + // Run request + const response = await dataClient.runReport(request); + console.log(response); + } + + callRunReport(); + // [END analyticsdata_v1beta_generated_BetaAnalyticsData_RunReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json b/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json new file mode 100644 index 00000000000..f83cb86b1aa --- /dev/null +++ b/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json @@ -0,0 +1,451 @@ +{ + "clientLibrary": { + "name": "nodejs-data", + "version": "3.1.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.analytics.data.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_RunReport_async", + "title": "BetaAnalyticsData runReport Sample", + "origin": "API_DEFINITION", + "description": " Returns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. The data returned from the API is as a table with columns for the requested dimensions and metrics. Metrics are individual measurements of user activity on your property, such as active users or event count. Dimensions break down metrics across some common criteria, such as country or event name. For a guide to constructing requests & understanding responses, see [Creating a Report](https://developers.google.com/analytics/devguides/reporting/data/v1/basics).", + "canonical": true, + "file": "beta_analytics_data.run_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 139, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunReport", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunReport", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "dimensions", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "metrics", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "date_ranges", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "dimension_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "metric_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "offset", + "type": "TYPE_INT64" + }, + { + "name": "limit", + "type": "TYPE_INT64" + }, + { + "name": "metric_aggregations", + "type": "TYPE_ENUM[]" + }, + { + "name": "order_bys", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "currency_code", + "type": "TYPE_STRING" + }, + { + "name": "cohort_spec", + "type": ".google.analytics.data.v1beta.CohortSpec" + }, + { + "name": "keep_empty_rows", + "type": "TYPE_BOOL" + }, + { + "name": "return_property_quota", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.analytics.data.v1beta.RunReportResponse", + "client": { + "shortName": "BetaAnalyticsDataClient", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" + }, + "method": { + "shortName": "RunReport", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunReport", + "service": { + "shortName": "BetaAnalyticsData", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" + } + } + } + }, + { + "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_RunPivotReport_async", + "title": "BetaAnalyticsData runPivotReport Sample", + "origin": "API_DEFINITION", + "description": " Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.", + "canonical": true, + "file": "beta_analytics_data.run_pivot_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 116, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunPivotReport", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunPivotReport", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "dimensions", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "metrics", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "date_ranges", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "pivots", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "dimension_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "metric_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "currency_code", + "type": "TYPE_STRING" + }, + { + "name": "cohort_spec", + "type": ".google.analytics.data.v1beta.CohortSpec" + }, + { + "name": "keep_empty_rows", + "type": "TYPE_BOOL" + }, + { + "name": "return_property_quota", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.analytics.data.v1beta.RunPivotReportResponse", + "client": { + "shortName": "BetaAnalyticsDataClient", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" + }, + "method": { + "shortName": "RunPivotReport", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunPivotReport", + "service": { + "shortName": "BetaAnalyticsData", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" + } + } + } + }, + { + "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunReports_async", + "title": "BetaAnalyticsData batchRunReports Sample", + "origin": "API_DEFINITION", + "description": " Returns multiple reports in a batch. All reports must be for the same GA4 Property.", + "canonical": true, + "file": "beta_analytics_data.batch_run_reports.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchRunReports", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.BatchRunReports", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.analytics.data.v1beta.BatchRunReportsResponse", + "client": { + "shortName": "BetaAnalyticsDataClient", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" + }, + "method": { + "shortName": "BatchRunReports", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.BatchRunReports", + "service": { + "shortName": "BetaAnalyticsData", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" + } + } + } + }, + { + "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunPivotReports_async", + "title": "BetaAnalyticsData batchRunPivotReports Sample", + "origin": "API_DEFINITION", + "description": " Returns multiple pivot reports in a batch. All reports must be for the same GA4 Property.", + "canonical": true, + "file": "beta_analytics_data.batch_run_pivot_reports.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchRunPivotReports", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.BatchRunPivotReports", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.analytics.data.v1beta.BatchRunPivotReportsResponse", + "client": { + "shortName": "BetaAnalyticsDataClient", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" + }, + "method": { + "shortName": "BatchRunPivotReports", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.BatchRunPivotReports", + "service": { + "shortName": "BetaAnalyticsData", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" + } + } + } + }, + { + "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_GetMetadata_async", + "title": "BetaAnalyticsData getMetadata Sample", + "origin": "API_DEFINITION", + "description": " Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata. For example if a custom metric with parameter name `levels_unlocked` is registered to a property, the Metadata response will contain `customEvent:levels_unlocked`. Universal metadata are dimensions and metrics applicable to any property such as `country` and `totalUsers`.", + "canonical": true, + "file": "beta_analytics_data.get_metadata.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMetadata", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.GetMetadata", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.data.v1beta.Metadata", + "client": { + "shortName": "BetaAnalyticsDataClient", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" + }, + "method": { + "shortName": "GetMetadata", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.GetMetadata", + "service": { + "shortName": "BetaAnalyticsData", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" + } + } + } + }, + { + "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_RunRealtimeReport_async", + "title": "BetaAnalyticsData runRealtimeReport Sample", + "origin": "API_DEFINITION", + "description": " Returns a customized report of realtime event data for your property. Events appear in realtime reports seconds after they have been sent to the Google Analytics. Realtime reports show events and usage data for the periods of time ranging from the present moment to 30 minutes ago (up to 60 minutes for Google Analytics 360 properties). For a guide to constructing realtime requests & understanding responses, see [Creating a Realtime Report](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-basics).", + "canonical": true, + "file": "beta_analytics_data.run_realtime_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 106, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunRealtimeReport", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunRealtimeReport", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "dimensions", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "metrics", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "dimension_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "metric_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "limit", + "type": "TYPE_INT64" + }, + { + "name": "metric_aggregations", + "type": "TYPE_ENUM[]" + }, + { + "name": "order_bys", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "return_property_quota", + "type": "TYPE_BOOL" + }, + { + "name": "minute_ranges", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.analytics.data.v1beta.RunRealtimeReportResponse", + "client": { + "shortName": "BetaAnalyticsDataClient", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" + }, + "method": { + "shortName": "RunRealtimeReport", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.RunRealtimeReport", + "service": { + "shortName": "BetaAnalyticsData", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" + } + } + } + }, + { + "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_CheckCompatibility_async", + "title": "BetaAnalyticsData checkCompatibility Sample", + "origin": "API_DEFINITION", + "description": " This compatibility method lists dimensions and metrics that can be added to a report request and maintain compatibility. This method fails if the request's dimensions and metrics are incompatible. In Google Analytics, reports fail if they request incompatible dimensions and/or metrics; in that case, you will need to remove dimensions and/or metrics from the incompatible report until the report is compatible. The Realtime and Core reports have different compatibility rules. This method checks compatibility for Core reports.", + "canonical": true, + "file": "beta_analytics_data.check_compatibility.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CheckCompatibility", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.CheckCompatibility", + "async": true, + "parameters": [ + { + "name": "property", + "type": "TYPE_STRING" + }, + { + "name": "dimensions", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "metrics", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "dimension_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "metric_filter", + "type": ".google.analytics.data.v1beta.FilterExpression" + }, + { + "name": "compatibility_filter", + "type": ".google.analytics.data.v1beta.Compatibility" + } + ], + "resultType": ".google.analytics.data.v1beta.CheckCompatibilityResponse", + "client": { + "shortName": "BetaAnalyticsDataClient", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsDataClient" + }, + "method": { + "shortName": "CheckCompatibility", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData.CheckCompatibility", + "service": { + "shortName": "BetaAnalyticsData", + "fullName": "google.analytics.data.v1beta.BetaAnalyticsData" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-analytics-data/samples/package.json b/packages/google-analytics-data/samples/package.json new file mode 100644 index 00000000000..1477917da59 --- /dev/null +++ b/packages/google-analytics-data/samples/package.json @@ -0,0 +1,30 @@ +{ + "name": "nodejs-analytics-data", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-analytics/data": "^3.1.1", + "google-auth-library": "^7.0.0", + "google-gax": "^2.10.0", + "http": "^0.0.1-security", + "lint": "^0.7.0", + "open": "^8.0.0", + "server-destroy": "^1.0.1", + "url": "^0.11.0" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-analytics-data/samples/quickstart.js b/packages/google-analytics-data/samples/quickstart.js new file mode 100644 index 00000000000..f91f94d0380 --- /dev/null +++ b/packages/google-analytics-data/samples/quickstart.js @@ -0,0 +1,86 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +/** Google Analytics Data API sample quickstart application. + This application demonstrates the usage of the Analytics Data API using + service account credentials. + + Before you start the application, please review the comments starting with + "TODO(developer)" and update the code to use correct values. + + Usage: + npm install + node quickstart.js + */ + +function main(propertyId = 'YOUR-GA4-PROPERTY-ID') { + // [START analyticsdata_quickstart] + /** + * TODO(developer): Uncomment this variable and replace with your + * Google Analytics 4 property ID before running the sample. + */ + // propertyId = 'YOUR-GA4-PROPERTY-ID'; + + // [START analyticsdata_run_report_initialize] + // Imports the Google Analytics Data API client library. + const {BetaAnalyticsDataClient} = require('@google-analytics/data'); + + // Using a default constructor instructs the client to use the credentials + // specified in GOOGLE_APPLICATION_CREDENTIALS environment variable. + const analyticsDataClient = new BetaAnalyticsDataClient(); + // [END analyticsdata_run_report_initialize] + + // Runs a simple report. + async function runReport() { + // [START analyticsdata_run_report] + const [response] = await analyticsDataClient.runReport({ + property: `properties/${propertyId}`, + dateRanges: [ + { + startDate: '2020-03-31', + endDate: 'today', + }, + ], + dimensions: [ + { + name: 'city', + }, + ], + metrics: [ + { + name: 'activeUsers', + }, + ], + }); + // [END analyticsdata_run_report] + + // [START analyticsdata_run_report_response] + console.log('Report result:'); + response.rows.forEach(row => { + console.log(row.dimensionValues[0], row.metricValues[0]); + }); + // [END analyticsdata_run_report_response] + } + + runReport(); + // [END analyticsdata_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-analytics-data/samples/test/quickstart.test.js b/packages/google-analytics-data/samples/test/quickstart.test.js new file mode 100644 index 00000000000..08601da6ebc --- /dev/null +++ b/packages/google-analytics-data/samples/test/quickstart.test.js @@ -0,0 +1,34 @@ +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +const cp = require('child_process'); +const {assert} = require('chai'); +const {describe, it} = require('mocha'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const GA4_PROPERTY_ID = process.env.GA4_PROPERTY_ID || '222596558'; + +describe('Quickstart', () => { + it('should run quickstart', async () => { + // eslint-disable-next-line no-unused-vars + const stdout = execSync(`node ./quickstart.js ${GA4_PROPERTY_ID}`); + assert.match(stdout, /Report result/); + }); +}); diff --git a/packages/google-analytics-data/src/index.ts b/packages/google-analytics-data/src/index.ts new file mode 100644 index 00000000000..dcd367aaffc --- /dev/null +++ b/packages/google-analytics-data/src/index.ts @@ -0,0 +1,28 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1alpha from './v1alpha'; +import * as v1beta from './v1beta'; + +const BetaAnalyticsDataClient = v1beta.BetaAnalyticsDataClient; +type BetaAnalyticsDataClient = v1beta.BetaAnalyticsDataClient; + +export {v1alpha, v1beta, BetaAnalyticsDataClient}; +export default {v1alpha, v1beta, BetaAnalyticsDataClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-analytics-data/src/v1alpha/alpha_analytics_data_client.ts b/packages/google-analytics-data/src/v1alpha/alpha_analytics_data_client.ts new file mode 100644 index 00000000000..a7f8bee0e87 --- /dev/null +++ b/packages/google-analytics-data/src/v1alpha/alpha_analytics_data_client.ts @@ -0,0 +1,481 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/alpha_analytics_data_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './alpha_analytics_data_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Google Analytics reporting data service. + * @class + * @memberof v1alpha + */ +export class AlphaAnalyticsDataClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + alphaAnalyticsDataStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AlphaAnalyticsDataClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/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 AlphaAnalyticsDataClient({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 AlphaAnalyticsDataClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // 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); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.analytics.data.v1alpha.AlphaAnalyticsData', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = 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.alphaAnalyticsDataStub) { + return this.alphaAnalyticsDataStub; + } + + // Put together the "service stub" for + // google.analytics.data.v1alpha.AlphaAnalyticsData. + this.alphaAnalyticsDataStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.analytics.data.v1alpha.AlphaAnalyticsData' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.analytics.data.v1alpha + .AlphaAnalyticsData, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const alphaAnalyticsDataStubMethods = ['runFunnelReport']; + for (const methodName of alphaAnalyticsDataStubMethods) { + const callPromise = this.alphaAnalyticsDataStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.alphaAnalyticsDataStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'analyticsdata.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'analyticsdata.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/analytics', + 'https://www.googleapis.com/auth/analytics.readonly', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Returns a customized funnel report of your Google Analytics event data. The + * data returned from the API is as a table with columns for the requested + * dimensions and metrics. + * + * Funnel exploration lets you visualize the steps your users take to complete + * a task and quickly see how well they are succeeding or failing at each + * step. For example, how do prospects become shoppers and then become buyers? + * How do one time buyers become repeat buyers? With this information, you can + * improve inefficient or abandoned customer journeys. To learn more, see [GA4 + * Funnel Explorations](https://support.google.com/analytics/answer/9327974). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see [where to + * find your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Within a batch request, this property should either be unspecified or + * consistent with the batch-level property. + * + * Example: properties/1234 + * @param {number[]} request.dateRanges + * Date ranges of data to read. If multiple date ranges are requested, each + * response row will contain a zero based date range index. If two date + * ranges overlap, the event data for the overlapping days is included in the + * response rows for both date ranges. + * @param {google.analytics.data.v1alpha.Funnel} request.funnel + * The configuration of this request's funnel. This funnel configuration is + * required. + * @param {google.analytics.data.v1alpha.FunnelBreakdown} request.funnelBreakdown + * If specified, this breakdown adds a dimension to the funnel table sub + * report response. This breakdown dimension expands each funnel step to the + * unique values of the breakdown dimension. For example, a breakdown by the + * `deviceCategory` dimension will create rows for `mobile`, `tablet`, + * `desktop`, and the total. + * @param {google.analytics.data.v1alpha.FunnelNextAction} request.funnelNextAction + * If specified, next action adds a dimension to the funnel visualization sub + * report response. This next action dimension expands each funnel step to the + * unique values of the next action. For example a next action of the + * `eventName` dimension will create rows for several events (i.e. + * `session_start` & `click`) and the total. + * + * Next action only supports `eventName` and most Page / Screen dimensions + * like `pageTitle` and `pagePath`. + * @param {google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType} request.funnelVisualizationType + * The funnel visualization type controls the dimensions present in the funnel + * visualization sub report response. If not specified, `STANDARD_FUNNEL` is + * used. + * @param {number[]} request.segments + * The configurations of segments. Segments are subsets of a property's data. + * In a funnel report with segments, the funnel is evaluated in each segment. + * + * Each segment specified in this request + * produces a separate row in the response; in the response, each segment + * identified by its name. + * + * The segments parameter is optional. Requests are limited to 4 segments. + * @param {number} request.limit + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. + * @param {google.analytics.data.v1alpha.FilterExpression} request.dimensionFilter + * Dimension filters allow you to ask for only specific dimension values in + * the report. To learn more, see [Creating a Report: Dimension + * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + * @param {boolean} request.returnPropertyQuota + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in [PropertyQuota](#PropertyQuota). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RunFunnelReportResponse]{@link google.analytics.data.v1alpha.RunFunnelReportResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js + * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async + */ + runFunnelReport( + request?: protos.google.analytics.data.v1alpha.IRunFunnelReportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, + protos.google.analytics.data.v1alpha.IRunFunnelReportRequest | undefined, + {} | undefined + ] + >; + runFunnelReport( + request: protos.google.analytics.data.v1alpha.IRunFunnelReportRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, + | protos.google.analytics.data.v1alpha.IRunFunnelReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + runFunnelReport( + request: protos.google.analytics.data.v1alpha.IRunFunnelReportRequest, + callback: Callback< + protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, + | protos.google.analytics.data.v1alpha.IRunFunnelReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + runFunnelReport( + request?: protos.google.analytics.data.v1alpha.IRunFunnelReportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, + | protos.google.analytics.data.v1alpha.IRunFunnelReportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, + | protos.google.analytics.data.v1alpha.IRunFunnelReportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, + protos.google.analytics.data.v1alpha.IRunFunnelReportRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + property: request.property ?? '', + }); + this.initialize(); + return this.innerApiCalls.runFunnelReport(request, options, callback); + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.alphaAnalyticsDataStub && !this._terminated) { + return this.alphaAnalyticsDataStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-analytics-data/src/v1alpha/alpha_analytics_data_client_config.json b/packages/google-analytics-data/src/v1alpha/alpha_analytics_data_client_config.json new file mode 100644 index 00000000000..89acd1c2581 --- /dev/null +++ b/packages/google-analytics-data/src/v1alpha/alpha_analytics_data_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.analytics.data.v1alpha.AlphaAnalyticsData": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "RunFunnelReport": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-analytics-data/src/v1alpha/alpha_analytics_data_proto_list.json b/packages/google-analytics-data/src/v1alpha/alpha_analytics_data_proto_list.json new file mode 100644 index 00000000000..5047e31ed5c --- /dev/null +++ b/packages/google-analytics-data/src/v1alpha/alpha_analytics_data_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/analytics/data/v1alpha/analytics_data_api.proto", + "../../protos/google/analytics/data/v1alpha/data.proto" +] diff --git a/packages/google-analytics-data/src/v1alpha/gapic_metadata.json b/packages/google-analytics-data/src/v1alpha/gapic_metadata.json new file mode 100644 index 00000000000..d96e93cb5d4 --- /dev/null +++ b/packages/google-analytics-data/src/v1alpha/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.analytics.data.v1alpha", + "libraryPackage": "@google-cloud/data", + "services": { + "AlphaAnalyticsData": { + "clients": { + "grpc": { + "libraryClient": "AlphaAnalyticsDataClient", + "rpcs": { + "RunFunnelReport": { + "methods": [ + "runFunnelReport" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AlphaAnalyticsDataClient", + "rpcs": { + "RunFunnelReport": { + "methods": [ + "runFunnelReport" + ] + } + } + } + } + } + } +} diff --git a/packages/google-analytics-data/src/v1alpha/index.ts b/packages/google-analytics-data/src/v1alpha/index.ts new file mode 100644 index 00000000000..9adb2d5219e --- /dev/null +++ b/packages/google-analytics-data/src/v1alpha/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {AlphaAnalyticsDataClient} from './alpha_analytics_data_client'; diff --git a/packages/google-analytics-data/src/v1beta/beta_analytics_data_client.ts b/packages/google-analytics-data/src/v1beta/beta_analytics_data_client.ts new file mode 100644 index 00000000000..3b1ae2bb756 --- /dev/null +++ b/packages/google-analytics-data/src/v1beta/beta_analytics_data_client.ts @@ -0,0 +1,1258 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta/beta_analytics_data_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './beta_analytics_data_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Google Analytics reporting data service. + * @class + * @memberof v1beta + */ +export class BetaAnalyticsDataClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + betaAnalyticsDataStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BetaAnalyticsDataClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/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 BetaAnalyticsDataClient({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 BetaAnalyticsDataClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // 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 = { + metadataPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/metadata' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.analytics.data.v1beta.BetaAnalyticsData', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = 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.betaAnalyticsDataStub) { + return this.betaAnalyticsDataStub; + } + + // Put together the "service stub" for + // google.analytics.data.v1beta.BetaAnalyticsData. + this.betaAnalyticsDataStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.analytics.data.v1beta.BetaAnalyticsData' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.analytics.data.v1beta.BetaAnalyticsData, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const betaAnalyticsDataStubMethods = [ + 'runReport', + 'runPivotReport', + 'batchRunReports', + 'batchRunPivotReports', + 'getMetadata', + 'runRealtimeReport', + 'checkCompatibility', + ]; + for (const methodName of betaAnalyticsDataStubMethods) { + const callPromise = this.betaAnalyticsDataStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.betaAnalyticsDataStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'analyticsdata.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'analyticsdata.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/analytics', + 'https://www.googleapis.com/auth/analytics.readonly', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Returns a customized report of your Google Analytics event data. Reports + * contain statistics derived from data collected by the Google Analytics + * tracking code. The data returned from the API is as a table with columns + * for the requested dimensions and metrics. Metrics are individual + * measurements of user activity on your property, such as active users or + * event count. Dimensions break down metrics across some common criteria, + * such as country or event name. + * + * For a guide to constructing requests & understanding responses, see + * [Creating a + * Report](https://developers.google.com/analytics/devguides/reporting/data/v1/basics). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see [where to + * find your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Within a batch request, this property should either be unspecified or + * consistent with the batch-level property. + * + * Example: properties/1234 + * @param {number[]} request.dimensions + * The dimensions requested and displayed. + * @param {number[]} request.metrics + * The metrics requested and displayed. + * @param {number[]} request.dateRanges + * Date ranges of data to read. If multiple date ranges are requested, each + * response row will contain a zero based date range index. If two date + * ranges overlap, the event data for the overlapping days is included in the + * response rows for both date ranges. In a cohort request, this `dateRanges` + * must be unspecified. + * @param {google.analytics.data.v1beta.FilterExpression} request.dimensionFilter + * Dimension filters allow you to ask for only specific dimension values in + * the report. To learn more, see [Fundamentals of Dimension + * Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) + * for examples. Metrics cannot be used in this filter. + * @param {google.analytics.data.v1beta.FilterExpression} request.metricFilter + * The filter clause of metrics. Applied 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. + * + * When paging, the first request does not specify offset; or equivalently, + * sets offset to 0; the first request returns the first `limit` of rows. The + * second request sets offset to the `limit` of the first request; the second + * request returns the second `limit` of rows. + * + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * @param {number} request.limit + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. For instance, there are + * fewer than 300 possible values for the dimension `country`, so when + * reporting on only `country`, you can't get more than 300 rows, even if you + * set `limit` to a higher value. + * + * To learn more about this pagination parameter, see + * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + * @param {number[]} request.metricAggregations + * Aggregation of metrics. Aggregated metric values will be shown in rows + * where the dimension_values are set to "RESERVED_(MetricAggregation)". + * @param {number[]} request.orderBys + * Specifies how rows are ordered in the response. + * @param {string} request.currencyCode + * A currency code in ISO4217 format, such as "AED", "USD", "JPY". + * If the field is empty, the report uses the property's default currency. + * @param {google.analytics.data.v1beta.CohortSpec} request.cohortSpec + * Cohort group associated with this request. If there is a cohort group + * in the request the 'cohort' dimension must be present. + * @param {boolean} request.keepEmptyRows + * If false or unspecified, each row with all metrics equal to 0 will not be + * returned. If true, these rows will be returned if they are not separately + * removed by a filter. + * @param {boolean} request.returnPropertyQuota + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in [PropertyQuota](#PropertyQuota). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RunReportResponse]{@link google.analytics.data.v1beta.RunReportResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/beta_analytics_data.run_report.js + * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_RunReport_async + */ + runReport( + request?: protos.google.analytics.data.v1beta.IRunReportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.analytics.data.v1beta.IRunReportResponse, + protos.google.analytics.data.v1beta.IRunReportRequest | undefined, + {} | undefined + ] + >; + runReport( + request: protos.google.analytics.data.v1beta.IRunReportRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1beta.IRunReportResponse, + protos.google.analytics.data.v1beta.IRunReportRequest | null | undefined, + {} | null | undefined + > + ): void; + runReport( + request: protos.google.analytics.data.v1beta.IRunReportRequest, + callback: Callback< + protos.google.analytics.data.v1beta.IRunReportResponse, + protos.google.analytics.data.v1beta.IRunReportRequest | null | undefined, + {} | null | undefined + > + ): void; + runReport( + request?: protos.google.analytics.data.v1beta.IRunReportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.analytics.data.v1beta.IRunReportResponse, + | protos.google.analytics.data.v1beta.IRunReportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.analytics.data.v1beta.IRunReportResponse, + protos.google.analytics.data.v1beta.IRunReportRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.analytics.data.v1beta.IRunReportResponse, + protos.google.analytics.data.v1beta.IRunReportRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + property: request.property ?? '', + }); + this.initialize(); + return this.innerApiCalls.runReport(request, options, callback); + } + /** + * Returns a customized pivot report of your Google Analytics event data. + * Pivot reports are more advanced and expressive formats than regular + * reports. In a pivot report, dimensions are only visible if they are + * included in a pivot. Multiple pivots can be specified to further dissect + * your data. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see [where to + * find your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * Within a batch request, this property should either be unspecified or + * consistent with the batch-level property. + * + * Example: properties/1234 + * @param {number[]} request.dimensions + * The dimensions requested. All defined dimensions must be used by one of the + * following: dimension_expression, dimension_filter, pivots, order_bys. + * @param {number[]} request.metrics + * The metrics requested, at least one metric needs to be specified. All + * defined metrics must be used by one of the following: metric_expression, + * metric_filter, order_bys. + * @param {number[]} request.dateRanges + * The date range to retrieve event data for the report. If multiple date + * ranges are specified, event data from each date range is used in the + * report. A special dimension with field name "dateRange" can be included in + * a Pivot's field names; if included, the report compares between date + * ranges. In a cohort request, this `dateRanges` must be unspecified. + * @param {number[]} request.pivots + * Describes the visual format of the report's dimensions in columns or rows. + * The union of the fieldNames (dimension names) in all pivots must be a + * subset of dimension names defined in Dimensions. No two pivots can share a + * dimension. A dimension is only visible if it appears in a pivot. + * @param {google.analytics.data.v1beta.FilterExpression} request.dimensionFilter + * The filter clause of dimensions. Dimensions must be requested to be used in + * this filter. Metrics cannot be used in this filter. + * @param {google.analytics.data.v1beta.FilterExpression} request.metricFilter + * The filter clause of metrics. Applied at post aggregation phase, similar to + * SQL having-clause. Metrics must be requested to be used in this filter. + * Dimensions cannot be used in this filter. + * @param {string} request.currencyCode + * A currency code in ISO4217 format, such as "AED", "USD", "JPY". + * If the field is empty, the report uses the property's default currency. + * @param {google.analytics.data.v1beta.CohortSpec} request.cohortSpec + * Cohort group associated with this request. If there is a cohort group + * in the request the 'cohort' dimension must be present. + * @param {boolean} request.keepEmptyRows + * If false or unspecified, each row with all metrics equal to 0 will not be + * returned. If true, these rows will be returned if they are not separately + * removed by a filter. + * @param {boolean} request.returnPropertyQuota + * Toggles whether to return the current state of this Analytics Property's + * quota. Quota is returned in [PropertyQuota](#PropertyQuota). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RunPivotReportResponse]{@link google.analytics.data.v1beta.RunPivotReportResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/beta_analytics_data.run_pivot_report.js + * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_RunPivotReport_async + */ + runPivotReport( + request?: protos.google.analytics.data.v1beta.IRunPivotReportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.analytics.data.v1beta.IRunPivotReportResponse, + protos.google.analytics.data.v1beta.IRunPivotReportRequest | undefined, + {} | undefined + ] + >; + runPivotReport( + request: protos.google.analytics.data.v1beta.IRunPivotReportRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1beta.IRunPivotReportResponse, + | protos.google.analytics.data.v1beta.IRunPivotReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + runPivotReport( + request: protos.google.analytics.data.v1beta.IRunPivotReportRequest, + callback: Callback< + protos.google.analytics.data.v1beta.IRunPivotReportResponse, + | protos.google.analytics.data.v1beta.IRunPivotReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + runPivotReport( + request?: protos.google.analytics.data.v1beta.IRunPivotReportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.analytics.data.v1beta.IRunPivotReportResponse, + | protos.google.analytics.data.v1beta.IRunPivotReportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.analytics.data.v1beta.IRunPivotReportResponse, + | protos.google.analytics.data.v1beta.IRunPivotReportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.analytics.data.v1beta.IRunPivotReportResponse, + protos.google.analytics.data.v1beta.IRunPivotReportRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + property: request.property ?? '', + }); + this.initialize(); + return this.innerApiCalls.runPivotReport(request, options, callback); + } + /** + * Returns multiple reports in a batch. All reports must be for the same + * GA4 Property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see [where to + * find your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * This property must be specified for the batch. The property within + * RunReportRequest may either be unspecified or consistent with this + * property. + * + * Example: properties/1234 + * @param {number[]} request.requests + * Individual requests. Each request has a separate report response. Each + * batch request is allowed up to 5 requests. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchRunReportsResponse]{@link google.analytics.data.v1beta.BatchRunReportsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/beta_analytics_data.batch_run_reports.js + * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunReports_async + */ + batchRunReports( + request?: protos.google.analytics.data.v1beta.IBatchRunReportsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.analytics.data.v1beta.IBatchRunReportsResponse, + protos.google.analytics.data.v1beta.IBatchRunReportsRequest | undefined, + {} | undefined + ] + >; + batchRunReports( + request: protos.google.analytics.data.v1beta.IBatchRunReportsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1beta.IBatchRunReportsResponse, + | protos.google.analytics.data.v1beta.IBatchRunReportsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchRunReports( + request: protos.google.analytics.data.v1beta.IBatchRunReportsRequest, + callback: Callback< + protos.google.analytics.data.v1beta.IBatchRunReportsResponse, + | protos.google.analytics.data.v1beta.IBatchRunReportsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchRunReports( + request?: protos.google.analytics.data.v1beta.IBatchRunReportsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.analytics.data.v1beta.IBatchRunReportsResponse, + | protos.google.analytics.data.v1beta.IBatchRunReportsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.analytics.data.v1beta.IBatchRunReportsResponse, + | protos.google.analytics.data.v1beta.IBatchRunReportsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.analytics.data.v1beta.IBatchRunReportsResponse, + protos.google.analytics.data.v1beta.IBatchRunReportsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + property: request.property ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchRunReports(request, options, callback); + } + /** + * Returns multiple pivot reports in a batch. All reports must be for the same + * GA4 Property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see [where to + * find your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * This property must be specified for the batch. The property within + * RunPivotReportRequest may either be unspecified or consistent with this + * property. + * + * Example: properties/1234 + * @param {number[]} request.requests + * Individual requests. Each request has a separate pivot report response. + * Each batch request is allowed up to 5 requests. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchRunPivotReportsResponse]{@link google.analytics.data.v1beta.BatchRunPivotReportsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js + * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunPivotReports_async + */ + batchRunPivotReports( + request?: protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, + ( + | protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest + | undefined + ), + {} | undefined + ] + >; + batchRunPivotReports( + request: protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, + | protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchRunPivotReports( + request: protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest, + callback: Callback< + protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, + | protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchRunPivotReports( + request?: protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, + | protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, + | protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, + ( + | protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + property: request.property ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchRunPivotReports(request, options, callback); + } + /** + * Returns metadata for dimensions and metrics available in reporting methods. + * Used to explore the dimensions and metrics. In this method, a Google + * Analytics GA4 Property Identifier is specified in the request, and + * the metadata response includes Custom dimensions and metrics as well as + * Universal metadata. + * + * For example if a custom metric with parameter name `levels_unlocked` is + * registered to a property, the Metadata response will contain + * `customEvent:levels_unlocked`. Universal metadata are dimensions and + * metrics applicable to any property such as `country` and `totalUsers`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the metadata to retrieve. This name field is + * specified in the URL path and not URL parameters. Property is a numeric + * Google Analytics GA4 Property identifier. To learn more, see [where to find + * your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * + * Example: properties/1234/metadata + * + * Set the Property ID to 0 for dimensions and metrics common to all + * properties. In this special mode, this method will not return custom + * dimensions and metrics. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Metadata]{@link google.analytics.data.v1beta.Metadata}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/beta_analytics_data.get_metadata.js + * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_GetMetadata_async + */ + getMetadata( + request?: protos.google.analytics.data.v1beta.IGetMetadataRequest, + options?: CallOptions + ): Promise< + [ + protos.google.analytics.data.v1beta.IMetadata, + protos.google.analytics.data.v1beta.IGetMetadataRequest | undefined, + {} | undefined + ] + >; + getMetadata( + request: protos.google.analytics.data.v1beta.IGetMetadataRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1beta.IMetadata, + | protos.google.analytics.data.v1beta.IGetMetadataRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMetadata( + request: protos.google.analytics.data.v1beta.IGetMetadataRequest, + callback: Callback< + protos.google.analytics.data.v1beta.IMetadata, + | protos.google.analytics.data.v1beta.IGetMetadataRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMetadata( + request?: protos.google.analytics.data.v1beta.IGetMetadataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.analytics.data.v1beta.IMetadata, + | protos.google.analytics.data.v1beta.IGetMetadataRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.analytics.data.v1beta.IMetadata, + | protos.google.analytics.data.v1beta.IGetMetadataRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.analytics.data.v1beta.IMetadata, + protos.google.analytics.data.v1beta.IGetMetadataRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getMetadata(request, options, callback); + } + /** + * Returns a customized report of realtime event data for your property. + * Events appear in realtime reports seconds after they have been sent to + * the Google Analytics. Realtime reports show events and usage data for the + * periods of time ranging from the present moment to 30 minutes ago (up to + * 60 minutes for Google Analytics 360 properties). + * + * For a guide to constructing realtime requests & understanding responses, + * see [Creating a Realtime + * Report](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-basics). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * A Google Analytics GA4 property identifier whose events are tracked. + * Specified in the URL path and not the body. To learn more, see [where to + * find your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * + * Example: properties/1234 + * @param {number[]} request.dimensions + * The dimensions requested and displayed. + * @param {number[]} request.metrics + * The metrics requested and displayed. + * @param {google.analytics.data.v1beta.FilterExpression} request.dimensionFilter + * The filter clause of dimensions. Metrics cannot be used in this filter. + * @param {google.analytics.data.v1beta.FilterExpression} request.metricFilter + * The filter clause of metrics. Applied at post aggregation phase, similar to + * SQL having-clause. Dimensions cannot be used in this filter. + * @param {number} request.limit + * The number of rows to return. If unspecified, 10,000 rows are returned. The + * API returns a maximum of 100,000 rows per request, no matter how many you + * ask for. `limit` must be positive. + * + * The API can also return fewer rows than the requested `limit`, if there + * aren't as many dimension values as the `limit`. For instance, there are + * fewer than 300 possible values for the dimension `country`, so when + * reporting on only `country`, you can't get more than 300 rows, even if you + * set `limit` to a higher value. + * @param {number[]} request.metricAggregations + * Aggregation of metrics. Aggregated metric values will be shown in rows + * where the dimension_values are set to "RESERVED_(MetricAggregation)". + * @param {number[]} request.orderBys + * Specifies how rows are ordered in the response. + * @param {boolean} request.returnPropertyQuota + * Toggles whether to return the current state of this Analytics Property's + * Realtime quota. Quota is returned in [PropertyQuota](#PropertyQuota). + * @param {number[]} request.minuteRanges + * The minute ranges of event data to read. If unspecified, one minute range + * for the last 30 minutes will be used. If multiple minute ranges are + * requested, each response row will contain a zero based minute range index. + * If two minute ranges overlap, the event data for the overlapping minutes is + * included in the response rows for both minute ranges. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RunRealtimeReportResponse]{@link google.analytics.data.v1beta.RunRealtimeReportResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/beta_analytics_data.run_realtime_report.js + * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_RunRealtimeReport_async + */ + runRealtimeReport( + request?: protos.google.analytics.data.v1beta.IRunRealtimeReportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, + protos.google.analytics.data.v1beta.IRunRealtimeReportRequest | undefined, + {} | undefined + ] + >; + runRealtimeReport( + request: protos.google.analytics.data.v1beta.IRunRealtimeReportRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, + | protos.google.analytics.data.v1beta.IRunRealtimeReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + runRealtimeReport( + request: protos.google.analytics.data.v1beta.IRunRealtimeReportRequest, + callback: Callback< + protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, + | protos.google.analytics.data.v1beta.IRunRealtimeReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + runRealtimeReport( + request?: protos.google.analytics.data.v1beta.IRunRealtimeReportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, + | protos.google.analytics.data.v1beta.IRunRealtimeReportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, + | protos.google.analytics.data.v1beta.IRunRealtimeReportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, + protos.google.analytics.data.v1beta.IRunRealtimeReportRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + property: request.property ?? '', + }); + this.initialize(); + return this.innerApiCalls.runRealtimeReport(request, options, callback); + } + /** + * This compatibility method lists dimensions and metrics that can be added to + * a report request and maintain compatibility. This method fails if the + * request's dimensions and metrics are incompatible. + * + * In Google Analytics, reports fail if they request incompatible dimensions + * and/or metrics; in that case, you will need to remove dimensions and/or + * metrics from the incompatible report until the report is compatible. + * + * The Realtime and Core reports have different compatibility rules. This + * method checks compatibility for Core reports. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.property + * A Google Analytics GA4 property identifier whose events are tracked. To + * learn more, see [where to find your Property + * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + * `property` should be the same value as in your `runReport` request. + * + * Example: properties/1234 + * + * Set the Property ID to 0 for compatibility checking on dimensions and + * metrics common to all properties. In this special mode, this method will + * not return custom dimensions and metrics. + * @param {number[]} request.dimensions + * The dimensions in this report. `dimensions` should be the same value as in + * your `runReport` request. + * @param {number[]} request.metrics + * The metrics in this report. `metrics` should be the same value as in your + * `runReport` request. + * @param {google.analytics.data.v1beta.FilterExpression} request.dimensionFilter + * The filter clause of dimensions. `dimensionFilter` should be the same value + * as in your `runReport` request. + * @param {google.analytics.data.v1beta.FilterExpression} request.metricFilter + * The filter clause of metrics. `metricFilter` should be the same value as in + * your `runReport` request + * @param {google.analytics.data.v1beta.Compatibility} request.compatibilityFilter + * Filters the dimensions and metrics in the response to just this + * compatibility. Commonly used as `”compatibilityFilter”: “COMPATIBLE”` + * to only return compatible dimensions & metrics. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CheckCompatibilityResponse]{@link google.analytics.data.v1beta.CheckCompatibilityResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/beta_analytics_data.check_compatibility.js + * region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_CheckCompatibility_async + */ + checkCompatibility( + request?: protos.google.analytics.data.v1beta.ICheckCompatibilityRequest, + options?: CallOptions + ): Promise< + [ + protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, + ( + | protos.google.analytics.data.v1beta.ICheckCompatibilityRequest + | undefined + ), + {} | undefined + ] + >; + checkCompatibility( + request: protos.google.analytics.data.v1beta.ICheckCompatibilityRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, + | protos.google.analytics.data.v1beta.ICheckCompatibilityRequest + | null + | undefined, + {} | null | undefined + > + ): void; + checkCompatibility( + request: protos.google.analytics.data.v1beta.ICheckCompatibilityRequest, + callback: Callback< + protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, + | protos.google.analytics.data.v1beta.ICheckCompatibilityRequest + | null + | undefined, + {} | null | undefined + > + ): void; + checkCompatibility( + request?: protos.google.analytics.data.v1beta.ICheckCompatibilityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, + | protos.google.analytics.data.v1beta.ICheckCompatibilityRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, + | protos.google.analytics.data.v1beta.ICheckCompatibilityRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, + ( + | protos.google.analytics.data.v1beta.ICheckCompatibilityRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + property: request.property ?? '', + }); + this.initialize(); + return this.innerApiCalls.checkCompatibility(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified metadata resource name string. + * + * @param {string} property + * @returns {string} Resource name string. + */ + metadataPath(property: string) { + return this.pathTemplates.metadataPathTemplate.render({ + property: property, + }); + } + + /** + * Parse the property from Metadata resource. + * + * @param {string} metadataName + * A fully-qualified path representing Metadata resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromMetadataName(metadataName: string) { + return this.pathTemplates.metadataPathTemplate.match(metadataName).property; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.betaAnalyticsDataStub && !this._terminated) { + return this.betaAnalyticsDataStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-analytics-data/src/v1beta/beta_analytics_data_client_config.json b/packages/google-analytics-data/src/v1beta/beta_analytics_data_client_config.json new file mode 100644 index 00000000000..5587c0974ee --- /dev/null +++ b/packages/google-analytics-data/src/v1beta/beta_analytics_data_client_config.json @@ -0,0 +1,61 @@ +{ + "interfaces": { + "google.analytics.data.v1beta.BetaAnalyticsData": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "RunReport": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RunPivotReport": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchRunReports": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchRunPivotReports": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMetadata": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RunRealtimeReport": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CheckCompatibility": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-analytics-data/src/v1beta/beta_analytics_data_proto_list.json b/packages/google-analytics-data/src/v1beta/beta_analytics_data_proto_list.json new file mode 100644 index 00000000000..89471a4231a --- /dev/null +++ b/packages/google-analytics-data/src/v1beta/beta_analytics_data_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/analytics/data/v1beta/analytics_data_api.proto", + "../../protos/google/analytics/data/v1beta/data.proto" +] diff --git a/packages/google-analytics-data/src/v1beta/gapic_metadata.json b/packages/google-analytics-data/src/v1beta/gapic_metadata.json new file mode 100644 index 00000000000..3ec307b6ae2 --- /dev/null +++ b/packages/google-analytics-data/src/v1beta/gapic_metadata.json @@ -0,0 +1,93 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.analytics.data.v1beta", + "libraryPackage": "@google-analytics/data", + "services": { + "BetaAnalyticsData": { + "clients": { + "grpc": { + "libraryClient": "BetaAnalyticsDataClient", + "rpcs": { + "RunReport": { + "methods": [ + "runReport" + ] + }, + "RunPivotReport": { + "methods": [ + "runPivotReport" + ] + }, + "BatchRunReports": { + "methods": [ + "batchRunReports" + ] + }, + "BatchRunPivotReports": { + "methods": [ + "batchRunPivotReports" + ] + }, + "GetMetadata": { + "methods": [ + "getMetadata" + ] + }, + "RunRealtimeReport": { + "methods": [ + "runRealtimeReport" + ] + }, + "CheckCompatibility": { + "methods": [ + "checkCompatibility" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BetaAnalyticsDataClient", + "rpcs": { + "RunReport": { + "methods": [ + "runReport" + ] + }, + "RunPivotReport": { + "methods": [ + "runPivotReport" + ] + }, + "BatchRunReports": { + "methods": [ + "batchRunReports" + ] + }, + "BatchRunPivotReports": { + "methods": [ + "batchRunPivotReports" + ] + }, + "GetMetadata": { + "methods": [ + "getMetadata" + ] + }, + "RunRealtimeReport": { + "methods": [ + "runRealtimeReport" + ] + }, + "CheckCompatibility": { + "methods": [ + "checkCompatibility" + ] + } + } + } + } + } + } +} diff --git a/packages/google-analytics-data/src/v1beta/index.ts b/packages/google-analytics-data/src/v1beta/index.ts new file mode 100644 index 00000000000..36af99e4a17 --- /dev/null +++ b/packages/google-analytics-data/src/v1beta/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {BetaAnalyticsDataClient} from './beta_analytics_data_client'; diff --git a/packages/google-analytics-data/system-test/fixtures/sample/src/index.js b/packages/google-analytics-data/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..597348bb604 --- /dev/null +++ b/packages/google-analytics-data/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const data = require('@google-analytics/data'); + +function main() { + const betaAnalyticsDataClient = new data.BetaAnalyticsDataClient(); +} + +main(); diff --git a/packages/google-analytics-data/system-test/fixtures/sample/src/index.ts b/packages/google-analytics-data/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..f052efcd61e --- /dev/null +++ b/packages/google-analytics-data/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {BetaAnalyticsDataClient} from '@google-analytics/data'; + +// check that the client class type name can be used +function doStuffWithBetaAnalyticsDataClient(client: BetaAnalyticsDataClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const betaAnalyticsDataClient = new BetaAnalyticsDataClient(); + doStuffWithBetaAnalyticsDataClient(betaAnalyticsDataClient); +} + +main(); diff --git a/packages/google-analytics-data/system-test/install.ts b/packages/google-analytics-data/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-analytics-data/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-analytics-data/test/gapic_alpha_analytics_data_v1alpha.ts b/packages/google-analytics-data/test/gapic_alpha_analytics_data_v1alpha.ts new file mode 100644 index 00000000000..7ba06bcbe79 --- /dev/null +++ b/packages/google-analytics-data/test/gapic_alpha_analytics_data_v1alpha.ts @@ -0,0 +1,308 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as alphaanalyticsdataModule from '../src'; + +import {protobuf} from 'google-gax'; + +// 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); +} + +describe('v1alpha.AlphaAnalyticsDataClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alphaAnalyticsDataStub, undefined); + await client.initialize(); + assert(client.alphaAnalyticsDataStub); + }); + + it('has close method for the initialized client', done => { + const client = + new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.alphaAnalyticsDataStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alphaAnalyticsDataStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('runFunnelReport', () => { + it('invokes runFunnelReport without error', async () => { + const client = + new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1alpha.RunFunnelReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1alpha.RunFunnelReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1alpha.RunFunnelReportResponse() + ); + client.innerApiCalls.runFunnelReport = stubSimpleCall(expectedResponse); + const [response] = await client.runFunnelReport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runFunnelReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runFunnelReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runFunnelReport without error using callback', async () => { + const client = + new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1alpha.RunFunnelReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1alpha.RunFunnelReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1alpha.RunFunnelReportResponse() + ); + client.innerApiCalls.runFunnelReport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runFunnelReport( + request, + ( + err?: Error | null, + result?: protos.google.analytics.data.v1alpha.IRunFunnelReportResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runFunnelReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runFunnelReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runFunnelReport with error', async () => { + const client = + new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1alpha.RunFunnelReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1alpha.RunFunnelReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runFunnelReport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.runFunnelReport(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runFunnelReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runFunnelReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runFunnelReport with closed client', async () => { + const client = + new alphaanalyticsdataModule.v1alpha.AlphaAnalyticsDataClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1alpha.RunFunnelReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1alpha.RunFunnelReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.runFunnelReport(request), expectedError); + }); + }); +}); diff --git a/packages/google-analytics-data/test/gapic_beta_analytics_data_v1beta.ts b/packages/google-analytics-data/test/gapic_beta_analytics_data_v1beta.ts new file mode 100644 index 00000000000..35593fc93db --- /dev/null +++ b/packages/google-analytics-data/test/gapic_beta_analytics_data_v1beta.ts @@ -0,0 +1,1186 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as betaanalyticsdataModule from '../src'; + +import {protobuf} from 'google-gax'; + +// 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); +} + +describe('v1beta.BetaAnalyticsDataClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.betaAnalyticsDataStub, undefined); + await client.initialize(); + assert(client.betaAnalyticsDataStub); + }); + + it('has close method for the initialized client', done => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.betaAnalyticsDataStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.betaAnalyticsDataStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('runReport', () => { + it('invokes runReport without error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.RunReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunReportResponse() + ); + client.innerApiCalls.runReport = stubSimpleCall(expectedResponse); + const [response] = await client.runReport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runReport without error using callback', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.RunReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunReportResponse() + ); + client.innerApiCalls.runReport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runReport( + request, + ( + err?: Error | null, + result?: protos.google.analytics.data.v1beta.IRunReportResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runReport with error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.RunReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runReport = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.runReport(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runReport with closed client', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.RunReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.runReport(request), expectedError); + }); + }); + + describe('runPivotReport', () => { + it('invokes runPivotReport without error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunPivotReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.RunPivotReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunPivotReportResponse() + ); + client.innerApiCalls.runPivotReport = stubSimpleCall(expectedResponse); + const [response] = await client.runPivotReport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runPivotReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runPivotReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runPivotReport without error using callback', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunPivotReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.RunPivotReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunPivotReportResponse() + ); + client.innerApiCalls.runPivotReport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runPivotReport( + request, + ( + err?: Error | null, + result?: protos.google.analytics.data.v1beta.IRunPivotReportResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runPivotReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runPivotReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runPivotReport with error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunPivotReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.RunPivotReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runPivotReport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.runPivotReport(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runPivotReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runPivotReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runPivotReport with closed client', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunPivotReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.RunPivotReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.runPivotReport(request), expectedError); + }); + }); + + describe('batchRunReports', () => { + it('invokes batchRunReports without error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.BatchRunReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.BatchRunReportsRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1beta.BatchRunReportsResponse() + ); + client.innerApiCalls.batchRunReports = stubSimpleCall(expectedResponse); + const [response] = await client.batchRunReports(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchRunReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRunReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRunReports without error using callback', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.BatchRunReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.BatchRunReportsRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1beta.BatchRunReportsResponse() + ); + client.innerApiCalls.batchRunReports = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchRunReports( + request, + ( + err?: Error | null, + result?: protos.google.analytics.data.v1beta.IBatchRunReportsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchRunReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRunReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRunReports with error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.BatchRunReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.BatchRunReportsRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchRunReports = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.batchRunReports(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchRunReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRunReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRunReports with closed client', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.BatchRunReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.BatchRunReportsRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchRunReports(request), expectedError); + }); + }); + + describe('batchRunPivotReports', () => { + it('invokes batchRunPivotReports without error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.BatchRunPivotReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.BatchRunPivotReportsRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1beta.BatchRunPivotReportsResponse() + ); + client.innerApiCalls.batchRunPivotReports = + stubSimpleCall(expectedResponse); + const [response] = await client.batchRunPivotReports(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchRunPivotReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRunPivotReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRunPivotReports without error using callback', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.BatchRunPivotReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.BatchRunPivotReportsRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1beta.BatchRunPivotReportsResponse() + ); + client.innerApiCalls.batchRunPivotReports = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchRunPivotReports( + request, + ( + err?: Error | null, + result?: protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchRunPivotReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRunPivotReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRunPivotReports with error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.BatchRunPivotReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.BatchRunPivotReportsRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchRunPivotReports = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.batchRunPivotReports(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchRunPivotReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRunPivotReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRunPivotReports with closed client', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.BatchRunPivotReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.BatchRunPivotReportsRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchRunPivotReports(request), expectedError); + }); + }); + + describe('getMetadata', () => { + it('invokes getMetadata without error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.GetMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.GetMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1beta.Metadata() + ); + client.innerApiCalls.getMetadata = stubSimpleCall(expectedResponse); + const [response] = await client.getMetadata(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMetadata without error using callback', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.GetMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.GetMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1beta.Metadata() + ); + client.innerApiCalls.getMetadata = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMetadata( + request, + ( + err?: Error | null, + result?: protos.google.analytics.data.v1beta.IMetadata | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMetadata with error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.GetMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.GetMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMetadata = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getMetadata(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMetadata with closed client', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.GetMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.GetMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMetadata(request), expectedError); + }); + }); + + describe('runRealtimeReport', () => { + it('invokes runRealtimeReport without error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunRealtimeReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.RunRealtimeReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunRealtimeReportResponse() + ); + client.innerApiCalls.runRealtimeReport = stubSimpleCall(expectedResponse); + const [response] = await client.runRealtimeReport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runRealtimeReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runRealtimeReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runRealtimeReport without error using callback', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunRealtimeReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.RunRealtimeReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunRealtimeReportResponse() + ); + client.innerApiCalls.runRealtimeReport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runRealtimeReport( + request, + ( + err?: Error | null, + result?: protos.google.analytics.data.v1beta.IRunRealtimeReportResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runRealtimeReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runRealtimeReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runRealtimeReport with error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunRealtimeReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.RunRealtimeReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runRealtimeReport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.runRealtimeReport(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runRealtimeReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runRealtimeReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runRealtimeReport with closed client', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.RunRealtimeReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.RunRealtimeReportRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.runRealtimeReport(request), expectedError); + }); + }); + + describe('checkCompatibility', () => { + it('invokes checkCompatibility without error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.CheckCompatibilityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.CheckCompatibilityRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1beta.CheckCompatibilityResponse() + ); + client.innerApiCalls.checkCompatibility = + stubSimpleCall(expectedResponse); + const [response] = await client.checkCompatibility(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkCompatibility as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkCompatibility as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCompatibility without error using callback', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.CheckCompatibilityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.CheckCompatibilityRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.data.v1beta.CheckCompatibilityResponse() + ); + client.innerApiCalls.checkCompatibility = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkCompatibility( + request, + ( + err?: Error | null, + result?: protos.google.analytics.data.v1beta.ICheckCompatibilityResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkCompatibility as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkCompatibility as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCompatibility with error', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.CheckCompatibilityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.CheckCompatibilityRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkCompatibility = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCompatibility(request), expectedError); + const actualRequest = ( + client.innerApiCalls.checkCompatibility as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkCompatibility as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCompatibility with closed client', async () => { + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.data.v1beta.CheckCompatibilityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.analytics.data.v1beta.CheckCompatibilityRequest', + ['property'] + ); + request.property = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.checkCompatibility(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('metadata', () => { + const fakePath = '/rendered/path/metadata'; + const expectedParameters = { + property: 'propertyValue', + }; + const client = new betaanalyticsdataModule.v1beta.BetaAnalyticsDataClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.metadataPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataPath', () => { + const result = client.metadataPath('propertyValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPropertyFromMetadataName', () => { + const result = client.matchPropertyFromMetadataName(fakePath); + assert.strictEqual(result, 'propertyValue'); + assert( + (client.pathTemplates.metadataPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-analytics-data/tsconfig.json b/packages/google-analytics-data/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-analytics-data/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/packages/google-analytics-data/webpack.config.js b/packages/google-analytics-data/webpack.config.js new file mode 100644 index 00000000000..2c4564b3298 --- /dev/null +++ b/packages/google-analytics-data/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'BetaAnalyticsData', + filename: './beta-analytics-data.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +};